public static ims.core.configuration.domain.objects.DrawingGraphicGroup extractDrawingGraphicGroup( ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.GraphicGroupVo valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_DrawingGraphicGroup(); ims.core.configuration.domain.objects.DrawingGraphicGroup domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.core.configuration.domain.objects.DrawingGraphicGroup) domMap.get(valueObject); } // ims.core.vo.GraphicGroupVo ID_DrawingGraphicGroup field is unknown domainObject = new ims.core.configuration.domain.objects.DrawingGraphicGroup(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_DrawingGraphicGroup()); if (domMap.get(key) != null) { return (ims.core.configuration.domain.objects.DrawingGraphicGroup) domMap.get(key); } domainObject = (ims.core.configuration.domain.objects.DrawingGraphicGroup) domainFactory.getDomainObject( ims.core.configuration.domain.objects.DrawingGraphicGroup.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_DrawingGraphicGroup()); domainObject.setGroupID(valueObject.getGroupID()); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getGroupName() != null && valueObject.getGroupName().equals("")) { valueObject.setGroupName(null); } domainObject.setGroupName(valueObject.getGroupName()); domainObject.setAreaCollection( ims.core.vo.domain.GraphicAreaVoAssembler.extractDrawingGraphicAreaSet( domainFactory, valueObject.getAreaCollection(), domainObject.getAreaCollection(), domMap)); domainObject.setChildGroups( ims.core.vo.domain.GraphicGroupVoAssembler.extractDrawingGraphicGroupSet( domainFactory, valueObject.getChildGroups(), domainObject.getChildGroups(), domMap)); return domainObject; }
/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.core.vo.GraphicGroupVo copy( ims.core.vo.GraphicGroupVo valueObjectDest, ims.core.vo.GraphicGroupVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_DrawingGraphicGroup(valueObjectSrc.getID_DrawingGraphicGroup()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // groupID valueObjectDest.setGroupID(valueObjectSrc.getGroupID()); // groupName valueObjectDest.setGroupName(valueObjectSrc.getGroupName()); // areaCollection valueObjectDest.setAreaCollection(valueObjectSrc.getAreaCollection()); // childGroups valueObjectDest.setChildGroups(valueObjectSrc.getChildGroups()); return valueObjectDest; }