Java 类ims.nursing.vo.domain.RepositioningPlanVoAssembler 实例源码

项目:AvoinApotti    文件:RepositioningPlanImpl.java   
public RepositioningPlanVoCollection listRepositioningPlanByCareContext(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from RepositioningPlan rp";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
        andStr = " and ";
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc");

    if (markers.size() > 0) query += " where ";
    query += hql.toString();

    List plan = factory.find(query, markers, values);   
    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null)
        return collRepositioningPlanVo.sort(SortOrder.DESCENDING);

    return null;
}
项目:AvoinApotti    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo getLastCompletedRepositioningPlan(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from RepositioningPlan rp ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(" where ");
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc ");

    List plan = factory.find(hql.toString(), markers, values);  
    if(plan != null && plan.size() > 1)
    {
        Object firstItem = plan.get(0);
        plan.removeAll(plan);
        plan.add(firstItem);
    }

    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null && collRepositioningPlanVo.size() > 0)
        return collRepositioningPlanVo.get(0);

    return null;
}
项目:AvoinApotti    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo saveRepositioningPlan(RepositioningPlanVo voRepositioningPlan) throws StaleObjectException 
{
    if(!voRepositioningPlan.isValidated())
        throw new DomainRuntimeException("This Repositioning Plan has not been validated");

    DomainFactory factory = getDomainFactory();
    RepositioningPlan doRepositioning = RepositioningPlanVoAssembler.extractRepositioningPlan(factory, voRepositioningPlan);
    factory.save(doRepositioning);
    return RepositioningPlanVoAssembler.create(doRepositioning);
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVoCollection listRepositioningPlanByCareContext(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from RepositioningPlan rp";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
        andStr = " and ";
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc");

    if (markers.size() > 0) query += " where ";
    query += hql.toString();

    List plan = factory.find(query, markers, values);   
    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null)
        return collRepositioningPlanVo.sort(SortOrder.DESCENDING);

    return null;
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo getLastCompletedRepositioningPlan(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from RepositioningPlan rp ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(" where ");
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc ");

    List plan = factory.find(hql.toString(), markers, values);  
    if(plan != null && plan.size() > 1)
    {
        Object firstItem = plan.get(0);
        plan.removeAll(plan);
        plan.add(firstItem);
    }

    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null && collRepositioningPlanVo.size() > 0)
        return collRepositioningPlanVo.get(0);

    return null;
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo saveRepositioningPlan(RepositioningPlanVo voRepositioningPlan) throws StaleObjectException 
{
    if(!voRepositioningPlan.isValidated())
        throw new DomainRuntimeException("This Repositioning Plan has not been validated");

    DomainFactory factory = getDomainFactory();
    RepositioningPlan doRepositioning = RepositioningPlanVoAssembler.extractRepositioningPlan(factory, voRepositioningPlan);
    factory.save(doRepositioning);
    return RepositioningPlanVoAssembler.create(doRepositioning);
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVoCollection listRepositioningPlanByCareContext(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from RepositioningPlan rp";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
        andStr = " and ";
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc");

    if (markers.size() > 0) query += " where ";
    query += hql.toString();

    List plan = factory.find(query, markers, values);   
    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null)
        return collRepositioningPlanVo.sort(SortOrder.DESCENDING);

    return null;
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo getLastCompletedRepositioningPlan(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from RepositioningPlan rp ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(" where ");
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc ");

    List plan = factory.find(hql.toString(), markers, values);  
    if(plan != null && plan.size() > 1)
    {
        Object firstItem = plan.get(0);
        plan.removeAll(plan);
        plan.add(firstItem);
    }

    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null && collRepositioningPlanVo.size() > 0)
        return collRepositioningPlanVo.get(0);

    return null;
}
项目:openMAXIMS    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo saveRepositioningPlan(RepositioningPlanVo voRepositioningPlan) throws StaleObjectException 
{
    if(!voRepositioningPlan.isValidated())
        throw new DomainRuntimeException("This Repositioning Plan has not been validated");

    DomainFactory factory = getDomainFactory();
    RepositioningPlan doRepositioning = RepositioningPlanVoAssembler.extractRepositioningPlan(factory, voRepositioningPlan);
    factory.save(doRepositioning);
    return RepositioningPlanVoAssembler.create(doRepositioning);
}
项目:openmaxims-linux    文件:RepositioningPlanImpl.java   
public RepositioningPlanVoCollection listRepositioningPlanByCareContext(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from RepositioningPlan rp";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
        andStr = " and ";
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc");

    if (markers.size() > 0) query += " where ";
    query += hql.toString();

    List plan = factory.find(query, markers, values);   
    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null)
        return collRepositioningPlanVo.sort(SortOrder.DESCENDING);

    return null;
}
项目:openmaxims-linux    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo getLastCompletedRepositioningPlan(CareContextRefVo voCareContextRef) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from RepositioningPlan rp ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (voCareContextRef != null)
    {
        hql.append(" where ");
        hql.append(andStr + " rp.careContext.id = :id_CareContext");
        markers.add("id_CareContext");
        values.add(voCareContextRef.getID_CareContext());           
    }

    hql.append(" order by rp.authoringInformation.authoringDateTime desc ");

    List plan = factory.find(hql.toString(), markers, values);  
    if(plan != null && plan.size() > 1)
    {
        Object firstItem = plan.get(0);
        plan.removeAll(plan);
        plan.add(firstItem);
    }

    RepositioningPlanVoCollection collRepositioningPlanVo = RepositioningPlanVoAssembler.createRepositioningPlanVoCollectionFromRepositioningPlan(plan);
    if(collRepositioningPlanVo != null && collRepositioningPlanVo.size() > 0)
        return collRepositioningPlanVo.get(0);

    return null;
}
项目:openmaxims-linux    文件:RepositioningPlanImpl.java   
public RepositioningPlanVo saveRepositioningPlan(RepositioningPlanVo voRepositioningPlan) throws StaleObjectException 
{
    if(!voRepositioningPlan.isValidated())
        throw new DomainRuntimeException("This Repositioning Plan has not been validated");

    DomainFactory factory = getDomainFactory();
    RepositioningPlan doRepositioning = RepositioningPlanVoAssembler.extractRepositioningPlan(factory, voRepositioningPlan);
    factory.save(doRepositioning);
    return RepositioningPlanVoAssembler.create(doRepositioning);
}