Java 类ims.core.vo.domain.AllergenTypeReactionsAssembler 实例源码

项目:AvoinApotti    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection listAllergenTypeReactions(ims.core.vo.lookups.AllergenType allergenType) 
{
    DomainFactory factory = getDomainFactory();
    String whereAnd = " where ";

    StringBuffer hql = new StringBuffer("from AllergenTypeReaction r ");
    if (allergenType != null)
    {
        hql.append(" where r.allergenType = :allergenType"); 
        whereAnd = " and ";
    }
    hql.append(whereAnd + " r.isActive = :isActive");

    java.util.List reactions = factory.find(hql.toString(), new String[]{"isActive","allergenType"}, new Object[]{Boolean.TRUE, getDomLookup(allergenType)});
    return (AllergenTypeReactionsAssembler.createAllergenTypeReactionsCollectionFromAllergenTypeReaction(reactions)).sort();
}
项目:openMAXIMS    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection listAllergenTypeReactions(ims.core.vo.lookups.AllergenType allergenType) 
{
    DomainFactory factory = getDomainFactory();
    String whereAnd = " where ";

    StringBuffer hql = new StringBuffer("from AllergenTypeReaction r ");
    if (allergenType != null)
    {
        hql.append(" where r.allergenType = :allergenType"); 
        whereAnd = " and ";
    }
    hql.append(whereAnd + " r.isActive = :isActive");

    java.util.List reactions = factory.find(hql.toString(), new String[]{"isActive","allergenType"}, new Object[]{Boolean.TRUE, getDomLookup(allergenType)});
    return (AllergenTypeReactionsAssembler.createAllergenTypeReactionsCollectionFromAllergenTypeReaction(reactions)).sort();
}
项目:openMAXIMS    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection listAllergenTypeReactions(ims.core.vo.lookups.AllergenType allergenType) 
{
    DomainFactory factory = getDomainFactory();
    String whereAnd = " where ";

    StringBuffer hql = new StringBuffer("from AllergenTypeReaction r ");
    if (allergenType != null)
    {
        hql.append(" where r.allergenType = :allergenType"); 
        whereAnd = " and ";
    }
    hql.append(whereAnd + " r.isActive = :isActive");

    java.util.List reactions = factory.find(hql.toString(), new String[]{"isActive","allergenType"}, new Object[]{Boolean.TRUE, getDomLookup(allergenType)});
    return (AllergenTypeReactionsAssembler.createAllergenTypeReactionsCollectionFromAllergenTypeReaction(reactions)).sort();
}
项目:openmaxims-linux    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection listAllergenTypeReactions(ims.core.vo.lookups.AllergenType allergenType) 
{
    DomainFactory factory = getDomainFactory();
    String whereAnd = " where ";

    StringBuffer hql = new StringBuffer("from AllergenTypeReaction r ");
    if (allergenType != null)
    {
        hql.append(" where r.allergenType = :allergenType"); 
        whereAnd = " and ";
    }
    hql.append(whereAnd + " r.isActive = :isActive");

    java.util.List reactions = factory.find(hql.toString(), new String[]{"isActive","allergenType"}, new Object[]{Boolean.TRUE, getDomLookup(allergenType)});
    return (AllergenTypeReactionsAssembler.createAllergenTypeReactionsCollectionFromAllergenTypeReaction(reactions)).sort();
}
项目:AvoinApotti    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection saveAllergenTypeReaction(ims.core.vo.lookups.AllergenType allergenType, AllergenTypeReactionsCollection allergenTypeReactions) throws ForeignKeyViolationException, StaleObjectException
{
    if (!allergenTypeReactions.isValidated())
    {
        throw new DomainRuntimeException("Allergen Type Reaction Collection has not been validated");
    }

    //Quicker and easier to delete all existing reactions for a type, and re-insert them.
    //Will ensure the uniqueness of AllergenType + Reaction is maintained       
    DomainFactory factory = getDomainFactory();
    String hql1 = " from AllergenTypeReaction r " +
    " where r.allergenType.id = " +  allergenType.getId();

    factory.delete(hql1);

    for (int i = 0; i < allergenTypeReactions.size(); i++)
    {
        AllergenTypeReactions reaction = allergenTypeReactions.get(i);
        if (!reaction.getAllergenType().equals(allergenType))
        {
            throw new DomainRuntimeException("All reactions in an AllergenTypeReaction Collection must be for the same Allergen Type ");
        }
        reaction.setID_AllergenTypeReaction(null);
        AllergenTypeReaction domAllergenTypeReaction = AllergenTypeReactionsAssembler.extractAllergenTypeReaction(factory, reaction);
        factory.save(domAllergenTypeReaction);
        reaction.setID_AllergenTypeReaction(domAllergenTypeReaction.getId());           
    }
    return allergenTypeReactions;
}
项目:openMAXIMS    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection saveAllergenTypeReaction(ims.core.vo.lookups.AllergenType allergenType, AllergenTypeReactionsCollection allergenTypeReactions) throws ForeignKeyViolationException, StaleObjectException
{
    if (!allergenTypeReactions.isValidated())
    {
        throw new DomainRuntimeException("Allergen Type Reaction Collection has not been validated");
    }

    //Quicker and easier to delete all existing reactions for a type, and re-insert them.
    //Will ensure the uniqueness of AllergenType + Reaction is maintained       
    DomainFactory factory = getDomainFactory();
    String hql1 = " from AllergenTypeReaction r " +
    " where r.allergenType.id = " +  allergenType.getId();

    factory.delete(hql1);

    for (int i = 0; i < allergenTypeReactions.size(); i++)
    {
        AllergenTypeReactions reaction = allergenTypeReactions.get(i);
        if (!reaction.getAllergenType().equals(allergenType))
        {
            throw new DomainRuntimeException("All reactions in an AllergenTypeReaction Collection must be for the same Allergen Type ");
        }
        reaction.setID_AllergenTypeReaction(null);
        AllergenTypeReaction domAllergenTypeReaction = AllergenTypeReactionsAssembler.extractAllergenTypeReaction(factory, reaction);
        factory.save(domAllergenTypeReaction);
        reaction.setID_AllergenTypeReaction(domAllergenTypeReaction.getId());           
    }
    return allergenTypeReactions;
}
项目:openMAXIMS    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection saveAllergenTypeReaction(ims.core.vo.lookups.AllergenType allergenType, AllergenTypeReactionsCollection allergenTypeReactions) throws ForeignKeyViolationException, StaleObjectException
{
    if (!allergenTypeReactions.isValidated())
    {
        throw new DomainRuntimeException("Allergen Type Reaction Collection has not been validated");
    }

    //Quicker and easier to delete all existing reactions for a type, and re-insert them.
    //Will ensure the uniqueness of AllergenType + Reaction is maintained       
    DomainFactory factory = getDomainFactory();
    String hql1 = " from AllergenTypeReaction r " +
    " where r.allergenType.id = " +  allergenType.getId();

    factory.delete(hql1);

    for (int i = 0; i < allergenTypeReactions.size(); i++)
    {
        AllergenTypeReactions reaction = allergenTypeReactions.get(i);
        if (!reaction.getAllergenType().equals(allergenType))
        {
            throw new DomainRuntimeException("All reactions in an AllergenTypeReaction Collection must be for the same Allergen Type ");
        }
        reaction.setID_AllergenTypeReaction(null);
        AllergenTypeReaction domAllergenTypeReaction = AllergenTypeReactionsAssembler.extractAllergenTypeReaction(factory, reaction);
        factory.save(domAllergenTypeReaction);
        reaction.setID_AllergenTypeReaction(domAllergenTypeReaction.getId());           
    }
    return allergenTypeReactions;
}
项目:openmaxims-linux    文件:AllergenReactionsImpl.java   
public AllergenTypeReactionsCollection saveAllergenTypeReaction(ims.core.vo.lookups.AllergenType allergenType, AllergenTypeReactionsCollection allergenTypeReactions) throws ForeignKeyViolationException, StaleObjectException
{
    if (!allergenTypeReactions.isValidated())
    {
        throw new DomainRuntimeException("Allergen Type Reaction Collection has not been validated");
    }

    //Quicker and easier to delete all existing reactions for a type, and re-insert them.
    //Will ensure the uniqueness of AllergenType + Reaction is maintained       
    DomainFactory factory = getDomainFactory();
    String hql1 = " from AllergenTypeReaction r " +
    " where r.allergenType.id = " +  allergenType.getId();

    factory.delete(hql1);

    for (int i = 0; i < allergenTypeReactions.size(); i++)
    {
        AllergenTypeReactions reaction = allergenTypeReactions.get(i);
        if (!reaction.getAllergenType().equals(allergenType))
        {
            throw new DomainRuntimeException("All reactions in an AllergenTypeReaction Collection must be for the same Allergen Type ");
        }
        reaction.setID_AllergenTypeReaction(null);
        AllergenTypeReaction domAllergenTypeReaction = AllergenTypeReactionsAssembler.extractAllergenTypeReaction(factory, reaction);
        factory.save(domAllergenTypeReaction);
        reaction.setID_AllergenTypeReaction(domAllergenTypeReaction.getId());           
    }
    return allergenTypeReactions;
}