/** * Update the ValueObject with the Domain Object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.oncology.domain.objects.ContactTypesByDisciplineItem */ public static ims.oncology.vo.ContactTypesByDisciplineItemVo insert( DomainObjectMap map, ims.oncology.vo.ContactTypesByDisciplineItemVo valueObject, ims.oncology.domain.objects.ContactTypesByDisciplineItem domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_ContactTypesByDisciplineItem(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); // If this is a recordedInError record, and the domainObject // value isIncludeRecord has not been set, then we return null and // not the value object if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; // If this is not a recordedInError record, and the domainObject // value isIncludeRecord has been set, then we return null and // not the value object if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; // ContactType valueObject.setContactType(domainObject.getContactType()); // Active valueObject.setActive(domainObject.isActive()); // Parent if (domainObject.getParent() != null) { if (domainObject.getParent() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the // id already. { HibernateProxy p = (HibernateProxy) domainObject.getParent(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setParent(new ims.oncology.vo.ContactTypesByDisciplineItemRefVo(id, -1)); } else { valueObject.setParent( new ims.oncology.vo.ContactTypesByDisciplineItemRefVo( domainObject.getParent().getId(), domainObject.getParent().getVersion())); } } // TaxonomyMap valueObject.setTaxonomyMap( ims.core.vo.domain.TaxonomyMapAssembler.createTaxonomyMapCollectionFromTaxonomyMap( map, domainObject.getTaxonomyMap())); return valueObject; }
/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.oncology.vo.ContactTypesByDisciplineItemVo copy( ims.oncology.vo.ContactTypesByDisciplineItemVo valueObjectDest, ims.oncology.vo.ContactTypesByDisciplineItemVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_ContactTypesByDisciplineItem( valueObjectSrc.getID_ContactTypesByDisciplineItem()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // ContactType valueObjectDest.setContactType(valueObjectSrc.getContactType()); // Active valueObjectDest.setActive(valueObjectSrc.getActive()); // Parent valueObjectDest.setParent(valueObjectSrc.getParent()); // TaxonomyMap valueObjectDest.setTaxonomyMap(valueObjectSrc.getTaxonomyMap()); return valueObjectDest; }