/** * Create the ValueObject from the ims.scheduling.domain.objects.Sch_Session object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param domainObject */ public static ims.scheduling.vo.SessionManagementVo create( DomainObjectMap map, ims.scheduling.domain.objects.Sch_Session domainObject) { if (null == domainObject) { return null; } // check if the domainObject already has a valueObject created for it ims.scheduling.vo.SessionManagementVo valueObject = (ims.scheduling.vo.SessionManagementVo) map.getValueObject(domainObject, ims.scheduling.vo.SessionManagementVo.class); if (null == valueObject) { valueObject = new ims.scheduling.vo.SessionManagementVo( domainObject.getId(), domainObject.getVersion()); map.addValueObject(domainObject, valueObject); valueObject = insert(map, valueObject, domainObject); } return valueObject; }
/** * Update the ValueObject with the Domain Object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.scheduling.domain.objects.Sch_Session */ public static ims.scheduling.vo.SessionManagementVo insert( DomainObjectMap map, ims.scheduling.vo.SessionManagementVo valueObject, ims.scheduling.domain.objects.Sch_Session domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_Sch_Session(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; // Name valueObject.setName(domainObject.getName()); // SessionDate java.util.Date SessionDate = domainObject.getSessionDate(); if (null != SessionDate) { valueObject.setSessionDate(new ims.framework.utils.Date(SessionDate)); } // StartTm String StartTm = domainObject.getStartTm(); if (null != StartTm) { valueObject.setStartTm(new ims.framework.utils.Time(StartTm)); } // EndTm String EndTm = domainObject.getEndTm(); if (null != EndTm) { valueObject.setEndTm(new ims.framework.utils.Time(EndTm)); } // Service valueObject.setService( ims.core.vo.domain.ServiceShortVoAssembler.create(map, domainObject.getService())); // SessionStatus ims.domain.lookups.LookupInstance instance6 = domainObject.getSessionStatus(); if (null != instance6) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance6.getImage() != null) { img = new ims.framework.utils.ImagePath( instance6.getImage().getImageId(), instance6.getImage().getImagePath()); } color = instance6.getColor(); if (color != null) color.getValue(); ims.scheduling.vo.lookups.Session_Status_and_Reason voLookup6 = new ims.scheduling.vo.lookups.Session_Status_and_Reason( instance6.getId(), instance6.getText(), instance6.isActive(), null, img, color); ims.scheduling.vo.lookups.Session_Status_and_Reason parentVoLookup6 = voLookup6; ims.domain.lookups.LookupInstance parent6 = instance6.getParent(); while (parent6 != null) { if (parent6.getImage() != null) { img = new ims.framework.utils.ImagePath( parent6.getImage().getImageId(), parent6.getImage().getImagePath()); } else { img = null; } color = parent6.getColor(); if (color != null) color.getValue(); parentVoLookup6.setParent( new ims.scheduling.vo.lookups.Session_Status_and_Reason( parent6.getId(), parent6.getText(), parent6.isActive(), null, img, color)); parentVoLookup6 = parentVoLookup6.getParent(); parent6 = parent6.getParent(); } valueObject.setSessionStatus(voLookup6); } // RemainingSlots valueObject.setRemainingSlots(domainObject.getRemainingSlots()); // TotalSlots valueObject.setTotalSlots(domainObject.getTotalSlots()); // RemainingTime valueObject.setRemainingTime(domainObject.getRemainingTime()); // SchLocation valueObject.setSchLocation( ims.core.vo.domain.LocationLiteVoAssembler.create(map, domainObject.getSchLocation())); // SessionType ims.domain.lookups.LookupInstance instance11 = domainObject.getSessionType(); if (null != instance11) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance11.getImage() != null) { img = new ims.framework.utils.ImagePath( instance11.getImage().getImageId(), instance11.getImage().getImagePath()); } color = instance11.getColor(); if (color != null) color.getValue(); ims.scheduling.vo.lookups.Sched_Profile_Type voLookup11 = new ims.scheduling.vo.lookups.Sched_Profile_Type( instance11.getId(), instance11.getText(), instance11.isActive(), null, img, color); ims.scheduling.vo.lookups.Sched_Profile_Type parentVoLookup11 = voLookup11; ims.domain.lookups.LookupInstance parent11 = instance11.getParent(); while (parent11 != null) { if (parent11.getImage() != null) { img = new ims.framework.utils.ImagePath( parent11.getImage().getImageId(), parent11.getImage().getImagePath()); } else { img = null; } color = parent11.getColor(); if (color != null) color.getValue(); parentVoLookup11.setParent( new ims.scheduling.vo.lookups.Sched_Profile_Type( parent11.getId(), parent11.getText(), parent11.isActive(), null, img, color)); parentVoLookup11 = parentVoLookup11.getParent(); parent11 = parent11.getParent(); } valueObject.setSessionType(voLookup11); } // ListOwners valueObject.setListOwners( ims.scheduling.vo.domain.Session_ListOwnerVoAssembler .createSession_ListOwnerVoCollectionFromSession_ListOwner( map, domainObject.getListOwners())); // DirectoryofServices valueObject.setDirectoryofServices( ims.scheduling.vo.domain.DirectoryOfServiceVoAssembler .createDirectoryOfServiceVoCollectionFromDirectoryofService( map, domainObject.getDirectoryofServices())); // IsTheatreSession valueObject.setIsTheatreSession(domainObject.isIsTheatreSession()); return valueObject; }