/**
  * 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;
 }
  public static ims.oncology.domain.objects.ContactTypesByDisciplineItem
      extractContactTypesByDisciplineItem(
          ims.domain.ILightweightDomainFactory domainFactory,
          ims.oncology.vo.ContactTypesByDisciplineItemVo valueObject,
          HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_ContactTypesByDisciplineItem();
    ims.oncology.domain.objects.ContactTypesByDisciplineItem domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.oncology.domain.objects.ContactTypesByDisciplineItem) domMap.get(valueObject);
      }
      // ims.oncology.vo.ContactTypesByDisciplineItemVo ID_ContactTypesByDisciplineItem field is
      // unknown
      domainObject = new ims.oncology.domain.objects.ContactTypesByDisciplineItem();
      domMap.put(valueObject, domainObject);
    } else {
      String key =
          (valueObject.getClass().getName()
              + "__"
              + valueObject.getID_ContactTypesByDisciplineItem());
      if (domMap.get(key) != null) {
        return (ims.oncology.domain.objects.ContactTypesByDisciplineItem) domMap.get(key);
      }
      domainObject =
          (ims.oncology.domain.objects.ContactTypesByDisciplineItem)
              domainFactory.getDomainObject(
                  ims.oncology.domain.objects.ContactTypesByDisciplineItem.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_ContactTypesByDisciplineItem());

    // 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.getContactType() != null && valueObject.getContactType().equals("")) {
      valueObject.setContactType(null);
    }
    domainObject.setContactType(valueObject.getContactType());
    domainObject.setActive(valueObject.getActive());
    ims.oncology.domain.objects.ContactTypesByDisciplineItem value3 = null;
    if (null != valueObject.getParent()) {
      if (valueObject.getParent().getBoId() == null) {
        if (domMap.get(valueObject.getParent()) != null) {
          value3 =
              (ims.oncology.domain.objects.ContactTypesByDisciplineItem)
                  domMap.get(valueObject.getParent());
        }
      } else if (valueObject.getBoVersion()
          == -1) // RefVo was not modified since obtained from the Assembler, no need to update the
      // BO field
      {
        value3 = domainObject.getParent();
      } else {
        value3 =
            (ims.oncology.domain.objects.ContactTypesByDisciplineItem)
                domainFactory.getDomainObject(
                    ims.oncology.domain.objects.ContactTypesByDisciplineItem.class,
                    valueObject.getParent().getBoId());
      }
    }
    domainObject.setParent(value3);
    domainObject.setTaxonomyMap(
        ims.core.vo.domain.TaxonomyMapAssembler.extractTaxonomyMapList(
            domainFactory, valueObject.getTaxonomyMap(), domainObject.getTaxonomyMap(), domMap));

    return domainObject;
  }