/**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.assessment.vo.PatientAssessmentFolderVo copy(
     ims.assessment.vo.PatientAssessmentFolderVo valueObjectDest,
     ims.assessment.vo.PatientAssessmentFolderVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_PatientAssessmentFolder(valueObjectSrc.getID_PatientAssessmentFolder());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // FolderName
   valueObjectDest.setFolderName(valueObjectSrc.getFolderName());
   // PatientAssessments
   valueObjectDest.setPatientAssessments(valueObjectSrc.getPatientAssessments());
   // GraphicAssessments
   valueObjectDest.setGraphicAssessments(valueObjectSrc.getGraphicAssessments());
   return valueObjectDest;
 }
  public static ims.assessment.configuration.domain.objects.PatientAssessmentFolder
      extractPatientAssessmentFolder(
          ims.domain.ILightweightDomainFactory domainFactory,
          ims.assessment.vo.PatientAssessmentFolderVo valueObject,
          HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_PatientAssessmentFolder();
    ims.assessment.configuration.domain.objects.PatientAssessmentFolder domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.assessment.configuration.domain.objects.PatientAssessmentFolder)
            domMap.get(valueObject);
      }
      // ims.assessment.vo.PatientAssessmentFolderVo ID_PatientAssessmentFolder field is unknown
      domainObject = new ims.assessment.configuration.domain.objects.PatientAssessmentFolder();
      domMap.put(valueObject, domainObject);
    } else {
      String key =
          (valueObject.getClass().getName() + "__" + valueObject.getID_PatientAssessmentFolder());
      if (domMap.get(key) != null) {
        return (ims.assessment.configuration.domain.objects.PatientAssessmentFolder)
            domMap.get(key);
      }
      domainObject =
          (ims.assessment.configuration.domain.objects.PatientAssessmentFolder)
              domainFactory.getDomainObject(
                  ims.assessment.configuration.domain.objects.PatientAssessmentFolder.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_PatientAssessmentFolder());

    // 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.getFolderName() != null && valueObject.getFolderName().equals("")) {
      valueObject.setFolderName(null);
    }
    domainObject.setFolderName(valueObject.getFolderName());
    domainObject.setPatientAssessments(
        ims.assessment.vo.domain.UserAssessmentShortVoAssembler.extractUserAssessmentSet(
            domainFactory,
            valueObject.getPatientAssessments(),
            domainObject.getPatientAssessments(),
            domMap));
    domainObject.setGraphicAssessments(
        ims.assessment.vo.domain.GraphicAssessmentShortVoAssembler.extractGraphicAssessmentSet(
            domainFactory,
            valueObject.getGraphicAssessments(),
            domainObject.getGraphicAssessments(),
            domMap));

    return domainObject;
  }