Java 类ims.admin.vo.domain.ServiceVoLiteVoAssembler 实例源码

项目:AvoinApotti    文件:ServiceMultipleSelectDialogImpl.java   
public ims.admin.vo.ServiceVoLiteVoCollection getServices(String serviceName, ims.core.vo.lookups.ServiceCategory serviceCategory)
{
    if (serviceName  == null || serviceName.length() == 0 )
    {
        throw new DomainRuntimeException("No search criteria specified");
    }

    StringBuilder hqlBuilder = new StringBuilder("select s1_1 from Service as s1_1 left join s1_1.serviceCategory as l1_1 where ");
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    String and = "";

    if (serviceName!=null && serviceName.length()>0)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" s1_1.upperName like :cName ");
        and = "and ";
        paramNames.add("cName");
        paramValues.add("%" + serviceName.toUpperCase() + "%");
    }
    if (serviceCategory != null)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" l1_1.id = :cType ");
        and = "and ";
        paramNames.add("cType");
        paramValues.add(serviceCategory.getID());
    }

    hqlBuilder.append(and);
    hqlBuilder.append(" s1_1.isActive = :isActive");
    paramNames.add("isActive");
    paramValues.add(new Boolean(true));

    List dos = getDomainFactory().find(hqlBuilder.toString(),paramNames,paramValues);

    if (dos == null || dos.size() == 0)
        return null;

    return ServiceVoLiteVoAssembler.createServiceVoLiteVoCollectionFromService(dos); 

}
项目:openMAXIMS    文件:ServiceMultipleSelectDialogImpl.java   
public ims.admin.vo.ServiceVoLiteVoCollection getServices(String serviceName, ims.core.vo.lookups.ServiceCategory serviceCategory)
{
    if (serviceName  == null || serviceName.length() == 0 )
    {
        throw new DomainRuntimeException("No search criteria specified");
    }

    StringBuilder hqlBuilder = new StringBuilder("select s1_1 from Service as s1_1 left join s1_1.serviceCategory as l1_1 where ");
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    String and = "";

    if (serviceName!=null && serviceName.length()>0)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" s1_1.upperName like :cName ");
        and = "and ";
        paramNames.add("cName");
        paramValues.add("%" + serviceName.toUpperCase() + "%");
    }
    if (serviceCategory != null)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" l1_1.id = :cType ");
        and = "and ";
        paramNames.add("cType");
        paramValues.add(serviceCategory.getID());
    }

    hqlBuilder.append(and);
    hqlBuilder.append(" s1_1.isActive = :isActive");
    paramNames.add("isActive");
    paramValues.add(new Boolean(true));

    List dos = getDomainFactory().find(hqlBuilder.toString(),paramNames,paramValues);

    if (dos == null || dos.size() == 0)
        return null;

    return ServiceVoLiteVoAssembler.createServiceVoLiteVoCollectionFromService(dos); 

}
项目:openmaxims-linux    文件:ServiceMultipleSelectDialogImpl.java   
public ims.admin.vo.ServiceVoLiteVoCollection getServices(String serviceName, ims.core.vo.lookups.ServiceCategory serviceCategory)
{
    if (serviceName  == null || serviceName.length() == 0 )
    {
        throw new DomainRuntimeException("No search criteria specified");
    }

    StringBuilder hqlBuilder = new StringBuilder("select s1_1 from Service as s1_1 left join s1_1.serviceCategory as l1_1 where ");
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    String and = "";

    if (serviceName!=null && serviceName.length()>0)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" s1_1.upperName like :cName ");
        and = "and ";
        paramNames.add("cName");
        paramValues.add("%" + serviceName.toUpperCase() + "%");
    }
    if (serviceCategory != null)
    {
        hqlBuilder.append(and);
        hqlBuilder.append(" l1_1.id = :cType ");
        and = "and ";
        paramNames.add("cType");
        paramValues.add(serviceCategory.getID());
    }

    hqlBuilder.append(and);
    hqlBuilder.append(" s1_1.isActive = :isActive");
    paramNames.add("isActive");
    paramValues.add(new Boolean(true));

    List dos = getDomainFactory().find(hqlBuilder.toString(),paramNames,paramValues);

    if (dos == null || dos.size() == 0)
        return null;

    return ServiceVoLiteVoAssembler.createServiceVoLiteVoCollectionFromService(dos); 

}