public static ims.core.admin.pas.domain.objects.ConsultantStay extractConsultantStay( ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.ConsultantStayMinVo valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_ConsultantStay(); ims.core.admin.pas.domain.objects.ConsultantStay domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.core.admin.pas.domain.objects.ConsultantStay) domMap.get(valueObject); } // ims.core.vo.ConsultantStayMinVo ID_ConsultantStay field is unknown domainObject = new ims.core.admin.pas.domain.objects.ConsultantStay(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_ConsultantStay()); if (domMap.get(key) != null) { return (ims.core.admin.pas.domain.objects.ConsultantStay) domMap.get(key); } domainObject = (ims.core.admin.pas.domain.objects.ConsultantStay) domainFactory.getDomainObject( ims.core.admin.pas.domain.objects.ConsultantStay.class, id); // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, // but maybe should be handled as that further up. if (domainObject == null) return null; domMap.put(key, domainObject); } domainObject.setVersion(valueObject.getVersion_ConsultantStay()); ims.framework.utils.DateTime dateTime1 = valueObject.getTransferDateTime(); java.util.Date value1 = null; if (dateTime1 != null) { value1 = dateTime1.getJavaDate(); } domainObject.setTransferDateTime(value1); ims.framework.utils.DateTime dateTime2 = valueObject.getEndDateTime(); java.util.Date value2 = null; if (dateTime2 != null) { value2 = dateTime2.getJavaDate(); } domainObject.setEndDateTime(value2); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value3 = null; if (null != valueObject.getPatientStatus()) { value3 = domainFactory.getLookupInstance(valueObject.getPatientStatus().getID()); } domainObject.setPatientStatus(value3); return domainObject; }
/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.core.vo.ConsultantStayMinVo copy( ims.core.vo.ConsultantStayMinVo valueObjectDest, ims.core.vo.ConsultantStayMinVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_ConsultantStay(valueObjectSrc.getID_ConsultantStay()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // transferDateTime valueObjectDest.setTransferDateTime(valueObjectSrc.getTransferDateTime()); // endDateTime valueObjectDest.setEndDateTime(valueObjectSrc.getEndDateTime()); // PatientStatus valueObjectDest.setPatientStatus(valueObjectSrc.getPatientStatus()); return valueObjectDest; }