diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
index 7ddaedc..a78ac10 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
@@ -27,17 +27,40 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import org.openecomp.mso.db.catalog.beans.*;
+
 import org.hibernate.HibernateException;
-import org.hibernate.NonUniqueResultException;
 import org.hibernate.Query;
 import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.service.ServiceRegistry;
-import org.hibernate.service.ServiceRegistryBuilder;
-
-import org.openecomp.mso.db.HibernateUtils;
+import org.openecomp.mso.db.AbstractSessionFactoryManager;
+import org.openecomp.mso.db.catalog.beans.AllottedResource;
+import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.HeatEnvironment;
+import org.openecomp.mso.db.catalog.beans.HeatFiles;
+import org.openecomp.mso.db.catalog.beans.HeatNestedTemplate;
+import org.openecomp.mso.db.catalog.beans.HeatTemplate;
+import org.openecomp.mso.db.catalog.beans.HeatTemplateParam;
+import org.openecomp.mso.db.catalog.beans.Model;
+import org.openecomp.mso.db.catalog.beans.ModelRecipe;
+import org.openecomp.mso.db.catalog.beans.NetworkRecipe;
+import org.openecomp.mso.db.catalog.beans.NetworkResource;
+import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.Service;
+import org.openecomp.mso.db.catalog.beans.ServiceMacroHolder;
+import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
+import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources;
+import org.openecomp.mso.db.catalog.beans.ServiceToNetworks;
+import org.openecomp.mso.db.catalog.beans.ServiceToResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup;
+import org.openecomp.mso.db.catalog.beans.ToscaCsar;
+import org.openecomp.mso.db.catalog.beans.VfModule;
+import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;
+import org.openecomp.mso.db.catalog.beans.VfModuleToHeatFiles;
+import org.openecomp.mso.db.catalog.beans.VnfComponent;
+import org.openecomp.mso.db.catalog.beans.VnfComponentsRecipe;
+import org.openecomp.mso.db.catalog.beans.VnfRecipe;
+import org.openecomp.mso.db.catalog.beans.VnfResCustomToVfModuleCustom;
+import org.openecomp.mso.db.catalog.beans.VnfResource;
+import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization;
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioningComparator;
 import org.openecomp.mso.db.catalog.utils.RecordNotFoundException;
 import org.openecomp.mso.logger.MessageEnum;
@@ -52,12 +75,14 @@
  */
 public class CatalogDatabase implements Closeable {
 
-    protected static HibernateUtils hibernateUtils = new HibernateUtilsCatalogDb ();
+    protected final AbstractSessionFactoryManager sessionFactoryCatalogDB;
 
     private static final String NETWORK_TYPE = "networkType";
     private static final String ACTION = "action";
     private static final String VNF_TYPE = "vnfType";
     private static final String SERVICE_TYPE = "serviceType";
+    private static final String SERVICE_ID= "serviceId";
+    private static final String MODEL_UUID= "modelUUID";
     private static final String VNF_COMPONENT_TYPE = "vnfComponentType";
     private static final String MODEL_ID = "modelId";
     private static final String MODEL_NAME = "modelName";
@@ -65,22 +90,26 @@
     private static final String MODEL_TYPE = "modelType";
     private static final String MODEL_VERSION_ID = "modelVersionId";
     private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUuid";
+	private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUId";
     private static final String VF_MODULE_ID = "vfModuleId";
-    private static final String SERVICE_NAME_VERSION_ID= "serviceNameVersionId";
 
     protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
 
     protected Session session = null;
 
-    public CatalogDatabase () {
+    protected CatalogDatabase (AbstractSessionFactoryManager sessionFactoryCatalog) {
+        sessionFactoryCatalogDB = sessionFactoryCatalog;
     }
-
-
+    
+    public static CatalogDatabase getInstance() {
+        return new CatalogDatabase(new CatalogDbSessionFactoryManager ());
+    }
+    
     private Session getSession () {
 
              if (session == null) {
             try {
-                session = hibernateUtils.getSessionFactory ().openSession ();
+                session = sessionFactoryCatalogDB.getSessionFactory ().openSession ();
                 session.beginTransaction ();
             } catch (HibernateException he) {
                 LOGGER.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Error creating Hibernate Session: " + he, "", "", MsoLogger.ErrorCode.DataError, "Error creating Hibernate Session: " + he);
@@ -143,6 +172,7 @@
      * @param templateId
      * @return HeatTemplate object or null if none found
      */
+    @Deprecated
     public HeatTemplate getHeatTemplate (int templateId) {
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get Heat template with id " + templateId);
@@ -215,6 +245,114 @@
     }
 
     /**
+     * Return a specific Heat Template by ARTIFACT_UUID).
+     *
+     * @param artifactUuid
+     * @return HeatTemplate object or null if none found
+     */    
+    
+    public HeatTemplate getHeatTemplateByArtifactUuid(String artifactUuid) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Heat template with artifactUuid " + artifactUuid);
+
+        // Will this work if the id is a string? 
+        HeatTemplate template = (HeatTemplate) getSession ().get (HeatTemplate.class, artifactUuid);
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null);
+        return template;
+    }
+    
+    /**
+     * Return a specific Heat Template by ARTIFACT_UUID using standard query method. unique record expected.
+     *
+     * @param artifactUuid
+     * @return HeatTemplate object or null if none found
+     */    
+    public HeatTemplate getHeatTemplateByArtifactUuidRegularQuery(String artifactUuid) {
+       long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Heat template (regular query) with artifactUuid " + artifactUuid);
+
+        String hql = "FROM HeatTemplate WHERE artifactUuid = :artifactUuidValue";
+        HashMap<String, String> variables = new HashMap<String, String>();
+        variables.put("artifactUuidValue", artifactUuid);
+        //Query query = getSession().createQuery(hql);
+        //query.setParameter ("artifactUuidValue", artifactUuid);
+        HeatTemplate template = (HeatTemplate) this.executeQuerySingleRow(hql.toString(), variables, true);
+
+        if (template == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getHeatTemplateByArtifactUuidRegularQuery", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplateByArtifactUuidRegularQuery", null);
+        }
+        return template;
+    }
+    
+    public List<HeatTemplateParam> getParametersForHeatTemplate(String heatTemplateArtifactUuid) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getParametersForHeatTemplate with artifactUuid " + heatTemplateArtifactUuid);
+
+        String hql = "FROM HeatTemplateParams WHERE artifactUuid = :artifactUuidValue";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("artifactUuidValue", heatTemplateArtifactUuid);
+        List<HeatTemplateParam> resultList = null;
+        try {
+        	resultList = query.list ();
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching HeatTemplateParams for: heatTemplateArtifactUuid='" + heatTemplateArtifactUuid + "'" + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching HeatTemplateParams for artifactUuid=" + heatTemplateArtifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for artifactUuid=" + heatTemplateArtifactUuid);
+        	resultList = new ArrayList<HeatTemplateParam>();
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching HeatTemplateParam for: artifactUuid='" + heatTemplateArtifactUuid + "'" + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching HeatTemplate for artifactUuid=" + heatTemplateArtifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for artifactUuid=" + heatTemplateArtifactUuid);
+        	resultList = new ArrayList<HeatTemplateParam>();
+        	throw e;
+        }
+        
+        return resultList;
+    	
+    }
+    
+    /**
+     * Return a specific Heat Environment by ARTIFACT_UUID using standard query method. unique record expected.
+     *
+     * @param artifactUuid
+     * @return HeatEnvironment object or null if none found
+     */    
+    public HeatEnvironment getHeatEnvironmentByArtifactUuid(String artifactUuid) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Heat Environment with artifactUuid " + artifactUuid);
+
+        String hql = "FROM HeatEnvironment WHERE artifactUuid = :artifactUuidValue";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("artifactUuidValue", artifactUuid);
+        HeatEnvironment environment = null;
+        try {
+        	environment = (HeatEnvironment) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row for Envt - data integrity error: artifactUuid='" + artifactUuid +"'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for heatEnvironment artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for artifactUuid==" + artifactUuid);
+        	environment = null;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for envt: artifactUuid='" + artifactUuid + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching envt for artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching envt for artifactUuid=" + artifactUuid);
+        	environment = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: artifactUuid='" + artifactUuid + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching envt for artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching envt for artifactUuid=" + artifactUuid);
+        	environment = null;
+        	throw e;
+        }
+
+        if (environment == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getHeatEnvironmentByArtifactUuid", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatEnvironmentByArtifactUuid", null);
+        }
+        return environment;
+    }
+    
+    /**
      * Fetch a Service definition by InvariantUUID
      */
     public Service getServiceByInvariantUUID (String modelInvariantUUID) {
@@ -244,30 +382,30 @@
     /**
      * Fetch a Service definition
      */
-    public Service getService (String serviceName) {
+    public Service getService (String modelName) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get service with name " + serviceName);
+        LOGGER.debug ("Catalog database - get service with name " + modelName);
 
-        String hql = "FROM Service WHERE serviceName = :service_name";
+        String hql = "FROM Service WHERE modelName = :MODEL_NAME";
         Query query = getSession ().createQuery (hql);
-        query.setParameter ("service_name", serviceName);
+        query.setParameter ("MODEL_NAME", modelName);
 
         Service service = null;
         try {
         	service = (Service) query.uniqueResult ();
         } catch (org.hibernate.NonUniqueResultException nure) {
-        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceName='" + serviceName + "'");
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceName=" + serviceName, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceName=" + serviceName);
-        	return null;
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelName='" + modelName + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelName=" + modelName, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelName=" + modelName);
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: serviceName='" + serviceName + "'");
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceName=" + serviceName, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceName=" + serviceName);
-        	return null;
+        	LOGGER.debug("Hibernate Exception - while searching for: modelName='" + modelName + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelName=" + modelName, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelName=" + modelName);
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: serviceName='" + serviceName);
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceName=" + serviceName, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceName=" + serviceName);
-        	return null;
+        	LOGGER.debug("Generic Exception - while searching for: modelName='" + modelName + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelName=" + modelName, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelName=" + modelName);
+        	throw e;
         }
         if (service == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getService", null);
@@ -278,38 +416,39 @@
         return service;
     }
 
-    /**
-     * Fetch a Service definition
-     */
-    public Service getServiceByUUID (String serviceNameVersionId) {
+    public Service getServiceByModelUUID (String modelUUID) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get service with UUID " + serviceNameVersionId);
+        LOGGER.debug ("Catalog database - get service with Model UUID " + modelUUID);
 
-        String hql = "FROM Service WHERE serviceNameVersionId = :service_id";
-        Query query = getSession ().createQuery (hql);
-        query.setParameter ("service_id", serviceNameVersionId);
+        String hql = "FROM Service WHERE modelUUID = :MODEL_UUID";
+        HashMap<String, String> parameters = new HashMap<String, String>();
+        parameters.put("MODEL_UUID", modelUUID);
 
-        Service service = null;
+        
+        Service service = this.executeQuerySingleRow(hql, parameters, true);
+
+        /*
         try {
         	service = (Service) query.uniqueResult ();
         } catch (org.hibernate.NonUniqueResultException nure) {
-        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceNameVersionId='" + serviceNameVersionId + "'");
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceNameVersionId=" + serviceNameVersionId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceNameVersionId=" + serviceNameVersionId);
-        	return null;
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelUUID='" + modelUUID + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelUUID=" + modelUUID, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelUUID=" + modelUUID);
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: serviceName='" + serviceNameVersionId + "'");
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceNameVersionId=" + serviceNameVersionId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceNameVersionId=" + serviceNameVersionId);
-        	return null;
+        	LOGGER.debug("Hibernate Exception - while searching for: modelUUID='" + modelUUID + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelUUID=" + modelUUID, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelUUID=" + modelUUID);
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: serviceName='" + serviceNameVersionId);
-        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceNameVersionId=" + serviceNameVersionId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceNameVersionId=" + serviceNameVersionId);
-        	return null;
+        	LOGGER.debug("Generic Exception - while searching for: modelUUID='" + modelUUID + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelUUID=" + modelUUID, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelUUID=" + modelUUID);
+        	throw e;
         }
+        */
         if (service == null) {
-        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getService", null);
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getServiceByModelUUID", null);
         } else {
-        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getService", null);
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByModelUUID", null);
         }
 
         return service;
@@ -326,11 +465,11 @@
         String serviceVersion = "not_set";
 
         if(serviceNameVersionId != null && serviceNameVersionId.length() > 0){
-        	LOGGER.debug ("Catalog database - get serviceNameVersionId with id " + serviceNameVersionId);
+        	LOGGER.debug ("Catalog database - get service modelUUID with id " + serviceNameVersionId);
 
-        	String hql = "FROM Service WHERE service_name_version_id = :service_name_version_id and http_method = :http_method";
+        	String hql = "FROM Service WHERE MODEL_UUID = :MODEL_UUID and http_method = :http_method";
         	query = getSession ().createQuery (hql);
-            query.setParameter ("service_name_version_id", serviceNameVersionId);
+            query.setParameter ("MODEL_UUID", serviceNameVersionId);
          } else {
         	serviceId = map.get("serviceId");
         	serviceVersion = map.get("serviceVersion");
@@ -352,14 +491,17 @@
         	LOGGER.debug("Non Unique Result Exception - data integrity error: service_id='" + serviceId + "', serviceVersion='" + serviceVersion + "'");
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for service_id=" + serviceId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for service_id=" + serviceId);
         	service = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: service_id='" + serviceId + "', serviceVersion='" + serviceVersion + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: service_id='" + serviceId + "', serviceVersion='" + serviceVersion + "' " + he.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for service_id=" + serviceId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for service_id=" + serviceId);
         	service = null;
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: service_id='" + serviceId + "', serviceVersion='" + serviceVersion + "'");
+        	LOGGER.debug("Generic Exception - while searching for: service_id='" + serviceId + "', serviceVersion='" + serviceVersion + "' " + e.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for service_id=" + serviceId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for service_id=" + serviceId);
         	service = null;
+        	throw e;
         }
         if (service == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getService", null);
@@ -372,30 +514,30 @@
     /**
      * Return the newest version of a Service (queried by Name).
      *
-     * @param serviceName
+     * @param modelName
      * @return Service object or null if none found
      */
-    public Service getServiceByName (String serviceName) {
+    public Service getServiceByModelName (String modelName){
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get service with name " + serviceName);
+        LOGGER.debug ("Catalog database - get service with name " + modelName);
 
-        String hql = "FROM Service WHERE serviceName = :service_name";
+        String hql = "FROM Service WHERE modelName = :MODEL_NAME";
         Query query = getSession ().createQuery (hql);
-        query.setParameter ("service_name", serviceName);
+        query.setParameter ("MODEL_NAME", modelName);
 
         @SuppressWarnings("unchecked")
         List <Service> resultList = query.list ();
 
         // See if something came back.
         if (resultList.isEmpty ()) {
-            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByName", null);
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByModelName", null);
             return null;
         }
         Collections.sort (resultList, new MavenLikeVersioningComparator ());
         Collections.reverse (resultList);
 
-        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByName", null);
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByModelName", null);
         return resultList.get (0);
     }
 
@@ -427,74 +569,75 @@
     }
 
     /**
-     * Return a Service recipe that matches a given SERVICE_NAME_VERSION_ID
-     * (MODEL_VERSION_ID) and ACTION
-     *
-     * @param modelVersionId
-     * @param action
-     * @return ServiceRecipe object or null if none found
-     */
-    public ServiceRecipe getServiceRecipe(String modelVersionId,
-                                       String action) {
-
-        long startTime = System.currentTimeMillis();
-        LOGGER.debug("Catalog database - get Service recipe with modeVersionId=" + modelVersionId
-                                      + " and action=" + action);
-
-        try {
-                        String hql;
-
-                        hql = "SELECT new ServiceRecipe(SR.id, SR.serviceId, SR.action, SR.description, " +
-                                        "SR.orchestrationUri, SR.serviceParamXSD, case when SR.recipeTimeout is null then 0 else SR.recipeTimeout end, " +
-                                        "case when SR.serviceTimeoutInterim is null then 0 else SR.serviceTimeoutInterim end, SR.created) " +
-                                        "FROM Service as S RIGHT OUTER JOIN S.recipes SR " +
-                                        "WHERE SR.serviceId = S.id AND S.serviceNameVersionId = :serviceNameVersionId AND SR.action = :action";
-                        Query query = getSession().createQuery(hql);
-                        query.setParameter(SERVICE_NAME_VERSION_ID, modelVersionId);
-                        query.setParameter(ACTION, action);
-
-                        @SuppressWarnings("unchecked")
-                        List<ServiceRecipe> recipeResultList = query.list();
-                        if (recipeResultList.isEmpty()) {
-                                LOGGER.debug("Catalog database - recipeResultList is null");
-                                return null;
-                        }
-                        Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
-                        Collections.reverse(recipeResultList);
-                        LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
-
-                        return recipeResultList.get(0);
-        } finally {
-            LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
-        }
-    }
-
-    /**
      * Return a newest version of Service recipe that matches a given SERVICE_ID and ACTION
      *
-     * @param serviceId
-     * @param action     *
+     * @param serviceModelUUID
+     * @param action     * 
      * @return ServiceRecipe object or null if none found
      */
-    public ServiceRecipe getServiceRecipe (int serviceId, String action) {
+    @Deprecated
+    public ServiceRecipe getServiceRecipe (int serviceModelUUID, String action) {
+       
+        StringBuilder hql = null;
 
-        StringBuilder hql =  null;
-
-        if(action == null){
-            hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId");
+    	if(action == null){
+        	hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID");
         }else {
-            hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId AND action = :action ");
+        	hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID AND action = :action ");
         }
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get Service recipe with serviceId " + Integer.toString(serviceId)
+        LOGGER.debug ("Catalog database - get Service recipe with serviceModelUUID " + Integer.toString(serviceModelUUID)
                                       + " and action "
                                       + action
                                       );
 
         Query query = getSession ().createQuery (hql.toString ());
-        query.setParameter ("serviceId", serviceId);
-        query.setParameter (ACTION, action);
+        query.setParameter ("serviceModelUUID", serviceModelUUID);
+        if(action != null){
+        	query.setParameter (ACTION, action);
+        }
+
+                        @SuppressWarnings("unchecked")
+        List <ServiceRecipe> resultList = query.list ();
+
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service recipe not found", "CatalogDB", "getServiceRecipe", null);
+                                return null;
+                        }
+
+        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        Collections.reverse (resultList);
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
+        return resultList.get (0);
+    }
+
+    /**
+     * Return a newest version of Service recipe that matches a given SERVICE_MODEL_UUID and ACTION
+     *
+     * @param serviceModelUuid
+     * @param action     *
+     * @return ServiceRecipe object or null if none found
+     */
+    public ServiceRecipe getServiceRecipeByServiceModelUuid (String serviceModelUuid, String action) {
+
+        StringBuilder hql =  null;
+
+        if(action == null){
+        	hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUuid = :serviceModelUuid");
+        }else {
+        	hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUuid = :serviceModelUuid AND action = :action ");
+        }
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Service recipe with serviceModelUuid " + serviceModelUuid 
+                                      + " and action "
+                                      + action
+                                      );
+
+        Query query = getSession ().createQuery (hql.toString ());
+        query.setParameter ("serviceModelUuid", serviceModelUuid);
         if(action != null){
             query.setParameter (ACTION, action);
         }
@@ -514,30 +657,17 @@
         return resultList.get (0);
     }
 
-    /**
-     * @param serviceName
-     * @param action
-     * @return ServiceRecipe object or null if none found. returns a newest version of Service recipe that matches a given serviceName, action and for the newest service version
-     */
-    public ServiceRecipe getServiceRecipeByServiceNameAndAction(String serviceName, String action) {
-        Service service = getServiceByName(serviceName);
-        if (service != null ){
-            return getServiceRecipe(service.getId(),action);
-        }
-        return null;
-    }
-
-    public List<ServiceRecipe> getServiceRecipes (int serviceId) {
+    public List<ServiceRecipe> getServiceRecipes (String serviceModelUuid) {
 
         StringBuilder hql = null;
 
-        hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceId = :serviceId");
+       	hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID");
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get Service recipe with serviceId " + Integer.toString(serviceId));
+        LOGGER.debug ("Catalog database - get Service recipe with serviceModelUUID " + serviceModelUuid);
 
         Query query = getSession ().createQuery (hql.toString ());
-        query.setParameter ("serviceId", serviceId);
+        query.setParameter ("serviceModelUUID", serviceModelUuid);
 
         @SuppressWarnings("unchecked")
         List <ServiceRecipe> resultList = query.list ();
@@ -554,6 +684,7 @@
         return resultList;
     }
 
+    
     /**
      * Return the VNF component data - queried by the VNFs ID and the component type.
      *
@@ -561,6 +692,7 @@
      * @param type
      * @return VnfComponent object or null if none found
      */
+    @Deprecated
     public VnfComponent getVnfComponent (int vnfId, String type) {
 
     	long startTime = System.currentTimeMillis();
@@ -578,14 +710,17 @@
         	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vnf_id='" + vnfId + "', componentType='" + type + "'");
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnf_id=" + vnfId + " and componentType=" + type, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnf_id=" + vnfId);
         	result = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: vnf_id='" + vnfId + "', componentType='" + type + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: vnf_id='" + vnfId + "', componentType='" + type + "' " + he.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vnf_id=" + vnfId + " and componentType=" + type, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnf_id=" + vnfId);
         	result = null;
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: vnf_id='" + vnfId + "', componentType='" + type + "'");
+        	LOGGER.debug("Generic Exception - while searching for: vnf_id='" + vnfId + "', componentType='" + type + "' " + e.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vnf_id=" + vnfId + " and componentType=" + type, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vnf_id=" + vnfId);
         	result = null;
+        	throw e;
         }
 
     	//LOGGER.debug("Found VNF Component: " + result.toString());
@@ -606,9 +741,9 @@
     public VnfResource getVnfResource (String vnfType) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get vnf resource with name " + vnfType);
+        LOGGER.debug ("Catalog database - get vnf resource with model_name " + vnfType);
 
-        String hql = "FROM VnfResource WHERE vnfType = :vnf_name";
+        String hql = "FROM VnfResource WHERE modelName = :vnf_name";
         Query query = getSession ().createQuery (hql);
         query.setParameter ("vnf_name", vnfType);
 
@@ -637,9 +772,9 @@
     public VnfResource getVnfResource (String vnfType, String serviceVersion) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get VNF resource with name " + vnfType);
+        LOGGER.debug ("Catalog database - get VNF resource with model_name " + vnfType + " and version=" + serviceVersion);
 
-        String hql = "FROM VnfResource WHERE vnfType = :vnfName and version = :serviceVersion";
+        String hql = "FROM VnfResource WHERE modelName = :vnfName and version = :serviceVersion";
         Query query = getSession ().createQuery (hql);
         query.setParameter ("vnfName", vnfType);
         query.setParameter ("serviceVersion", serviceVersion);
@@ -651,14 +786,19 @@
         	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vnfType='" + vnfType + "', serviceVersion='" + serviceVersion + "'");
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfType=" + vnfType + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnfType=" + vnfType);
         	resource = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: vnfType='" + vnfType + "', asdc_service_model_version='" + serviceVersion + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: vnfType='" + vnfType + "', asdc_service_model_version='" + serviceVersion + "' " + he.getMessage());
+        	LOGGER.debug(he.getStackTrace().toString());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vnfType=" + vnfType + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfType=" + vnfType);
         	resource = null;
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: vnfType='" + vnfType + "', serviceVersion='" + serviceVersion + "'");
+        	LOGGER.debug("Generic Exception - while searching for: vnfType='" + vnfType + "', serviceVersion='" + serviceVersion + "' " + e.getMessage());
+        	LOGGER.debug(e.getStackTrace().toString());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vnfType=" + vnfType + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vnfType=" + vnfType);
         	resource = null;
+        	throw e;
         }
         if (resource == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResource", null);
@@ -669,37 +809,120 @@
     }
 
     /**
-     * Return the newest version of a specific VNF resource (queried by modelCustomizationId).
+     * Return VnfResource (queried by modelCustomizationId).
      *
-     * @param vnfType
-     * @param version
+     * @param modelCustomizationId
      * @return VnfResource object or null if none found
      */
-    public VnfResource getVnfResourceByModelCustomizationId (String modelCustomizationId, String serviceVersion) {
+    public VnfResource getVnfResourceByModelCustomizationId (String modelCustomizationId) {
 
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get VNF resource with modelCustomizationId " + modelCustomizationId);
 
-        String hql = "FROM VnfResource WHERE modelCustomizationUuid = :modelCustomizationId and version = :serviceVersion";
+        String hql = "SELECT vr "
+					+ "FROM VnfResource as vr JOIN vr.vnfResourceCustomizations as vrc "
+					+ "WHERE vrc.modelCustomizationUuid = :modelCustomizationId";
+		
         Query query = getSession ().createQuery (hql);
         query.setParameter ("modelCustomizationId", modelCustomizationId);
-        query.setParameter ("serviceVersion", serviceVersion);
 
         VnfResource resource = null;
         try {
             resource = (VnfResource) query.uniqueResult ();
         } catch (org.hibernate.NonUniqueResultException nure) {
-            LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationId + "', serviceVersion='" + serviceVersion + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationId=" + modelCustomizationId);
-            resource = null;
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationId + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationId=" + modelCustomizationId);
+        	resource = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "', asdc_service_model_version='" + serviceVersion + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationId=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationId=" + modelCustomizationId);
-            resource = null;
+        	LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationId=" + modelCustomizationId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationId=" + modelCustomizationId);
+        	resource = null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "', serviceVersion='" + serviceVersion + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationId=" + modelCustomizationId + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationId=" + modelCustomizationId);
+        	LOGGER.debug("Generic Exception - while searching for: modelCustomizationId='" + modelCustomizationId + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationId=" + modelCustomizationId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationId=" + modelCustomizationId);
+        	resource = null;
+        	throw e;
+        }
+        if (resource == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
+        }
+        return resource;
+    }
+    
+    
+    /**
+     * Return the newest version of a specific VNF resource Customization (queried by modelCustomizationName and modelVersionId).
+     *
+     * @return {@link VnfResourceCustomization} object or null if none found
+     */
+    public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationName (String modelCustomizationName, String modelVersionId) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get VNF resource Customization with modelCustomizationName " + modelCustomizationName + " serviceModelUUID " + modelVersionId);
+
+        String hql = "SELECT vrc FROM VnfResourceCustomization as vrc WHERE vrc.modelCustomizationUuid IN "
+					+ "(SELECT src.resourceModelCustomizationUUID FROM ServiceToResourceCustomization src "
+					+ "WHERE src.serviceModelUUID = :modelVersionId)"
+					+ "AND vrc.modelInstanceName = :modelCustomizationName";
+		
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("modelCustomizationName", modelCustomizationName);
+        query.setParameter ("modelVersionId", modelVersionId);
+
+        @SuppressWarnings("unchecked")
+        List <VnfResourceCustomization> resultList = query.list ();
+
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VnfResourceCustomization not found", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationName", null);
+            return null;
+        }
+        
+        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        Collections.reverse (resultList);
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationName", null);
+        return resultList.get (0);
+    }
+    
+    
+    /**
+     * Return the newest version of a specific VNF resource (queried by modelInvariantId).
+     *
+     * @param version
+     * @return VnfResource object or null if none found
+     */
+    public VnfResource getVnfResourceByModelInvariantId(String modelInvariantUuid, String modelVersion) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get VNF resource with modelInvariantUuid " + modelInvariantUuid);
+
+        String hql = "FROM VnfResource WHERE modelInvariantUuid = :modelInvariantUuid and version = :serviceVersion";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("modelInvariantUuid", modelInvariantUuid);
+        query.setParameter ("serviceVersion", modelVersion);
+
+        VnfResource resource = null;
+        try {
+        	resource = (VnfResource) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantUuid='" + modelInvariantUuid + "', serviceVersion='" + modelVersion + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelInvariantUuid=" + modelInvariantUuid + " and serviceVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelInvariantUuid=" + modelInvariantUuid);
             resource = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: modelInvariantUuid='" + modelInvariantUuid + "', asdc_service_model_version='" + modelVersion + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelInvariantUuid=" + modelInvariantUuid + " and serviceVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelInvariantUuid=" + modelInvariantUuid);
+            resource = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: modelInvariantUuid='" + modelInvariantUuid + "', serviceVersion='" + modelVersion + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelInvariantUuid=" + modelInvariantUuid + " and serviceVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelInvariantUuid=" + modelInvariantUuid);
+            resource = null;
+        	throw e;
         }
         if (resource == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResource", null);
@@ -715,6 +938,7 @@
      * @param id The vnf id
      * @return VnfResource object or null if none found
      */
+    @Deprecated
     public VnfResource getVnfResourceById (int id) {
 
         long startTime = System.currentTimeMillis ();
@@ -745,7 +969,7 @@
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get vfModuleModelName with name " + modelName);
 
-        String hql = "FROM VfModule WHERE model_name = :model_name";
+        String hql = "FROM VfModule WHERE modelName = :model_name";
         Query query = getSession ().createQuery (hql);
         query.setParameter ("model_name", modelName);
 
@@ -769,9 +993,9 @@
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get vfModuleModelName with type='" + modelName + "' and asdc_service_model_version='" + model_version + "'");
 
-        String hql = "FROM VfModule WHERE model_name = :model_name and version = :model_version";
+        String hql = "FROM VfModule WHERE Name = :model_name and version = :model_version";
         Query query = getSession ().createQuery (hql);
-        query.setParameter ("model_name", modelName);
+        query.setParameter ("modelName", modelName);
         query.setParameter ("model_version", model_version);
 
         VfModule module = null;
@@ -781,14 +1005,17 @@
         	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: type='" + modelName + "', asdc_service_model_version='" + model_version + "'");
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for type=" + modelName + " and version=" + model_version, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for type=" + modelName);
         	module = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: type='" + modelName + "', asdc_service_model_version='" + model_version + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: type='" + modelName + "', asdc_service_model_version='" + model_version + "' " + he.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for type=" + modelName + " and version=" + model_version, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for type=" + modelName);
         	module = null;
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: type='" + modelName + "', asdc_service_model_version='" + model_version + "'");
+        	LOGGER.debug("Generic Exception - while searching for: type='" + modelName + "', asdc_service_model_version='" + model_version + "' " + e.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for type=" + modelName + " and version=" + model_version, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for type=" + modelName);
         	module = null;
+        	throw e;
         }
         if (module == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleModelName", null);
@@ -797,6 +1024,35 @@
         }
         return module;
     }
+    
+    /**
+     * Need this for 1707 DHV. This may be a temporary solution. May
+     * change it to get resources using service's model name.
+     * 
+     *@author cb645j
+     *
+     */
+    public VfModuleCustomization getVfModuleCustomizationByModelName (String modelName) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get VfModuleCustomization By VfModule's ModelName: " + modelName);
+
+        String hql = "SELECT VfModuleCustomization FROM VfModuleCustomization as vfmc LEFT OUTER JOIN VfModule as vfm on vfm.modelUUID = vfmc.vfModuleModelUuid where vfm.modelName = :model_name";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("model_name", modelName);
+
+        @SuppressWarnings("unchecked")
+        List<VfModuleCustomization> resultList = query.list();
+
+        // See if something came back. Name is unique, so
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful query but Vf module NOT found", "CatalogDB", "getVfModuleCustomizationByModelName", null);
+            return null;
+        }
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful query ", "CatalogDB", "getVfModuleCustomizationByModelName", null);
+        return resultList.get(0);
+    }
 
 
     /**
@@ -810,7 +1066,7 @@
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get network resource with type " + networkType);
 
-        String hql = "FROM NetworkResource WHERE networkType = :network_type";
+        String hql = "FROM NetworkResource WHERE model_name = :network_type";
         Query query = getSession ().createQuery (hql);
         query.setParameter ("network_type", networkType);
 
@@ -928,7 +1184,7 @@
         LOGGER.debug ("Catalog database - get VNF Recipe with vfModuleId " + vfModuleId);
 
         Query query = getSession ().createQuery (hql.toString ());
-        query.setParameter (VF_MODULE_ID, vfModuleId);
+        query.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query.setParameter (ACTION, action);
 
         @SuppressWarnings("unchecked")
@@ -961,14 +1217,17 @@
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid + "'");
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
             module = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
             module = null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+        	LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
             module = null;
+        	throw e;
         }
         if (module == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleTypeByUuid", null);
@@ -978,6 +1237,7 @@
         return module;
     }
 
+    @Deprecated
     public VfModule getVfModuleType(String type) {
     	long startTime = System.currentTimeMillis();
     	LOGGER.debug("Catalog database - get vfModuleType with type " + type);
@@ -999,6 +1259,7 @@
         return resultList.get (0);
     }
 
+    @Deprecated
     public VfModule getVfModuleType(String type, String version) {
 
     	long startTime = System.currentTimeMillis();
@@ -1015,14 +1276,17 @@
         	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: type='" + type + "', asdc_service_model_version='" + version + "'");
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for type=" + type + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for type==" + type);
         	module = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-        	LOGGER.debug("Hibernate Exception - while searching for: type='" + type + "', asdc_service_model_version='" + version + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: type='" + type + "', asdc_service_model_version='" + version + "' " + he.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for type=" + type + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for type=" + type);
         	module = null;
+        	throw he;
         } catch (Exception e) {
-        	LOGGER.debug("Generic Exception - while searching for: type='" + type + "', asdc_service_model_version='" + version + "'");
+        	LOGGER.debug("Generic Exception - while searching for: type='" + type + "', asdc_service_model_version='" + version + "' " + e.getMessage());
         	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for type=" + type + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for type=" + type);
         	module = null;
+        	throw e;
         }
         if (module == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleType", null);
@@ -1046,14 +1310,17 @@
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceModelInvariantUuid='" + serviceModelInvariantUuid);
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceModelInvariantUuid==" + serviceModelInvariantUuid);
             vnfResource = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
             vnfResource = null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
+        	LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "' " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
             vnfResource = null;
+        	throw e;
         }
         if (vnfResource == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleType", null);
@@ -1077,14 +1344,17 @@
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid);
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnfResourceModelInvariantUuid==" + vnfResourceModelInvariantUuid);
             vnfResource = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid);
             vnfResource = null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "'");
+        	LOGGER.debug("Generic Exception - while searching for: vnfResourceModelInvariantUuid='" + vnfResourceModelInvariantUuid + "' " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vnfResourceModelInvariantUuid=" + vnfResourceModelInvariantUuid);
             vnfResource = null;
+        	throw e;
         }
         if (vnfResource == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleType", null);
@@ -1098,29 +1368,22 @@
         return this.getVnfResource(vnfType);
     }
 
-    public VfModule getVfModuleByModelInvariantUuid(String vfModuleModelInvariantUuid) {
+    public VfModule getVfModuleByModelInvariantUuid(String modelInvariantUUID) {
         long startTime = System.currentTimeMillis();
-        LOGGER.debug ("Catalog database - get vfModuleTypeByUuid with uuid " + vfModuleModelInvariantUuid);
+        LOGGER.debug ("Catalog database - get vfModuleTypeByModelInvariantUuid with uuid " + modelInvariantUUID);
 
-        String hql = "FROM VfModule WHERE vfModuleModelInvariantUuid = :vfModuleModelInvariantUuid ";
-        Query query = getSession().createQuery(hql);
-        query.setParameter ("vfModuleModelInvariantUuid", vfModuleModelInvariantUuid);
+        String hql = "FROM VfModule WHERE modelInvariantUUID = :modelInvariantUUID ";
+        HashMap<String, String> parameters = new HashMap<String, String>();
+        parameters.put("modelInvariantUUID", modelInvariantUUID);
+        List<VfModule> modules = this.executeQueryMultipleRows(hql.toString(), parameters, true);
         VfModule module = null;
-        try {
-            module = (VfModule) query.uniqueResult ();
-        } catch (org.hibernate.NonUniqueResultException nure) {
-            LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid , "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vfModuleModelInvariantUuid==" + vfModuleModelInvariantUuid);
-            module = null;
-        } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid);
-            module = null;
-        } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: vfModuleModelInvariantUuid='" + vfModuleModelInvariantUuid + "'");
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid);
-            module = null;
+        
+        if (modules != null && modules.size() > 0) {
+        	Collections.sort (modules, new MavenLikeVersioningComparator ());
+        	Collections.reverse (modules);
+        	module =  modules.get(0);
         }
+  
         if (module == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelInvariantUuid", null);
         } else {
@@ -1129,28 +1392,31 @@
         return module;
     }
 
-    public VfModule getVfModuleByModelCustomizationUuid(String modelCustomizationUuid) {
+    public VfModuleCustomization getVfModuleByModelCustomizationUuid(String modelCustomizationUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug ("Catalog database - get vfModuleTypeByModelCustomizationUuid with uuid " + modelCustomizationUuid);
 
-        String hql = "FROM VfModule WHERE modelCustomizationUuid = :modelCustomizationUuid ";
+        String hql = "FROM VfModuleCustomization WHERE modelCustomizationUuid = :modelCustomizationUuid ";
         Query query = getSession().createQuery(hql);
         query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
-        VfModule module = null;
+        VfModuleCustomization module = null;
         try {
-            module = (VfModule) query.uniqueResult ();
+        	module = (VfModuleCustomization) query.uniqueResult ();
         } catch (org.hibernate.NonUniqueResultException nure) {
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid + "'");
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModuleModelInvariantUuid=" + modelCustomizationUuid , "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
             module = null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
             module = null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "'");
+        	LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
             module = null;
+        	throw e;
         }
         if (module == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelCustomizationUuid", null);
@@ -1160,28 +1426,545 @@
         return module;
     }
 
-    public VfModule getVfModuleByType(String vfModuleType) {
-        return this.getVfModuleType(vfModuleType);
+    
+    public VfModule getVfModuleByModelInvariantUuidAndModelVersion(String modelInvariantUuid, String modelVersion) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleByModelInvariantUuidAndModelVersion with modelInvariantUuid: " + modelInvariantUuid + ", modelVersion: " + modelVersion);
+
+        String hql = "FROM VfModule WHERE modelInvariantUUID = :modelInvariantUuid and version = :modelVersion";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelInvariantUuid", modelInvariantUuid);
+        query.setParameter("modelVersion", modelVersion);
+        VfModule module = null;
+        try {
+        	module = (VfModule) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantUuid='" + modelInvariantUuid + "', modelVersion='" +modelVersion + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModule ModelInvariantUuid=" + modelInvariantUuid + " modelVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for ModelInvariantUuid==" + modelInvariantUuid + " modelVersion==" + modelVersion);
+        	module = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: modelInvariantUuid='" + modelInvariantUuid + "', modelVersion='" +modelVersion + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelInvariantUuid=" + modelInvariantUuid + " modelVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelInvariantUuid=" + modelInvariantUuid + " modelVersion=" + modelVersion);
+        	module = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: modelInvariantUuid='" + modelInvariantUuid + "', modelVersion='" +modelVersion + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelInvariantUuid=" + modelInvariantUuid + " modelVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelInvariantUuid=" + modelInvariantUuid + " modelVersion=" + modelVersion);
+        	module = null;
+        	throw e;
+        }
+        if (module == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelInvariantUuidAndModelVersion", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelInvariantUuidAndModelVersion", null);
+        }
+        return module;
+    }
+    
+    /**
+     * Return the VfModuleCustomization object identified by the given modelCustomizationUuid 1707
+     *
+     * @param modelCustomizationUuid
+     * @return VfModuleCustomization or null if not found
+     */
+    public VfModuleCustomization getVfModuleCustomizationByModelCustomizationId(String modelCustomizationUuid) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleCustomizationByModelCustomizationId with modelCustomizationUuid: " + modelCustomizationUuid);
+
+        String hql = "FROM VfModuleCustomization WHERE modelCustomizationUuid = :modelCustomizationUuid";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
+        VfModuleCustomization VfModuleCustomization = null;
+        try {
+        	VfModuleCustomization = (VfModuleCustomization) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid +"'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vfModuleCustomization modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
+        	VfModuleCustomization = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	VfModuleCustomization = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	VfModuleCustomization = null;
+        	throw e;
+        }
+        if (VfModuleCustomization != null) {
+        	LOGGER.debug("Found VMC of " + VfModuleCustomization.getModelCustomizationUuid() + ", now looking for vfModule=" + VfModuleCustomization.getVfModuleModelUuid());
+        	VfModuleCustomization.setVfModule(this.getVfModuleByModelUuid(VfModuleCustomization.getVfModuleModelUuid()));
+        }
+
+        if (VfModuleCustomization == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleCustomizationByModelCustomizationId", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleCustomizationByModelCustomizationId", null);
+        }
+        return VfModuleCustomization;
+    }
+    
+    /**
+     * Return the VfModule object identified by the given modelUuid 1707
+     * per Mike Z. - this may return more than one row - and even if it does, 
+     * the heat template will be the same - so just return any of the rows.
+     *
+     * @param modelUuid
+     * @return VfModule or null if not found
+     */
+    public VfModule getVfModuleByModelUuid(String modelUuid) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleByModelUuid with modelUuid: " + modelUuid);
+
+        String hql = "FROM VfModule WHERE modelUUID = :modelUuidValue";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelUuidValue", modelUuid);
+        //VfModule vfModule = null;
+        List<VfModule> vfModules = null;
+        try {
+        	vfModules = query.list ();
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VfModule for: modelUuid='" + modelUuid + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VfModule for modelUuid=" + modelUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelUuid=" + modelUuid);
+        	vfModules = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VfModule for: modelUuid='" + modelUuid + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for modelUuid=" + modelUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelUuid=" + modelUuid);
+        	vfModules = null;
+        	throw e;
+        }
+
+        if (vfModules == null || vfModules.size() < 1) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelUuid", null);
+        	return null;
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelUuid", null);
+        }
+        return vfModules.get(0);
+    }
+    /**
+     * Return the VnfResourceCustomization object identified by the given modelCustomizationUuid 1707
+     * Note that the corresponding VnfResource Object will be put in the VnfResourceCustomization bean
+     *
+     * @param modelCustomizationUuid
+     * @return VnfResourceCustomization or null if not found
+     */
+    public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationUuid(String modelCustomizationUuid) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVnfResourceByModelCustomizatonUuid with modelCustomizationUuid: " + modelCustomizationUuid);
+
+        String hql = "FROM VnfResourceCustomization WHERE modelCustomizationUuid = :modelCustomizationUuid";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
+        VnfResourceCustomization vnfResourceCustomization = null;
+        try {
+        	vnfResourceCustomization = (VnfResourceCustomization) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row in VRC - data integrity error: modelCustomizationUuid='" + modelCustomizationUuid +"'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceCustomization modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationUuid==" + modelCustomizationUuid);
+        	vnfResourceCustomization = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VRC for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VRC for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	vnfResourceCustomization = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VRC for: modelCustomizationUuid='" + modelCustomizationUuid + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching VRC for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	vnfResourceCustomization = null;
+        	throw e;
+        }
+        if (vnfResourceCustomization != null) {
+        	LOGGER.debug("Found VRC of " + vnfResourceCustomization.getModelCustomizationUuid() + ", now looking for vnfResource=" + vnfResourceCustomization.getVnfResourceModelUuid() );
+        	vnfResourceCustomization.setVnfResource(this.getVnfResourceByModelUuid(vnfResourceCustomization.getVnfResourceModelUuid()));
+        	LOGGER.debug("Now looking for vfModules for " + vnfResourceCustomization.getModelCustomizationUuid());
+        	vnfResourceCustomization.setVfModuleCustomizations(this.getAllVfModuleCustomizations(vnfResourceCustomization.getModelCustomizationUuid()));
+        }
+
+        if (vnfResourceCustomization == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationUuid", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationUuid", null);
+        }
+        return vnfResourceCustomization;
+    }
+    
+    /**
+     * Return the VnfResourceCustomization object identified by the given modelCustomizationUuid 1707
+     * Note that the corresponding VnfResource Object will be put in the VnfResourceCustomization bean
+     *
+     * @param getVnfResourceCustomizationByModelVersionId
+     * @return VnfResourceCustomization or null if not found
+     */
+    public VnfResourceCustomization getVnfResourceCustomizationByModelVersionId(String modelVersionId) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVnfResourceCustomizationByModelVersionId with modelVersionId: " + modelVersionId);
+
+        String hql = "FROM VnfResourceCustomization WHERE vnfResourceModelUuid = :modelVersionId";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelVersionId", modelVersionId);
+        VnfResourceCustomization vnfResourceCustomization = null;
+        try {
+        	vnfResourceCustomization = (VnfResourceCustomization) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row in VRC - data integrity error: modelVersionId='" + modelVersionId +"'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceCustomization modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelVersionId==" + modelVersionId);
+        	vnfResourceCustomization = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VRC for: modelVersionId='" + modelVersionId + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VRC for modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelVersionId=" + modelVersionId);
+        	vnfResourceCustomization = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VRC for: modelVersionId='" + modelVersionId + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching VRC for modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelVersionId=" + modelVersionId);
+        	vnfResourceCustomization = null;
+        	throw e;
+        }
+        if (vnfResourceCustomization != null) {
+        	LOGGER.debug("Found VRC of " + vnfResourceCustomization.getModelCustomizationUuid() + ", now looking for vnfResource=" + vnfResourceCustomization.getVnfResourceModelUuid() );
+        	vnfResourceCustomization.setVnfResource(this.getVnfResourceByModelUuid(vnfResourceCustomization.getVnfResourceModelUuid()));
+        	LOGGER.debug("Now looking for vfModules for " + vnfResourceCustomization.getModelCustomizationUuid());
+        	vnfResourceCustomization.setVfModuleCustomizations(this.getAllVfModuleCustomizations(vnfResourceCustomization.getModelCustomizationUuid()));
+        }
+
+        if (vnfResourceCustomization == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceCustomizationByModelVersionId", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelVersionId", null);
+        }
+        return vnfResourceCustomization;
+    }
+    
+    /**
+     * Return the VfModule object identified by the given modelCustomizationId, modelVersionId 1707
+     *
+     * @param modelVersionId, modelCustomizationId
+     * @return VfModule or null if not found
+     */
+    public VfModule getVfModuleByModelCustomizationIdAndVersion(String modelCustomizationId, String modelVersionId) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleByModelCustomizationIdAndVersion with modelVersionId: " + modelVersionId + " modelCustomizationId: " + modelCustomizationId);
+
+//      select * from vf_module vfm where vfm.MODEL_UUID IN (
+//      select vfmc.VF_MODULE_MODEL_UUID from vf_module_customization vfmc where vfmc.MODEL_CUSTOMIZATION_UUID='222bd8f2-341d-4419-aa0e-98398fa34050')
+//      and vfm.MODEL_UUID = 'fa1c8558-006c-4fb6-82f2-4fc0646d6b06';
+        
+        String hql = "Select vfm FROM VfModule as vfm WHERE vfm.modelUUID IN ("
+        		+ "SELECT vfmc.vfModuleModelUuid FROM VfModuleCustomization as vfmc "
+        		+ "WHERE vfmc.modelCustomizationUuid = :modelCustomizationId) "
+        		+ "AND vfm.modelUUID = :modelVersionId";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelVersionId", modelVersionId);
+        query.setParameter ("modelCustomizationId", modelCustomizationId);
+        VfModule vfModule = null;
+        try {
+        	vfModule = (VfModule) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row in VRC - data integrity error: modelVersionId='" + modelVersionId +"' modelCustomizationId='" + modelCustomizationId + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceCustomization modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelVersionId=" + modelVersionId + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VRC for: modelVersionId='" + modelVersionId + "' modelCustomizationId='" + modelCustomizationId + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VRC for modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelVersionId=" + modelVersionId + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VRC for: modelVersionId='" + modelVersionId + "' modelCustomizationId='" + modelCustomizationId + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching VRC for modelVersionId=" + modelVersionId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelVersionId=" + modelVersionId + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw e;
+        }
+
+        if (vfModule == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelCustomizationIdAndVersion", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelCustomizationIdAndVersion", null);
+        }
+        return vfModule;
+    }
+    
+    /**
+     * Return the VfModule object identified by the given modelCustomizationId, modelVersion, modelInvariantId 1707
+     *
+     * @param modelCustomizationId, modelVersion, modelInvariantId
+     * @return VfModule or null if not found
+     */
+    public VfModule getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId(String modelCustomizationId, String modelVersion, String modelInvariantId) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId with modelVersionId: " + modelVersion);
+
+        //select * from vf_module vfm left outer join vf_module_customization vfmc on vfmc.VF_MODULE_MODEL_UUID = vfm.MODEL_UUID 
+//        where vfmc.MODEL_CUSTOMIZATION_UUID='52643a8e-7953-4e48-8eab-97165b2b3a4b' and vfm.MODEL_UUID = ''
+        
+        String hql = "Select vfm FROM VfModule as vfm LEFT OUTER JOIN VfModuleCustomization as vfmc on vfmc.vfModuleModelUuid = vfm.modelUUID"
+        		+ "WHERE vfmc.modelCustomizationUuid = :modelCustomizationId AND vfm.modelInvariantUUID = :modelInvariantId AND vfm.modelVersion = :modelVersion";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelInvariantId", modelInvariantId);
+        query.setParameter ("modelCustomizationId", modelCustomizationId);
+        query.setParameter ("modelVersion", modelVersion);
+        VfModule vfModule = null;
+        try {
+        	vfModule = (VfModule) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row in VRC - data integrity error: modelInvariantId='" + modelInvariantId +"' modelVersion='" + modelVersion + "' modelCustomizationId='" + modelCustomizationId +"'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceCustomization modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelInvariantId=" + modelInvariantId + " modelVersion=" + modelVersion + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VRC for: modelInvariantId='" + modelInvariantId + "' modelVersion='" + modelVersion + "' modelCustomizationId='" + modelCustomizationId + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VRC for modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelInvariantId=" + modelInvariantId + " modelVersion=" + modelVersion + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VRC for: modelInvariantId='" + modelInvariantId + "' modelVersion='" + modelVersion + "' modelCustomizationId='" + modelCustomizationId + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching VRC for modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelInvariantId=" + modelInvariantId + " modelVersion=" + modelVersion + " modelCustomizationId=" + modelCustomizationId);
+        	vfModule = null;
+        	throw e;
+        }
+
+        if (vfModule == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId", null);
+        }
+        return vfModule;
+    }
+    
+    /**
+     * Return the VnfResourceCustomization object identified by the given modelCustomizationName, modelInvariantId and modelVersion 1707
+     *
+     * @param modelInvariantId, modelVersion, modelCustomizationName
+     * @return VnfResourceCustomization or null if not found
+     */
+    public VnfResourceCustomization getVnfResourceCustomizationByModelInvariantId(String modelInvariantId, String modelVersion, String modelCustomizationName) {
+    	long startTime = System.currentTimeMillis();
+    	LOGGER.debug ("Catalog database - get getVnfResourceCustomizationByModelInvariantId with modelInvariantId: " + modelInvariantId + ", modelVersion: " 
+						+ modelVersion + ", modelCustomizationName: " + modelCustomizationName);
+        
+        String hql = "SELECT VnfResourceCustomization FROM VnfResourceCustomization as vrc "
+        			+ "LEFT OUTER JOIN VnfResource as vr "
+        			+ "on vr.modelUuid =vrc.vnfResourceModelUuid "
+        			+ "WHERE vr.modelInvariantUuid = :modelInvariantId AND vr.modelVersion = :modelVersion AND vrc.modelInstanceName = :modelCustomizationName";
+        
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelInvariantId", modelInvariantId);
+        query.setParameter("modelVersion", modelVersion);
+        query.setParameter("modelCustomizationName", modelCustomizationName);
+        VnfResourceCustomization vnfResourceCustomization = null;
+        try {
+        	vnfResourceCustomization = (VnfResourceCustomization) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row in VRC - data integrity error: modelInvariantId='" + modelInvariantId +"' and modelVersion='" + modelVersion + "' modelCustomizationName='" + modelCustomizationName + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfResourceCustomization modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelInvariantId==" + modelInvariantId+"' and modelVersion='" + modelVersion + "'modelCustomizationName='" + modelCustomizationName + "'");
+        	vnfResourceCustomization = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching VRC for: modelInvariantId='" + modelInvariantId +"' and modelVersion='" + modelVersion + "'modelCustomizationName='" + modelCustomizationName + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching VRC for modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelInvariantId=" + modelInvariantId+"' and modelVersion='" + modelVersion + "'modelCustomizationName='" + modelCustomizationName + "'");
+        	vnfResourceCustomization = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching VRC for: modelInvariantId='" + modelInvariantId +"' and modelVersion='" + modelVersion + "' " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching VRC for modelInvariantId=" + modelInvariantId, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for modelInvariantId=" + modelInvariantId+"' and modelVersion='" + modelVersion + "'modelCustomizationName='" + modelCustomizationName + "'");
+        	vnfResourceCustomization = null;
+        	throw e;
+        }
+        if (vnfResourceCustomization != null) {
+        	LOGGER.debug("Found VRC of " + vnfResourceCustomization.getModelCustomizationUuid() + ", now looking for vnfResource=" + vnfResourceCustomization.getVnfResourceModelUuid() );
+        	vnfResourceCustomization.setVnfResource(this.getVnfResourceByModelUuid(vnfResourceCustomization.getVnfResourceModelUUID()));
+        	LOGGER.debug("Now looking for vfModules for " + vnfResourceCustomization.getModelCustomizationUuid());
+        	vnfResourceCustomization.setVfModuleCustomizations(this.getAllVfModuleCustomizations(vnfResourceCustomization.getModelCustomizationUuid()));
+        }
+
+        if (vnfResourceCustomization == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceCustomizationByModelInvariantId", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelInvariantId", null);
+        }
+        return vnfResourceCustomization;
+    }
+    
+    /**
+     * Return list of VnfResourceCustomization objects identified by the given modelCustomizationUuid 1707
+     *
+     * @param modelCustomizationUuid
+     * @return List<VfModuleCustomization> or null if not found
+     */
+    public List<VfModuleCustomization> getVfModuleCustomizationByVnfModuleCustomizationUuid(String modelCustomizationUuid) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get getVfModuleCustomizationByVnfModuleCustomizationUuid with modelCustomizationUuid: " + modelCustomizationUuid);
+        
+//      select * from vf_module_customization as vfmc where vfmc.MODEL_CUSTOMIZATION_UUID IN(
+//      select vrcmc.VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID from vnf_res_custom_to_vf_module_custom as vrcmc
+//      where vrcmc.VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID = 'd279139c-4b85-48ff-8ac4-9b83a6fc6da7') 
+        
+        String hql = "SELECT vfmc FROM VfModuleCustomization as vfmc where vfmc.modelCustomizationUuid "
+        			+ "IN(select vrcmc.vfModuleCustModelCustomizationUuid from VnfResCustomToVfModuleCustom as vrcmc "
+        					+ "WHERE vrcmc.vnfResourceCustModelCustomizationUuid = :modelCustomizationUuid)";
+        
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelCustomizationUuid", modelCustomizationUuid);
+        List<VfModuleCustomization> resultList = null;
+        try {
+        	resultList = query.list();
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - getVfModuleCustomizationByVnfModuleCustomizationUuid - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + " " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModuleCustomizationByVnfModuleCustomizationUuid - searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	throw he;
+    	} catch (Exception e) {
+        	LOGGER.debug("Exception - getVfModuleCustomizationByVnfModuleCustomizationUuid - while searching for: modelCustomizationUuid='" + modelCustomizationUuid + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModuleCustomizationByVnfModuleCustomizationUuid - searching for modelCustomizationUuid=" + modelCustomizationUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for modelCustomizationUuid=" + modelCustomizationUuid);
+        	throw e;
+    	}
+
+        if (resultList == null) {
+    		resultList = new ArrayList<VfModuleCustomization>();
+    	}
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleCustomizationByVnfModuleCustomizationUuid", null);
+    	return resultList;
+    }
+    
+    /**
+     * Return the newest version of a specific VNF resource Customization (queried by modelCustomizationName and modelVersionId).
+     *
+     * @return {@link VnfResourceCustomization} object or null if none found
+     */
+    public VnfResourceCustomization getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId (String modelCustomizationName, String modelVersionId) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get VNF resource Customization with modelCustomizationName " + modelCustomizationName + " modelUUID " + modelVersionId);
+
+        //select vrc.* from vnf_resource_customization vrc where vrc.MODEL_CUSTOMIZATION_UUID IN (select src.RESOURCE_MODEL_CUSTOMIZATION_UUID from service_to_resource_customizations src);
+        String hql = "SELECT vrc FROM VnfResourceCustomization as vrc WHERE vrc.vnfResourceModelUuid IN "
+					+ "(SELECT vr.modelUuid FROM VnfResource vr "
+					+ "WHERE vr.modelUuid = :modelVersionId)"
+					+ "AND vrc.modelInstanceName = :modelCustomizationName";
+		
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("modelCustomizationName", modelCustomizationName);
+        query.setParameter ("modelVersionId", modelVersionId);
+
+        @SuppressWarnings("unchecked")
+        List <VnfResourceCustomization> resultList = query.list ();
+
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VnfResourceCustomization not found", "CatalogDB", "getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId", null);
+            return null;
+        }
+        
+        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        Collections.reverse (resultList);
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId", null);
+        return resultList.get (0);
+    }
+    
+    public ArrayList<VfModuleCustomization> getAllVfModuleCustomizations(String vnfResourceCustomizationMCU) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - getAllVfModuleCustomizations with vnfResourceCustomizationMCU " + vnfResourceCustomizationMCU);
+        
+        List<VnfResCustomToVfModuleCustom> matches = this.getVRCtoVFMC(vnfResourceCustomizationMCU, null); 
+        if (matches == null || matches.size() < 1) {
+        	LOGGER.debug("Found no vf modules for " + vnfResourceCustomizationMCU);
+        	return new ArrayList<VfModuleCustomization>();
+        }
+        ArrayList<VfModuleCustomization> list = new ArrayList<VfModuleCustomization>();
+        for (VnfResCustomToVfModuleCustom v : matches) {
+        	String m = v.getVfModuleCustModelCustomizationUuid();
+        	LOGGER.debug("VfModule to match: " + m);
+        	VfModuleCustomization c = this.getVfModuleCustomizationByModelCustomizationId(m);
+        	if (c != null) {
+        		list.add(c);
+        	} else {
+        		LOGGER.debug("**UNABLE to find vfModule " + m);
+        	}
+        }
+        return list;
+    }
+    
+    /**
+     * Return the VnfResourceCustomization object identified by the given modelCustomizationUuid 1707
+     * Note that the corresponding VnfResource Object will be put in the VnfResourceCustomization bean
+     *
+     * @param modelCustomizationUuid
+     * @return VnfResourceCustomization or null if not found
+     */
+    public VnfResource getVnfResourceByModelUuid(String modelUuid) {
+    	long startTime = System.currentTimeMillis();
+        LOGGER.debug ("Catalog database - get VnfResource with modelUuid " + modelUuid);
+
+        String hql = "FROM VnfResource WHERE modelUuid = :modelUuid";
+        Query query = getSession().createQuery(hql);
+        query.setParameter ("modelUuid", modelUuid);
+        VnfResource vnfResource = null;
+        try {
+        	vnfResource = (VnfResource) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique Vnf_Resource row - data integrity error: modelUuid='" + modelUuid);
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for Vnf Resource modelUuid=" + modelUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnfResource modelUuid==" + modelUuid);
+        	vnfResource = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: VnfResource modelUuid='" + modelUuid + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for vnfResource ModelUuid=" + modelUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResource modelUuid=" + modelUuid);
+        	vnfResource = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: vnfResource ModelUuid='" + modelUuid + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for vnfResource ModelUuid=" + modelUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for vnfResource modelUuid=" + modelUuid);
+        	vnfResource = null;
+        	throw e;
+        }
+        if (vnfResource == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceByModelUuid", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelUuid", null);
+        }
+        return vnfResource;	
+    }
+    
+    public VnfResCustomToVfModuleCustom getVnfResCustomToVfModule(String vnfId, String vfId) {
+    	long startTime = System.currentTimeMillis();
+    	LOGGER.debug("Catalog database - getVnfResCustomToVfModule - vnfResourceCustModelCustUuid: " + vnfId + ", vfModuleCustModelCustomUuid=" + vfId);
+    	StringBuilder hql = new StringBuilder("FROM VnfResCustomToVfModuleCustom where vnfResourceCustModelCustomizationUuid = :vnfIdValue and vfModuleCustModelCustomizationUuid = :vfIdValue"); 	
+    	HashMap<String, String> parameters = new HashMap<String, String>();
+    	parameters.put("vnfIdValue", vnfId);
+    	parameters.put("vfIdValue", vfId);
+    	VnfResCustomToVfModuleCustom vrctvmc = this.executeQuerySingleRow(hql.toString(), parameters, true);
+        if (vrctvmc == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResCustomToVfModule", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResCustomToVfModule", null);
+        }
+        return vrctvmc;
     }
 
     public List<VfModule> getVfModulesForVnfResource(VnfResource vnfResource) {
         if (vnfResource == null)
             return null;
-        int vnfResourceId = vnfResource.getId();
+    	String vnfResourceModelUuid = vnfResource.getModelUuid();
 
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResource: " + vnfResource.toString());
 
-        return this.getVfModulesForVnfResource(vnfResourceId);
+    	return this.getVfModulesForVnfResource(vnfResourceModelUuid);
 
     }
 
-    public List<VfModule> getVfModulesForVnfResource(int vnfResourceId) {
+    public List<VfModule> getVfModulesForVnfResource(String vnfResourceModelUuid) {
         long startTime = System.currentTimeMillis();
-        LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResourceId: " + vnfResourceId);
-        StringBuilder hql = new StringBuilder("FROM VfModule where vnfResourceId = :vnfResourceId");
+    	LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResourceModelUuid: " + vnfResourceModelUuid);
+    	StringBuilder hql = new StringBuilder("FROM VfModule where vnfResourceModelUUId = :vnfResourceModelUUId");
         Query query = getSession().createQuery(hql.toString());
-        query.setParameter("vnfResourceId", vnfResourceId);
+    	query.setParameter("vnfResourceModelUUId", vnfResourceModelUuid);
         List<VfModule> resultList = null;
         try {
             resultList = query.list();
@@ -1190,11 +1973,13 @@
             else
                 LOGGER.debug("\tQuery found no records.");
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - getVfModulesForVnfResource - while searching for: vnfResourceId='" + vnfResourceId + " " + he.getMessage());
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceId=" + vnfResourceId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceId=" + vnfResourceId);
+        	LOGGER.debug("Hibernate Exception - getVfModulesForVnfResource - while searching for: vnfResourceModelUUId='" + vnfResourceModelUuid + " " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceModelUUId=" + vnfResourceModelUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceModelUUId=" + vnfResourceModelUuid);
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Exception - getVfModulesForVnfResource - while searching for: vnfResourceId='" + vnfResourceId + " " + e.getMessage());
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceId=" + vnfResourceId, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceId=" + vnfResourceId);
+        	LOGGER.debug("Exception - getVfModulesForVnfResource - while searching for: vnfResourceModelUUId='" + vnfResourceModelUuid + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception - getVfModulesForVnfResource - searching for vnfResourceModelUUId=" + vnfResourceModelUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for vnfResourceModelUUId=" + vnfResourceModelUuid);
+        	throw e;
         }
         if (resultList == null) {
             resultList = new ArrayList<VfModule>();
@@ -1218,15 +2003,15 @@
         } catch (org.hibernate.NonUniqueResultException nure) {
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: serviceModelInvariantUuid='" + serviceModelInvariantUuid + "'");
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
-            return null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: serviceName='" + serviceModelInvariantUuid + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: serviceName='" + serviceModelInvariantUuid + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
-            return null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid);
+        	LOGGER.debug("Generic Exception - while searching for: serviceModelInvariantUuid='" + serviceModelInvariantUuid + " " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for serviceModelInvariantUuid=" + serviceModelInvariantUuid);
-            return null;
+        	throw e;
         }
         if (service == null) {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getService", null);
@@ -1251,15 +2036,15 @@
         } catch (org.hibernate.NonUniqueResultException nure) {
             LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: NETWORK_RESOURCE.id='" + id + "'");
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for NETWORK_RESOURCE.id=" + id);
-            return null;
+        	throw nure;
         } catch (org.hibernate.HibernateException he) {
-            LOGGER.debug("Hibernate Exception - while searching for: NETWORK_RESOURCE.id='" + id + "'");
+        	LOGGER.debug("Hibernate Exception - while searching for: NETWORK_RESOURCE.id='" + id + "' " + he.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for NETWORK_RESOURCE.id=" + id);
-            return null;
+        	throw he;
         } catch (Exception e) {
-            LOGGER.debug("Generic Exception - while searching for: NETWORK_RESOURCE.id='" + id);
+        	LOGGER.debug("Generic Exception - while searching for: NETWORK_RESOURCE.id='" + id + " " + e.getMessage());
             LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for NETWORK_RESOURCE.id=" + id, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for NETWORK_RESOURCE.id=" + id);
-            return null;
+        	throw e;
         }
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceById", null);
@@ -1267,27 +2052,156 @@
 
     }
 
+    public NetworkResource getNetworkResourceById(String id) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getNetworkResource with model_uuid " + id);
+
+        String hql = "FROM NetworkResource WHERE modelUUID = :model_uuid";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("model_uuid", id);
+        
+        List<NetworkResource> networkResources = null;
+        try {
+        	networkResources = query.list ();
+    	} catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: NETWORK_RESOURCE.id='" + id + "' " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for NETWORK_RESOURCE.model_uuid=" + id, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for NETWORK_RESOURCE.model_uuid=" + id);
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: NETWORK_RESOURCE.id='" + id + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for NETWORK_RESOURCE.model_uuid=" + id, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for NETWORK_RESOURCE.model_uuid=" + id);
+        	throw e;
+        }
+        
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceById", null);
+        if (networkResources == null || networkResources.isEmpty())
+        	return null;
+        else
+        	return networkResources.get(0);
+    }
+    
+    // 1707 API Spec
+    
+    public static boolean isEmptyOrNull(String str) {
+    	if (str == null) 
+    		return true;
+    	if (str.equals("null"))
+    		return true;
+    	if (str.equals(""))
+    		return true;
+    	return false;
+    }
+    
+    public List<ServiceToResourceCustomization> getSTR(String serviceModelUuid, String resourceModelCustomizationUuid, String modelType) {
+    	long startTime = System.currentTimeMillis();
+    	LOGGER.debug("Catalog database: getSTR - smu=" + serviceModelUuid + ", rmcu=" + resourceModelCustomizationUuid + ", modelType = " + modelType);
+    	
+    	if (isEmptyOrNull(serviceModelUuid) && isEmptyOrNull(resourceModelCustomizationUuid) && isEmptyOrNull(modelType)) 
+    		return null;
+    	
+    	StringBuilder hql = new StringBuilder("FROM ServiceToResourceCustomization WHERE ");
+    	boolean first = true;
+    	if (serviceModelUuid != null && !serviceModelUuid.equals("")) {
+    		hql.append("serviceModelUUID = :smu");
+    		first = false;
+    	}
+    	if (resourceModelCustomizationUuid != null && !resourceModelCustomizationUuid.equals("")) {
+    		if (!first) {
+    			hql.append(" AND ");
+    		}
+    		hql.append("resourceModelCustomizationUUID = :rmcu");
+    		first = false;
+    	}
+    	if (modelType != null && !modelType.equals("")) {
+    		if (!first) {
+    			hql.append(" AND ");
+    			first = false;
+    		}
+    		hql.append("modelType = :modelType");
+    		first = false;
+    	}
+    	Query query = getSession().createQuery(hql.toString());
+    	if (hql.toString().contains(":smu")) 
+    		query.setParameter("smu", serviceModelUuid);
+    	if (hql.toString().contains(":rmcu")) 
+    		query.setParameter("rmcu", resourceModelCustomizationUuid);
+    	if (hql.toString().contains(":modelType")) 
+    		query.setParameter("modelType", modelType);
+        LOGGER.debug("query - " + hql.toString());
+    	
+    	@SuppressWarnings("unchecked")
+    	List<ServiceToResourceCustomization> resultList = query.list();
+        if (resultList == null || resultList.size() < 1) {
+        	LOGGER.debug("Found no matches to the query - " + hql.toString());
+        	return new ArrayList<ServiceToResourceCustomization>();
+        }
+    	return resultList;
+    }
+    
+    public List<VnfResCustomToVfModuleCustom> getVRCtoVFMC (String vrc_mcu, String vfmc_mcu) {
+    	long startTime = System.currentTimeMillis();
+    	LOGGER.debug("Catalog database: getVRCtoVFMC - vrc_mcu=" + vrc_mcu + ", vfmc_mcu=" + vfmc_mcu);
+    	
+    	if (isEmptyOrNull(vrc_mcu) && isEmptyOrNull(vfmc_mcu))
+    		return null;
+    	
+    	StringBuilder hql = new StringBuilder("FROM VnfResCustomToVfModuleCustom WHERE ");
+    	boolean first = true;
+    	if (vrc_mcu != null && !vrc_mcu.equals("")) {
+    		hql.append("vnfResourceCustModelCustomizationUuid = :vrc_mcu");
+    		first = false;
+    	}
+    	if (vfmc_mcu != null && !vfmc_mcu.equals("")) {
+    		if (!first) {
+    			hql.append(" AND ");
+    		}
+    		hql.append("vfModuleCustModelCustomizationUuid = :vfmc_mcu");
+    		first = false;
+    	}
+    	Query query = getSession().createQuery(hql.toString());
+    	if (hql.toString().contains(":vrc_mcu")) 
+    		query.setParameter("vrc_mcu", vrc_mcu);
+    	if (hql.toString().contains(":vfmc_mcu")) 
+    		query.setParameter("vfmc_mcu", vfmc_mcu);
+    	@SuppressWarnings("unchecked")
+    	List<VnfResCustomToVfModuleCustom> resultList = query.list();
+        if (resultList == null || resultList.size() < 1) {
+        	LOGGER.debug("Found no matches to the query - " + hql.toString());
+        	return new ArrayList<VnfResCustomToVfModuleCustom>();
+        }
+    	return resultList;
+    }
+    
+    @SuppressWarnings("unchecked")
+    public List <TempNetworkHeatTemplateLookup> getTempNetworkHeatTemplateLookup (String networkResourceModelName) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - GetTempNetworkHeatTemplateLookup for Network Name " + networkResourceModelName);
+
+        String hql = "FROM TempNetworkHeatTemplateLookup where networkResourceModelName = :networkResourceModelName";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("networkResourceModelName", networkResourceModelName);
+
+        List <TempNetworkHeatTemplateLookup> result = query.list ();
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getTempNetworkHeatTemplateLookup", null);
+        return result;
+    }
+    
     // 1702 API Spec - Query for all networks in a Service:
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelUuid(String serviceModelUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getServiceNetworksByServiceModelUuid - " + serviceModelUuid);
 
-        // This is a 2-step process (3 really) - 1) query ServiceToNetworks, 2) query NetworkResourceCustomization, 3) populate the networkType
-
-        StringBuilder hql1 = new StringBuilder("FROM ServiceToNetworks WHERE serviceModelUuid = :serviceModelUuid");
-        Query query = getSession().createQuery(hql1.toString());
-        query.setParameter("serviceModelUuid", serviceModelUuid);
-        @SuppressWarnings("unchecked")
-        List<ServiceToNetworks> resultList1 = query.list();
-        if (resultList1 == null || resultList1.size() < 1) {
-            LOGGER.debug("Found no matches to the query - FROM ServiceToNetworks WHERE serviceModelUuid = " + serviceModelUuid);
+    	List<ServiceToResourceCustomization> strMappings = this.getSTR(serviceModelUuid, null, "network");
+    	if (strMappings == null || strMappings.size() < 1) {
+    		LOGGER.debug("Found NO matches for NRC with ServiceModelUuid=" + serviceModelUuid);
             return new ArrayList<NetworkResourceCustomization>();
         }
-        LOGGER.debug("Found " + resultList1.size() + " entries in ServiceToNetworks with smu=" + serviceModelUuid);
+        LOGGER.debug("Found " + strMappings.size() + " entries in ServiceToResourceCustomizations.network with smu=" + serviceModelUuid); 
 
         ArrayList<NetworkResourceCustomization> masterList = new ArrayList<NetworkResourceCustomization>();
-        for (ServiceToNetworks stn : resultList1) {
-            String networkModelCustomizationUuid = stn.getNetworkModelCustomizationUuid();
+        for (ServiceToResourceCustomization stn : strMappings) {
+        	String networkModelCustomizationUuid = stn.getResourceModelCustomizationUUID();
             LOGGER.debug("Now searching for NetworkResourceCustomization for " + networkModelCustomizationUuid);
             List<NetworkResourceCustomization> resultSet = this.getAllNetworksByNetworkModelCustomizationUuid(networkModelCustomizationUuid);
             for (NetworkResourceCustomization nrc : resultSet) {
@@ -1297,7 +2211,6 @@
         LOGGER.debug("Returning " + masterList.size() + " NRC records");
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByServiceModelUuid", null);
         return masterList;
-
     }
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         long startTime = System.currentTimeMillis();
@@ -1318,7 +2231,7 @@
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
-        String serviceNameVersionId = service.getServiceNameVersionId();
+        String serviceNameVersionId = service.getModelUUID();
         LOGGER.debug("The highest version for the Service " + serviceModelInvariantUuid + " is " + serviceNameVersionId);
 
         // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
@@ -1347,7 +2260,7 @@
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
-        String serviceNameVersionId = service.getServiceNameVersionId();
+        String serviceNameVersionId = service.getModelUUID();
 
         // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
         return this.getAllNetworksByServiceModelUuid(serviceNameVersionId);
@@ -1358,17 +2271,32 @@
         LOGGER.debug("Catalog database: getAllNetworksByNetworkModelCustomizationUuid - " + networkModelCustomizationUuid);
 
         StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid");
-        Query query = getSession().createQuery(hql.toString());
-        query.setParameter("networkModelCustomizationUuid", networkModelCustomizationUuid);
+    	//Query query = getSession().createQuery(hql.toString());
+    	//query.setParameter("networkModelCustomizationUuid", networkModelCustomizationUuid);
+    	//LOGGER.debug("QUERY: " + hql.toString() + ", networkModelCustomizationUuid=" + networkModelCustomizationUuid);
+    	
+    	//@SuppressWarnings("unchecked")
+    	//List<NetworkResourceCustomization> resultList = query.list();
+    	
+    	HashMap<String, String> params = new HashMap<String, String>();
+    	params.put("networkModelCustomizationUuid", networkModelCustomizationUuid);
 
-        @SuppressWarnings("unchecked")
-        List<NetworkResourceCustomization> resultList = query.list();
+    	List<NetworkResourceCustomization> resultList = this.executeQueryMultipleRows(hql.toString(), params, true);
 
-        this.populateNetworkResourceType(resultList);
+    	if (resultList.isEmpty()) {
+    		LOGGER.debug("Unable to find an NMC with nmcu=" + networkModelCustomizationUuid);
+    		return new ArrayList<NetworkResourceCustomization>();
+    	}
+    	for (NetworkResourceCustomization nrc : resultList) {
+    		nrc.setNetworkResource(this.getNetworkResourceById(nrc.getNetworkResourceModelUuid()));
+    	}
+     	
+    	//this.populateNetworkResourceType(resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByNetworkModelCustomizationUuid", null);
         return resultList;
     }
+    
     public List<NetworkResourceCustomization> getAllNetworksByNetworkType(String networkType) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getServiceNetworksByNetworkType - " + networkType);
@@ -1377,10 +2305,10 @@
         if (nr == null) {
             return new ArrayList<NetworkResourceCustomization>();
         }
-        Integer networkResourceId = nr.getId();
+    	String networkResourceId = nr.getModelUUID();
 
         LOGGER.debug("Now searching for NRC's with networkResourceId = " + networkResourceId);
-        StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE networkResourceId = :networkResourceId");
+    	StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE networkResourceModelUuid = :networkResourceId");
 
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("networkResourceId", networkResourceId);
@@ -1399,33 +2327,65 @@
 
         return resultList;
     }
+    public ArrayList<VfModuleCustomization> getAllVfmcForVrc(VnfResourceCustomization vrc) {
+    	long startTime = System.currentTimeMillis();
+    	LOGGER.debug("Catalog database: getAllVfmcForVrc - " + vrc.getModelCustomizationUuid());
+    	
+    	List<VnfResCustomToVfModuleCustom> vfmcs = this.getVRCtoVFMC(vrc.getModelCustomizationUuid(), null);
+    	if (vfmcs == null || vfmcs.size() < 1) {
+    		return null;
+    	}
+    	ArrayList<VfModuleCustomization> vfModuleCusts = new ArrayList<VfModuleCustomization>();
+    	for (VnfResCustomToVfModuleCustom vfmc : vfmcs) {
+    		VfModuleCustomization vfmcust = this.getVfModuleCustomizationByModelCustomizationId(vfmc.getVfModuleCustModelCustomizationUuid());
+    		if (vfmcust != null) {
+    			vfModuleCusts.add(vfmcust);
+    		}
+    	}
+    	return vfModuleCusts;
+    }
 
     //1702 API Spec cont'd - Query for all VnfResources in a Service:
-    public List<VnfResource> getAllVnfsByServiceModelUuid(String serviceModelUuid) {
+    //1707 modified for db refactoring
+    public List<VnfResourceCustomization> getAllVnfsByServiceModelUuid(String serviceModelUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelUuid - " + serviceModelUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE serviceNameVersionId = :serviceModelUuid");
+    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelUUID = :serviceModelUuid");
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("serviceModelUuid", serviceModelUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
 
         if (serviceList.isEmpty()) {
-            return new ArrayList<VnfResource>();
+    		LOGGER.debug("Unable to find a service with modelUuid=" + serviceModelUuid);
+    		return new ArrayList<VnfResourceCustomization>();
         }
 
         Collections.sort (serviceList, new MavenLikeVersioningComparator ());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
-        String serviceModelInvariantUuid = service.getModelInvariantUUID();
-        String serviceModelVersion = service.getVersion();
+        // Step 2 - Now query to get the related VnfResourceCustomizations
 
-        return this.getAllVnfsByServiceModelInvariantUuid(serviceModelInvariantUuid, serviceModelVersion);
+        List<ServiceToResourceCustomization> strcs = this.getSTR(serviceModelUuid, null, "vnf");
 
+        if (strcs.isEmpty()) {
+    		LOGGER.debug("Unable to find any related vnfs to a service with modelUuid=" + serviceModelUuid);
+        	return new ArrayList<VnfResourceCustomization>();
     }
-    public List<VnfResource> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
+        
+        ArrayList<VnfResourceCustomization> allVrcs = new ArrayList<VnfResourceCustomization>();
+        for (ServiceToResourceCustomization strc : strcs) {
+        	LOGGER.debug("Try to find VRC for mcu=" + strc.getResourceModelCustomizationUUID());
+        	VnfResourceCustomization vrc = this.getVnfResourceCustomizationByModelCustomizationUuid(strc.getResourceModelCustomizationUUID());
+        	if (vrc != null)
+        		allVrcs.add(vrc);
+        }
+        return allVrcs;
+    	
+    }
+    public List<VnfResourceCustomization> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
@@ -1436,50 +2396,44 @@
         List<Service> resultList = query.list();
 
         if (resultList.isEmpty()) {
-            return new ArrayList<VnfResource>();
+    		return new ArrayList<VnfResourceCustomization>();
         }
         Collections.sort (resultList, new MavenLikeVersioningComparator ());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
         //now just call the method that takes the version - the service object will have the highest version
-        return this.getAllVnfsByServiceModelInvariantUuid(serviceModelInvariantUuid, service.getVersion());
+    	return this.getAllVnfsByServiceModelUuid(service.getModelUUID());
     }
-    public List<VnfResource> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
+    public List<VnfResourceCustomization> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM VnfResource WHERE serviceModelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
+    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
         @SuppressWarnings("unchecked")
-        List<VnfResource> resultList = query.list();
+    	List<Service> resultList = query.list();
 
         if (resultList.isEmpty()) {
-            return new ArrayList<VnfResource>();
-        }
-        // so we have a list of VnfResource objects - but we need to add each one's VfModule objects
-        for (VnfResource vnfResource : resultList) {
-            List<VfModule> vfModules = this.getVfModulesForVnfResource(vnfResource);
-            if (vfModules != null && !vfModules.isEmpty()) {
-                for (VfModule vfm : vfModules) {
-                    vnfResource.addVfModule(vfm);
+    		return new ArrayList<VnfResourceCustomization>();
                 }
-            }
-        }
+        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        Collections.reverse (resultList);
+        Service service = resultList.get(0);
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByServiceModelInvariantUuid", null);
-        return resultList;
+    	return this.getAllVnfsByServiceModelUuid(service.getModelUUID());
+            }
 
-    }
-    public List<VnfResource> getAllVnfsByServiceName(String serviceName, String serviceVersion)  {
+    public List<VnfResourceCustomization> getAllVnfsByServiceName(String serviceName, String serviceVersion)  {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName + ", version=" + serviceVersion);
         if (serviceVersion == null || serviceVersion.equals("")) {
             return this.getAllVnfsByServiceName(serviceName);
         }
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE serviceName = :serviceName and version = :serviceVersion");
+    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName and version = :serviceVersion");
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("serviceName", serviceName);
         query.setParameter("serviceVersion", serviceVersion);
@@ -1490,16 +2444,14 @@
         if (resultList.isEmpty()) {
             return null;
         }
-
         Service service = resultList.get(0);
-
-        return this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+    	return this.getAllVnfsByServiceModelUuid(service.getModelUUID());
     }
-    public List<VnfResource> getAllVnfsByServiceName(String serviceName) {
+    public List<VnfResourceCustomization> getAllVnfsByServiceName(String serviceName) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE serviceName = :serviceName");
+    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName");
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("serviceName", serviceName);
 
@@ -1513,37 +2465,33 @@
         Collections.reverse (resultList);
         Service service = resultList.get(0);
 
-        return this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
+    	return this.getAllVnfsByServiceModelUuid(service.getModelUUID());
     }
-    public List<VnfResource> getAllVnfsByVnfModelCustomizationUuid(String vnfModelCustomizationUuid) {
+
+    public List<VnfResourceCustomization> getAllVnfsByVnfModelCustomizationUuid(String vnfModelCustomizationUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByVnfModelCustomizationUuid - " + vnfModelCustomizationUuid);
 
-        StringBuilder hql = new StringBuilder("FROM VnfResource WHERE modelCustomizationUuid = :vnfModelCustomizationUuid");
-        Query query = getSession().createQuery(hql.toString());
-        query.setParameter("vnfModelCustomizationUuid", vnfModelCustomizationUuid);
-
+    	StringBuilder hql1 = new StringBuilder("FROM VnfResourceCustomization WHERE modelCustomizationUuid = :vrcmcu");
+    	Query query1 = getSession().createQuery(hql1.toString());
+    	query1.setParameter("vrcmcu", vnfModelCustomizationUuid);
         @SuppressWarnings("unchecked")
-        List<VnfResource> resultList = query.list();
+    	List<VnfResourceCustomization> resultList1 = query1.list();
 
-        if (resultList.isEmpty()) {
+    	if (resultList1.isEmpty()) {
             LOGGER.debug("Found no records matching " + vnfModelCustomizationUuid);
             return null;
         }
-        // so we have a list of VnfResource objects - but we need to add each one's VfModule objects
-        for (VnfResource vnfResource : resultList) {
-            LOGGER.debug("Finding vfModules for vnfResource.id=" + vnfResource.getId());
-            List<VfModule> vfModules = this.getVfModulesForVnfResource(vnfResource);
-            if (vfModules != null && !vfModules.isEmpty()) {
-                LOGGER.debug("\tFound " + vfModules.size() + " vf modules");
-                for (VfModule vfm : vfModules) {
-                    vnfResource.addVfModule(vfm);
+    	
+    	for (VnfResourceCustomization vrc : resultList1) {
+    		VnfResource vr = this.getVnfResourceByModelUuid(vrc.getVnfResourceModelUuid());
+    		vrc.setVnfResource(vr);
+    		vrc.setVfModuleCustomizations(this.getAllVfmcForVrc(vrc));
                 }
-            }
-        }
-        LOGGER.debug("Returning " + resultList + " vnf modules");
+
+    	LOGGER.debug("Returning " + resultList1.size() + " vnf modules");
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByVnfModelCustomizationUuid", null);
-        return resultList;
+    	return resultList1;
     }
 
     //1702 API Spec cont'd - Query for all allotted resources in a Service
@@ -1552,22 +2500,16 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelUuid - " + serviceModelUuid);
 
-        // This is a 2-step process (3 really) - 1) query ServiceToAllottedResources, 2) query AllottedResourceCustomization
-
-        StringBuilder hql1 = new StringBuilder("FROM ServiceToAllottedResources WHERE serviceModelUuid = :serviceModelUuid");
-        Query query = getSession().createQuery(hql1.toString());
-        query.setParameter("serviceModelUuid", serviceModelUuid);
-        @SuppressWarnings("unchecked")
-        List<ServiceToAllottedResources> resultList1 = query.list();
-        if (resultList1 == null || resultList1.size() < 1) {
-            LOGGER.debug("Found no matches to the query " + hql1.toString());
+    	List<ServiceToResourceCustomization> strcs = this.getSTR(serviceModelUuid, null, "allottedResource");
+    	if (strcs == null || strcs.size() < 1) {
+    		LOGGER.debug("No AR entries found for " + serviceModelUuid);
             return new ArrayList<AllottedResourceCustomization>();
         }
-        LOGGER.debug("Found " + resultList1.size() + " entries in ServiceToAllottedResources with smu=" + serviceModelUuid);
+        LOGGER.debug("Found " + strcs.size() + " entries in ServiceToResourceCustomizations with smu=" + serviceModelUuid + ", allottedResource"); 
 
         ArrayList<AllottedResourceCustomization> masterList = new ArrayList<AllottedResourceCustomization>();
-        for (ServiceToAllottedResources star : resultList1) {
-            String arModelCustomizationUuid = star.getArModelCustomizationUuid();
+        for (ServiceToResourceCustomization star : strcs) {
+        	String arModelCustomizationUuid = star.getResourceModelCustomizationUUID();
             LOGGER.debug("Now searching for AllottedResourceCustomization for " + arModelCustomizationUuid);
             List<AllottedResourceCustomization> resultSet = this.getAllAllottedResourcesByArModelCustomizationUuid(arModelCustomizationUuid);
             for (AllottedResourceCustomization arc : resultSet) {
@@ -1598,11 +2540,10 @@
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
-        String serviceNameVersionId = service.getServiceNameVersionId();
-        LOGGER.debug("The highest version for the Service " + serviceModelInvariantUuid + " is " + serviceNameVersionId);
+        String serviceModelUuid = service.getModelUUID();
+        LOGGER.debug("The highest version for the Service " + serviceModelInvariantUuid + " is " + serviceModelUuid);
 
-        // Service.serviceNameVersionId == ServiceToAllottedResources.serviceModelUuid
-        return this.getAllAllottedResourcesByServiceModelUuid(serviceNameVersionId);
+        return this.getAllAllottedResourcesByServiceModelUuid(serviceModelUuid);
     }
 
     public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
@@ -1614,8 +2555,6 @@
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
-        //TODO
-        //can fix this later - no time - could do a unique query here - but this should work
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
 
@@ -1628,10 +2567,9 @@
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
-        String serviceNameVersionId = service.getServiceNameVersionId();
+        String serviceModelUuid = service.getModelUUID();
 
-        // Service.serviceNameVersionId == ServiceToNetworks.serviceModelUuid
-        return this.getAllAllottedResourcesByServiceModelUuid(serviceNameVersionId);
+        return this.getAllAllottedResourcesByServiceModelUuid(serviceModelUuid);
     }
 
     public List<AllottedResourceCustomization> getAllAllottedResourcesByArModelCustomizationUuid(String arModelCustomizationUuid) {
@@ -1645,18 +2583,50 @@
         @SuppressWarnings("unchecked")
         List<AllottedResourceCustomization> resultList = query.list();
 
+    	if (resultList.isEmpty()) {
+    		LOGGER.debug("No ARC found with arc_mcu=" + arModelCustomizationUuid);
+    		return new ArrayList<AllottedResourceCustomization>();
+    	}
+    	// There should only be one - but we'll handle if multiple
+    	for (AllottedResourceCustomization arc : resultList) {
+    		AllottedResource ar = this.getAllottedResourceByModelUuid(arc.getArModelUuid());
+    		arc.setAllottedResource(ar);
+    	}
+    	
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllAllottedResourcesByArModelCustomizationUuid", null);
         return resultList;
     }
 
+    public AllottedResource getAllottedResourceByModelUuid(String arModelUuid) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Allotted Resource with modelUuid= " + arModelUuid);
+
+        String hql = "FROM AllottedResource WHERE modelUuid = :arModelUuid";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("arModelUuid", arModelUuid);
+
+        @SuppressWarnings("unchecked")
+        List <AllottedResource> resultList = query.list ();
+
+        // See if something came back. Name is unique, so
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. AllottedResource not found", "CatalogDB", "getAllottedResourceByModelUuid", null);
+            return null;
+        }
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllottedResourceByModelUuid", null);
+        return resultList.get (0);
+    	
+    }
+    
     //1702 API Spec cont'd - Query for all resources in a Service:
     public ServiceMacroHolder getAllResourcesByServiceModelUuid(String serviceModelUuid) {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllResourcesByServiceModelUuid - " + serviceModelUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE serviceNameVersionId = :serviceModelUuid");
+    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelUUID = :serviceModelUuid");
         Query query = getSession().createQuery(hql.toString());
         query.setParameter("serviceModelUuid", serviceModelUuid);
+    	LOGGER.debug("Query: " + hql.toString() + ", smu=" + serviceModelUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
 
@@ -1674,8 +2644,8 @@
         smh.setNetworkResourceCustomization(nrcList);
         ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(serviceModelUuid);
         smh.setAllottedResourceCustomization(arcList);
-        ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
-        smh.setVnfResources(vnfList);
+        ArrayList<VnfResourceCustomization> vnfList = (ArrayList<VnfResourceCustomization>) this.getAllVnfsByServiceModelUuid(serviceModelUuid);
+        smh.setVnfResourceCustomizations(vnfList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelUuid", null);
         return smh;
@@ -1700,12 +2670,12 @@
         Service service = serviceList.get(0);
 
         ServiceMacroHolder smh = new ServiceMacroHolder(service);
-        ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getServiceNameVersionId());
+        ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getModelUUID());
         smh.setNetworkResourceCustomization(nrcList);
-        ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getServiceNameVersionId());
+        ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getModelUUID());
         smh.setAllottedResourceCustomization(arcList);
-        ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
-        smh.setVnfResources(vnfList);
+        ArrayList<VnfResourceCustomization> vnfList = (ArrayList<VnfResourceCustomization>) this.getAllVnfsByServiceModelUuid(service.getModelUUID());
+        smh.setVnfResourceCustomizations(vnfList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelInvariantUuid", null);
         return smh;
@@ -1733,12 +2703,12 @@
         Service service = serviceList.get(0);
 
         ServiceMacroHolder smh = new ServiceMacroHolder(service);
-        ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getServiceNameVersionId());
+        ArrayList<NetworkResourceCustomization> nrcList = (ArrayList<NetworkResourceCustomization>) this.getAllNetworksByServiceModelUuid(service.getModelUUID());
         smh.setNetworkResourceCustomization(nrcList);
-        ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getServiceNameVersionId());
+        ArrayList<AllottedResourceCustomization> arcList = (ArrayList<AllottedResourceCustomization>) this.getAllAllottedResourcesByServiceModelUuid(service.getModelUUID());
         smh.setAllottedResourceCustomization(arcList);
-        ArrayList<VnfResource> vnfList = (ArrayList<VnfResource>) this.getAllVnfsByServiceModelInvariantUuid(service.getModelInvariantUUID(), service.getVersion());
-        smh.setVnfResources(vnfList);
+        ArrayList<VnfResourceCustomization> vnfList = (ArrayList<VnfResourceCustomization>) this.getAllVnfsByServiceModelUuid(service.getModelUUID());
+        smh.setVnfResourceCustomizations(vnfList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllResourcesByServiceModelUuid with version", null);
         return smh;
@@ -1763,7 +2733,9 @@
         }
         return resultList.get(0);
     }
+    @Deprecated
     public VnfResource getSingleVnfResourceByModelCustomizationUuid(String modelCustomizationUuid) {
+    	/*
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database; getSingleVnfResourceByModelCustomizationUuid - " + modelCustomizationUuid);
         List<VnfResource> resultList = this.getAllVnfsByVnfModelCustomizationUuid(modelCustomizationUuid);
@@ -1771,13 +2743,16 @@
             return null;
         }
         return resultList.get(0);
+    	*/
+    	return null;
     }
 
     private void populateNetworkResourceType(List<NetworkResourceCustomization> resultList) {
-        HashMap<Integer, NetworkResource> networkResources = new HashMap<Integer, NetworkResource>();
+        HashMap<String, NetworkResource> networkResources = new HashMap<String, NetworkResource>();
 
         for (NetworkResourceCustomization nrc : resultList) {
-            Integer network_id = nrc.getNetworkResourceId();
+        	//Integer network_id = nrc.getNetworkResourceId();
+        	String network_id = nrc.getNetworkResourceModelUuid();
             if (network_id == null) {
                 nrc.setNetworkResource(null);
                 nrc.setNetworkType("UNKNOWN_NETWORK_ID_NULL");
@@ -1785,13 +2760,13 @@
             }
             if (networkResources.containsKey(network_id)) {
                 nrc.setNetworkResource(networkResources.get(network_id));
-                nrc.setNetworkType(networkResources.get(network_id).getNetworkType());
+        		nrc.setNetworkType(networkResources.get(network_id).getModelName());
             } else {
                 NetworkResource nr = this.getNetworkResourceById(network_id);
                 if (nr == null) {
                     nrc.setNetworkType("INVALID_NETWORK_TYPE_ID_NOT_FOUND");
                 } else {
-                    nrc.setNetworkType(nr.getNetworkType());
+        			nrc.setNetworkType(nr.getModelName());
                     nrc.setNetworkResource(nr);
                     networkResources.put(network_id, nr);
                 }
@@ -1833,8 +2808,7 @@
 
         VfModule vfMod = resultList.get(0);
 
-        int id = vfMod.getId();
-        String vfModuleId = Integer.toString(id);
+        String vfModuleId = vfMod.getModelUUID();
 
         StringBuilder hql1 = new StringBuilder ("FROM VnfRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
 
@@ -1843,7 +2817,7 @@
                                       + action);
 
         Query query1 = getSession ().createQuery (hql1.toString ());
-        query1.setParameter (VF_MODULE_ID, vfModuleId);
+        query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
         @SuppressWarnings("unchecked")
@@ -1899,9 +2873,10 @@
         return resultList;
     }
 
+    
     /**
      * Return a VNF COMPONENTSrecipe that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
-     * ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
+     * MODEL_CUSTOMIZATION_UUID, ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
      * first query VF_MODULE table by type, and then use the ID to query
      * VNF_COMPONENTS_RECIPE by VF_MODULE_ID and ACTION
      *
@@ -1925,8 +2900,7 @@
 
         VfModule vfMod = resultList.get(0);
 
-        int id = vfMod.getId();
-        String vfModuleId = Integer.toString(id);
+        String vfModuleId = vfMod.getModelUUID();
 
         StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
 
@@ -1935,7 +2909,7 @@
                 + action);
 
         Query query1 = getSession ().createQuery (hql1.toString ());
-        query1.setParameter (VF_MODULE_ID, vfModuleId);
+        query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
         @SuppressWarnings("unchecked")
@@ -1981,8 +2955,7 @@
 
         VfModule vfMod = resultList.get(0);
 
-        int id = vfMod.getId();
-        String vfModuleId = Integer.toString(id);
+        String vfModuleId = vfMod.getModelName();      
 
         StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
 
@@ -1991,7 +2964,7 @@
                                       + action);
 
         Query query1 = getSession ().createQuery (hql1.toString ());
-        query1.setParameter (VF_MODULE_ID, vfModuleId);
+        query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
         @SuppressWarnings("unchecked")
@@ -2039,6 +3012,7 @@
      * @return A list of VnfResource objects
      */
     @SuppressWarnings("unchecked")
+    @Deprecated // vnfRole is no longer in VnfResource
     public List <VnfResource> getVnfResourcesByRole (String vnfRole) {
 
         long startTime = System.currentTimeMillis ();
@@ -2054,6 +3028,25 @@
     }
 
     /**
+     * Return VNF Resources in the Catalog DB that match a given VNF role
+     *
+     * @return A list of VnfResource objects
+     */
+    @SuppressWarnings("unchecked")
+    public List<VnfResourceCustomization> getVnfResourceCustomizationsByRole(String vnfRole) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get all VNF resource customizations for role " + vnfRole);
+
+        String hql = "FROM VnfResourceCustomization WHERE nfRole = :vnfRole";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("vnfRole", vnfRole);
+
+        List <VnfResourceCustomization> resources = query.list ();
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationsByRole", null);
+        return resources;
+    }
+
+    /**
      * Return all Network Resources in the Catalog DB
      *
      * @return A list of NetworkResource objects
@@ -2072,6 +3065,19 @@
         return result;
     }
 
+    @SuppressWarnings("unchecked")
+    public List<NetworkResourceCustomization> getAllNetworkResourceCustomizations() {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get all network resource customizations");
+
+        String hql = "FROM NetworkResourceCustomization";
+        Query query = getSession ().createQuery (hql);
+
+        List <NetworkResourceCustomization> result = query.list ();
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworkResourceCustomizations", null);
+        return result;	
+    }
+    
     /**
      * Return all VF Modules in the Catalog DB
      *
@@ -2091,6 +3097,21 @@
         return result;
     }
 
+   @SuppressWarnings("unchecked")
+   public List <VfModuleCustomization> getAllVfModuleCustomizations () {
+
+       long startTime = System.currentTimeMillis ();
+       LOGGER.debug ("Catalog database - get all vf module customizations");
+
+       String hql = "FROM VfModuleCustomization";
+       Query query = getSession ().createQuery (hql);
+
+       List <VfModuleCustomization> result = query.list ();
+       LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVfModuleCustomizations", null);
+       return result;
+   }
+    
+
     /**
      * Return all HeatEnvironment in the Catalog DB
      *
@@ -2113,6 +3134,7 @@
     /**
      * Fetch the Environment by Environment ID - 1510
      */
+    @Deprecated // no longer in heat envt table
     public HeatEnvironment getHeatEnvironment (int id) {
 
         long startTime = System.currentTimeMillis ();
@@ -2141,6 +3163,7 @@
      * Fetch the nested templates - 1510
      */
 
+    @Deprecated
     public Map <String, Object> getNestedTemplates (int templateId) {
         Map <String, Object> nestedTemplates = null;
         long startTime = System.currentTimeMillis ();
@@ -2185,10 +3208,61 @@
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNestedTemplate", null);
         return nestedTemplates;
     }
+    /**
+     * Return a Map<String, Object> for returning the child templates and their contents
+     * 
+     * @param parentHeatTemplateId
+     * @return Map<String,Object> or null if none found
+     */
+    public Map <String, Object> getNestedTemplates (String parentHeatTemplateId) {
+        Map <String, Object> nestedTemplates = null;
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getNestedTemplates called with parentTemplateId " + parentHeatTemplateId);
+
+        String hql = "FROM HeatNestedTemplate where parentTemplateId = :parentHeatTemplateId";
+
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("parentHeatTemplateId", parentHeatTemplateId);
+
+        @SuppressWarnings("unchecked")
+        List <HeatNestedTemplate> resultList = query.list ();
+        // If nothing comes back, there are no nested templates
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No nestedTemplate found", "CatalogDB", "getNestedTemplates", null);
+            LOGGER.debug ("No nestedTemplates found for templateId=" + parentHeatTemplateId + ", " + hql);
+            return null;
+        }
+        // Now, for each entry in NESTED_HEAT_TEMPLATES, we need to grab the template body from HEAT_TEMPLATE
+        nestedTemplates = new HashMap <String, Object> ();
+        for (HeatNestedTemplate hnt : resultList) {
+            LOGGER.debug ("Querying for " + hnt);
+            HeatTemplate ht = this.getHeatTemplateByArtifactUuid (hnt.getChildTemplateId ());
+            if (ht == null) {
+                LOGGER.debug ("No template found matching childTemplateId=" + hnt.getChildTemplateId ());
+                continue;
+            }
+            String providerResourceFile = hnt.getProviderResourceFile ();
+            String heatTemplateBody = ht.getTemplateBody ();
+            if (providerResourceFile != null && heatTemplateBody != null) {
+                nestedTemplates.put (providerResourceFile, heatTemplateBody);
+            } else {
+                LOGGER.debug ("providerResourceFile or heatTemplateBody were null - do not add to HashMap!");
+            }
+        }
+        // Make sure we're not returning an empty map - if so, just return null
+        if (nestedTemplates.isEmpty ()) {
+            LOGGER.debug ("nestedTemplates is empty - just return null");
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Nested template is empty", "CatalogDB", "getNestedTemplate", null);
+            return null;
+        }
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNestedTemplate", null);
+        return nestedTemplates;
+    }
 
     /*
      * Fetch any files in the HEAT_FILES table 1510
      */
+    @Deprecated
     public Map <String, HeatFiles> getHeatFiles (int vnfResourceId) {
        Map <String, HeatFiles> heatFiles = null;
 
@@ -2224,8 +3298,9 @@
     }
 
     // New 1607 - with modularization, use new table to determine which HEAT_FILES entries to attach
-
+    @Deprecated
     public Map <String, HeatFiles> getHeatFilesForVfModule(int vfModuleId) {
+    	/*
         Map <String, HeatFiles> heatFiles = null;
 
         long startTime = System.currentTimeMillis ();
@@ -2242,7 +3317,6 @@
             return null;
         }
         //Now the fun part - we have a list of the heat files we need to get - could clean this up with a join
-        //TODO - convert this all with one join - brute force for now due to time
         heatFiles = new HashMap<String, HeatFiles>();
         for (VfModuleToHeatFiles vmthf : mapList) {
         	int heatFilesId = vmthf.getHeatFilesId();
@@ -2272,9 +3346,119 @@
         }
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatFilesForVfModule", null);
         return heatFiles;
+        */
+    	return null;
+    }
+    
+    /**
+     * Return a VfModuleToHeatFiles object 
+     * 
+     * @param vfModuleModelUuid, heatFilesArtifactUuid
+     * @return VfModuleToHeatFiles or null if none found
+     */ 
+    public VfModuleToHeatFiles getVfModuleToHeatFilesEntry(String vfModuleModelUuid, String heatFilesArtifactUuid) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getVfModuleToHeatFilesEntry with vfModuleModelUuid " + vfModuleModelUuid + ", heatFilesArtifactUuid=" + heatFilesArtifactUuid);
+        String hql = "FROM VfModuleToHeatFiles where vfModuleModelUuid = :vfModuleModelUuidValue and heatFilesArtifactUuid = :heatFilesArtifactUuidValue";
+        
+        HashMap<String, String> parameters = new HashMap<String, String>();
+        parameters.put("vfModuleModelUuidValue", vfModuleModelUuid);
+        parameters.put("heatFilesArtifactUuidValue", heatFilesArtifactUuid);
+        
+        VfModuleToHeatFiles vmthf = null;
+        
+        try {
+        	vmthf = this.executeQuerySingleRow(hql.toString(), parameters, true);
+        } catch (Exception e) {
+        	throw e;
+        }
+        return vmthf;
     }
 
+    
+    /**
+     * Return a ServiceToResourceCustomization object 
+     * 
+     * @param vfModuleModelUuid, heatFilesArtifactUuid
+     * @return VfModuleToHeatFiles or null if none found
+     */ 
+    public ServiceToResourceCustomization getServiceToResourceCustomization(String serviceModelUuid, String resourceModelCustomizationUuid, String modelType) {
 
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getServiceToResourceCustomization with serviceModelUuid=" + serviceModelUuid + ", resourceModelCustomizationUuid=" + resourceModelCustomizationUuid + ", modelType=" + modelType);
+        String hql = "FROM ServiceToResourceCustomization where serviceModelUUID = :serviceModelUuidValue and resourceModelCustomizationUUID = :resourceModelCustomizationUuidValue and modelType = :modelTypeValue ";
+        
+        HashMap<String, String> parameters = new HashMap<String, String>();
+        parameters.put("serviceModelUuidValue", serviceModelUuid);
+        parameters.put("resourceModelCustomizationUuidValue", resourceModelCustomizationUuid);
+        parameters.put("modelTypeValue", modelType);
+        
+        ServiceToResourceCustomization strc = null;
+        
+        try {
+        	strc = this.executeQuerySingleRow(hql.toString(), parameters, true);
+        } catch (Exception e) {
+        	throw e;
+        }
+        return strc;
+    }
+
+    /**
+     * Return a Map<String, HeatFiles> for returning the heat files associated with a vfModule 1707
+     * 
+     * @param parentHeatTemplateId
+     * @return Map<String,Object> or null if none found
+     */ 
+    public Map <String, HeatFiles> getHeatFilesForVfModule(String vfModuleModelUuid) {
+        Map <String, HeatFiles> heatFiles = null;
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getHeatFilesForVfModule called with vfModuleModelUuid " + vfModuleModelUuid);
+        String hql = "FROM VfModuleToHeatFiles where vfModuleModelUuid = :vfModuleModelUuidValue";
+
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("vfModuleModelUuidValue", vfModuleModelUuid);
+       
+        @SuppressWarnings("unchecked")
+        List<VfModuleToHeatFiles> mapList = query.list();
+        if (mapList.isEmpty()) {
+            LOGGER.debug ("No heatFiles found for vfModuleModelUuid=" + vfModuleModelUuid);
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No heatfiles found for vfModule", "CatalogDB", "getHeatFilesForVfModule", null);
+            return null;
+        }
+        //Now the fun part - we have a list of the heat files we need to get - could clean this up with a join
+        heatFiles = new HashMap<String, HeatFiles>();
+        for (VfModuleToHeatFiles vmthf : mapList) {
+        	String heatFilesUuid = vmthf.getHeatFilesArtifactUuid();
+        	hql = "FROM HeatFiles where artifactUuid = :heatFilesUuidValue";
+        	query = getSession().createQuery(hql);
+        	query.setParameter("heatFilesUuidValue", heatFilesUuid);
+        	@SuppressWarnings("unchecked")
+        	List<HeatFiles> fileList = query.list();
+        	if (fileList.isEmpty()) {
+        		// Should this throw an exception??
+        		LOGGER.debug("Unable to find a HEAT_FILES entry at " + heatFilesUuid);
+                String errorString = "_ERROR|" + heatFilesUuid;
+        		// The receiving code needs to know to throw an exception for this - or ignore it.
+        		heatFiles.put(errorString, null);
+        	} else {
+        		// Should only ever have 1 result - add it to our Map
+        		LOGGER.debug("Retrieved " + fileList.size() + " heat file entry at " + heatFilesUuid);
+        		for (HeatFiles hf : fileList) {
+        			LOGGER.debug("Adding " + hf.getFileName() + "->" + hf.getFileBody());
+        			heatFiles.put(hf.getFileName(), hf);
+        		}
+        	}
+        }
+        if (heatFiles.isEmpty()) {
+            LOGGER.debug ("heatFiles is empty - just return null");
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. HeatFiles is empty", "CatalogDB", "getHeatFilesForVfModule", null);
+            return null;
+        }
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatFilesForVfModule", null);
+        return heatFiles;	
+    }
 
     /**
      * Get the heat template object based on asdc attributes
@@ -2285,6 +3469,7 @@
      *
      * @return The HeatTemplate
      */
+    @Deprecated // asdcResourceName is no longer in heatTeamplate
     public HeatTemplate getHeatTemplate (String templateName, String version, String asdcResourceName) {
 
         long startTime = System.currentTimeMillis ();
@@ -2313,6 +3498,7 @@
         return resultList.get (0);
     }
 
+
     /**
      * Save the Heat Template
      *
@@ -2322,29 +3508,75 @@
     public void saveHeatTemplate (HeatTemplate heat, Set <HeatTemplateParam> paramSet) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save Heat Template with name " + heat.getTemplateName());
+        LOGGER.debug ("Catalog database - save Heat Template with name " + heat.getTemplateName() + ", artifactUUID=" + heat.getArtifactUuid());
 
         heat.setParameters(null);
         try {
-            HeatTemplate heatTemp = this.getHeatTemplate (heat.getTemplateName (),
-                                                          heat.getVersion (),
-                                                          heat.getAsdcResourceName ());
+           // HeatTemplate heatTemp = this.getHeatTemplate (heat.getTemplateName (),
+           //                                               heat.getVersion ());
+            
+            HeatTemplate heatTemp = this.getHeatTemplateByArtifactUuidRegularQuery(heat.getArtifactUuid());
+            
             if (heatTemp == null) {
                 this.getSession ().save (heat);
 
                 if (paramSet != null) {
+                	StringBuilder sb = new StringBuilder("Parameters: ");
                     for (HeatTemplateParam param : paramSet) {
-                        param.setHeatTemplateId (heat.getId ());
+                        param.setHeatTemplateArtifactUuid(heat.getArtifactUuid());
+                        sb.append(param.getParamName() + ", ");
                     }
+                    LOGGER.debug(sb.toString());
                     heat.setParameters (paramSet);
-                    this.getSession ().merge (heat);
+                    try {
+                    	Session session = this.getSession();
+                    	if (!(session.isConnected() && session.isOpen())) {
+                    		LOGGER.debug("Initial session is not connected or open - get another");
+                    		session = this.getSession();
+                    	}
+                    	//session.merge(heat);
+                    	session.save(heat);
+                    } catch (HibernateException he1) {
+                    	LOGGER.debug("Hibernate Exception encountered on first attempt at save(heat) - try again..." + he1.getMessage());
+                    	LOGGER.debug(he1.getStackTrace().toString());
+                    	try {
+                    		Session session = this.getSession();
+                    		//session.merge(heat);
+                    		session.save(heat);
+                    	} catch (HibernateException he2) {
+                    		LOGGER.debug("Hibernate Exception encountered on second attempt at save(heat)" + he2.getMessage());
+                    		LOGGER.debug(he2.getStackTrace().toString());
+                    		throw he2;
+                    	} catch (Exception e2) {
+                    		LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage());
+                    		LOGGER.debug(e2.getStackTrace().toString());
+                    		throw e2;
+                    	}
+                    	
+                    } catch (Exception e1) {
+                    	LOGGER.debug("General Exception encountered on first attempt at save(heat) - try again..." + e1.getMessage());
+                    	LOGGER.debug(e1.getStackTrace().toString());
+                    	try {
+                    		Session session = this.getSession();
+                    		//session.merge(heat);
+                    		session.save(heat);
+                    	} catch (HibernateException he2) {
+                    		LOGGER.debug("General Exception encountered on second attempt at save(heat)" + he2.getMessage());
+                    		LOGGER.debug(he2.getStackTrace().toString());
+                    		throw he2;
+                    	} catch (Exception e2) {
+                    		LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage());
+                    		LOGGER.debug(e2.getStackTrace().toString());
+                    		throw e2;
+                    	}
+                    }
                 }
 
             } else {
-            	heat.setId(heatTemp.getId());
+            	heat.setArtifactUuid(heatTemp.getArtifactUuid());
             }
         } finally {
-        	heat.setParameters(paramSet);
+        	//heat.setParameters(paramSet);
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveHeatTemplate", null);
         }
     }
@@ -2357,6 +3589,7 @@
      * @param asdcResourceName the environment resource name
      * @return the heat environment from DB or null if not found
      */
+    @Deprecated
     public HeatEnvironment getHeatEnvironment (String name, String version, String asdcResourceName) {
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get Heat environment with name " + name
@@ -2395,6 +3628,50 @@
     }
 
     /**
+     * Retrieves a Heat environment from DB based on its unique key. 1707
+     *
+     * @param name the environment artifact name
+     * @param version the environment resource version
+     * @return the heat environment from DB or null if not found
+     */
+    public HeatEnvironment getHeatEnvironment (String artifactUuid, String version) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Heat environment with uuid " + artifactUuid
+                                      + " and version "
+                                      + version);
+
+        String hql = "FROM HeatEnvironment WHERE artifactUuid=:artifactUuid AND version=:version";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("artifactUuid", artifactUuid);
+        query.setParameter ("version", version);
+        HeatEnvironment env = null;
+        try {
+        	env = (HeatEnvironment) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: envName='" + artifactUuid + "', version='" + version);
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for artifactUUID=" + artifactUuid + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "non unique result for ArtifactUUID=" + artifactUuid);
+        	env = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: artifactUUID='" + artifactUuid + "', asdc_service_model_version='" + version + " " + he.getMessage() );
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for artifactUUID=" + artifactUuid + " and version=" + version , "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for artifactUUID=" + artifactUuid);
+        	env = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: artifactUUID='" + artifactUuid + "', asdc_service_model_version='" + version  + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for artifactUUID=" + artifactUuid + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for artifactUUID=" + artifactUuid);
+        	env = null;
+        	throw e;
+        }
+        if (env == null) {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getHeatTemplate", null);
+        } else {
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null);
+        }
+        return env;
+    }
+
+    /**
      * Save the HeatEnvironment
      *
      * @param env The Environment
@@ -2402,15 +3679,15 @@
     public void saveHeatEnvironment (HeatEnvironment env) {
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - save Heat environment with name "
-                                      + env.getEnvironment());
+                                      + env.getEnvironment() + " and ArtifactUUID " + env.getArtifactUuid());
         try {
-            HeatEnvironment dbEnv = getHeatEnvironment (env.getName (), env.getVersion (), env.getAsdcResourceName ());
+            HeatEnvironment dbEnv = getHeatEnvironment (env.getArtifactUuid(), env.getVersion ());
             if (dbEnv == null) {
 
                 this.getSession ().save (env);
 
             } else {
-            	env.setId(dbEnv.getId());
+            	env.setArtifactUuid(dbEnv.getArtifactUuid());
             }
 
         } finally {
@@ -2466,13 +3743,17 @@
 
     public void saveOrUpdateVnfResource (VnfResource vnfResource) {
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save VNF Resource with VNF type " + vnfResource.getVnfType ());
+        LOGGER.debug ("Catalog database - save VNF Resource with VNF type " + vnfResource.getModelName());
+        //LOGGER.debug(vnfResource.toString());
         try {
 
-            if (vnfResource.getId() != 0) {
-                this.getSession ().merge (vnfResource);
-            } else {
+        	VnfResource existing = this.getVnfResourceByModelUuid(vnfResource.getModelUuid());
+        	if (existing == null) {
+        		LOGGER.debug("No existing entry found - attempting to save...");
                 this.getSession ().save (vnfResource);
+        	} else {
+        		//LOGGER.debug("Existing vnf resource found!" + existing.toString());
+        		LOGGER.debug("Existing vnf resource found!");
             }
 
         } finally {
@@ -2480,9 +3761,47 @@
         }
     }
 
+    public boolean saveVnfResourceCustomization (VnfResourceCustomization vnfResourceCustomization) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save VNF Resource Customization with Name " + vnfResourceCustomization.getModelInstanceName());
+        try {
+        	LOGGER.debug(vnfResourceCustomization.toString());
+        } catch (Exception e) {
+        	LOGGER.debug("Unable to print VRC " + e.getMessage());
+        }
+        try {
+        		 // Check if NetworkResourceCustomzation record already exists.  If so, skip saving it.
+        		// List<NetworkResource> networkResourceList = getAllNetworksByNetworkModelCustomizationUuid(networkResourceCustomization.getModelCustomizationUuid());
+        		 // Do any matching customization records exist?
+        		// if(networkResourceList.size() == 0){
+         		        		 
+        			// networkResourceCustomization.setNetworkResourceModelUuid(networkResource.getModelUuid());
+        //	this.getSession().flush();
+        //	this.getSession().clear();
+        	
+        	VnfResourceCustomization existing = this.getVnfResourceCustomizationByModelCustomizationUuid(vnfResourceCustomization.getModelCustomizationUuid());
+        	
+        	if (existing == null) {
+        		LOGGER.debug("No existing entry found...attempting to save...");
+            		this.getSession ().save (vnfResourceCustomization);
+        		return true;
+        	}else {
+        		try {
+        			LOGGER.debug("Existing VRC entry found\n" + existing.toString());
+        		} catch (Exception e) {
+        			LOGGER.debug("Unable to print VRC2 " + e.getMessage());
+        		}
+        		return false;
+            	}
+        		         		 
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVnfResourceCustomization", null);
+        }
+    }
+    
     public void saveAllottedResourceCustomization (AllottedResourceCustomization resourceCustomization) {
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save Allotted Resource with Name " + resourceCustomization.getModelName());
+        LOGGER.debug ("Catalog database - save Allotted Resource with Name " + resourceCustomization.getModelInstanceName());
         try {
             List<AllottedResourceCustomization> allottedResourcesList = getAllAllottedResourcesByArModelCustomizationUuid(resourceCustomization.getModelCustomizationUuid());
 
@@ -2495,9 +3814,145 @@
         }
     }
 
+    public void saveAllottedResource (AllottedResource allottedResource) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save Allotted Resource with Name " + allottedResource.getModelName());
+        try { 
+        	AllottedResource existing = this.getAllottedResourceByModelUuid(allottedResource.getModelUuid());
+        	if (existing == null) {
+        		this.getSession ().save (allottedResource);
+        	} else {
+        		LOGGER.debug("Found existing allottedResource with this modelUuid - no need to save");
+        	}
+         
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateAllottedResourceCustomization", null);
+        }
+    }
+    
+    public void saveNetworkResource (NetworkResource networkResource) throws RecordNotFoundException {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save Network Resource with Network Name " + networkResource.getModelName());
+        try {
+        		 // Check if NetworkResourceCustomzation record already exists.  If so, skip saving it.
+        		// List<NetworkResource> networkResourceList = getAllNetworksByNetworkModelCustomizationUuid(networkResourceCustomization.getModelCustomizationUuid());
+        		 // Do any matching customization records exist?
+			if(getNetworkResourceByModelUuid(networkResource.getModelUUID()) == null){
+        			 this.getSession ().save(networkResource);
+			}
+  
+        
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNetworkResourceCustomization", null);
+        }
+    }
+    
+    public void saveToscaCsar (ToscaCsar toscaCsar) throws RecordNotFoundException {
+    	
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save Tosca Csar with Name " + toscaCsar.getName());
+        try {
+        	
+        	if(getToscaCsar(toscaCsar.getArtifactChecksum()) == null){
+        		this.getSession ().save (toscaCsar);
+        	}
+        	//if (toscaCsar.getArtifactUUID() != null) {
+        	//	this.getSession ().merge (toscaCsar);
+        	//} else {
+        	//	this.getSession ().save (toscaCsar);
+        	LOGGER.debug("Temporarily disabling saveToscaCsar pending further investigation 2017-06-02");
+        	//}
+        
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveToscaCsar", null);
+        }
+    }
+    
+
+    /**
+     * Return the newest version of a specific Tosca CSAR Record resource (queried by Name).
+     *
+     * @param ToscaCsar
+     * @return ToscaCsar object or null if none found
+     */
+    public ToscaCsar getToscaCsar (String artifactChecksum) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Tosca CSAR record with artifactChecksum " + artifactChecksum);
+
+        String hql = "FROM ToscaCsar WHERE artifactChecksum = :artifactChecksum";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("artifactChecksum", artifactChecksum);
+
+        @SuppressWarnings("unchecked")
+        List <ToscaCsar> resultList = query.list ();
+
+        // See if something came back. Name is unique, so
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Tosca Csar not found", "CatalogDB", "getToscaCsar", null);
+            return null;
+        }
+       // Collections.sort (resultList, new MavenLikeVersioningComparator ());
+       // Collections.reverse (resultList);
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getToscaCsar", null);
+        return resultList.get (0);
+    }
+
+    
+    public void saveTempNetworkHeatTemplateLookup (TempNetworkHeatTemplateLookup tempNetworkHeatTemplateLookup) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save TempNetworkHeatTemplateLookup with Network Model Name " + tempNetworkHeatTemplateLookup.getNetworkResourceModelName() +
+        		      " and Heat Template Artifact UUID " + tempNetworkHeatTemplateLookup.getHeatTemplateArtifactUuid());
+        try {
+                 this.getSession ().save (tempNetworkHeatTemplateLookup);
+      
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveTempNetworkHeatTemplateLookup", null); 
+        }
+    }
+    
+    public void saveVfModuleToHeatFiles (VfModuleToHeatFiles vfModuleToHeatFiles) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save VfModuleToHeatFiles with VF Module UUID " + vfModuleToHeatFiles.getVfModuleModelUuid() +
+        		      " and Heat Files Artifact UUID " + vfModuleToHeatFiles.getHeatFilesArtifactUuid());
+        try {
+        	
+                this.getSession ().save (vfModuleToHeatFiles);
+      
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVFModuleToHeatFiles", null); 
+        }
+    }
+    
+    public void saveVnfResourceToVfModuleCustomization(VnfResourceCustomization vnfResourceCustomizationUUID, VfModuleCustomization vfModuleCustomizationUUID) throws RecordNotFoundException {
+        long startTime = System.currentTimeMillis ();
+        VnfResCustomToVfModuleCustom vnfResCustomToVfModuleCustom = new VnfResCustomToVfModuleCustom();
+        
+        if(vnfResourceCustomizationUUID != null && vfModuleCustomizationUUID != null){
+        	vnfResCustomToVfModuleCustom.setVnfResourceCustModelCustomizationUuid(vnfResourceCustomizationUUID.getModelCustomizationUuid());
+        	vnfResCustomToVfModuleCustom.setVfModuleCustModelCustomizationUuid(vfModuleCustomizationUUID.getModelCustomizationUuid());
+        	String vnfId = vnfResourceCustomizationUUID.getModelCustomizationUuid();
+        	String vfId = vfModuleCustomizationUUID.getModelCustomizationUuid();
+        	LOGGER.debug ("Catalog database - save VnfResCustomToVfModuleCustom with vnf=" + vnfId + ", vf=" + vfId);
+        	try {
+        		VnfResCustomToVfModuleCustom existing = this.getVnfResCustomToVfModule(vnfId, vfId);
+        		if (existing == null) {
+        			LOGGER.debug("No existing entry found - will now try to save");
+        			this.getSession ().save (vnfResCustomToVfModuleCustom);
+        		} else {
+        			LOGGER.debug("Existing entry already found - no save needed");
+        		}
+        	} finally {
+        		LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVnfResourceToVfModuleCustomization", null);
+        	}
+        }
+    }
+    
     public void saveNetworkResourceCustomization (NetworkResourceCustomization networkResourceCustomization) throws RecordNotFoundException {
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save Network Resource Customization with Network Name " + networkResourceCustomization.getModelName());
+        LOGGER.debug ("Catalog database - save Network Resource Customization with Network Name " + networkResourceCustomization.getModelInstanceName());
         try {
             // Check if NetworkResourceCustomzation record already exists.  If so, skip saving it.
             List<NetworkResourceCustomization> networkResourceCustomizationList = getAllNetworksByNetworkModelCustomizationUuid(networkResourceCustomization.getModelCustomizationUuid());
@@ -2505,13 +3960,14 @@
             if(networkResourceCustomizationList.size() == 0){
 
                 // Retreive the record from the Network_Resource table associated to the Customization record based on ModelName
-                NetworkResource networkResource = getNetworkResource(networkResourceCustomization.getModelName());
+        		// ?? is it modelInstanceName with 1707?
+        		NetworkResource networkResource = getNetworkResource(networkResourceCustomization.getModelInstanceName());
 
                 if(networkResource == null){
-                    throw new RecordNotFoundException("No record found in NETWORK_RESOURCE table for model name " + networkResourceCustomization.getModelName());
+        			throw new RecordNotFoundException("No record found in NETWORK_RESOURCE table for model name " + networkResourceCustomization.getModelInstanceName());
                 }
 
-                networkResourceCustomization.setNetworkResourceId(networkResource.getId());
+        		networkResourceCustomization.setNetworkResourceModelUuid(networkResource.getModelUUID());
 
                 this.getSession ().save(networkResourceCustomization);
             }
@@ -2522,6 +3978,7 @@
         }
     }
 
+    @Deprecated  // table is gone - mapped to ServiceToResource
     public void saveServiceToNetworks (ServiceToNetworks serviceToNetworks) {
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - save to ServiceToNetworks table with NetworkModelCustomizationUUID of " + serviceToNetworks.getNetworkModelCustomizationUuid() + " and ServiceModelUUID of " + serviceToNetworks.getServiceModelUuid());
@@ -2533,6 +3990,22 @@
         }
     }
 
+    public void saveServiceToResourceCustomization(ServiceToResourceCustomization serviceToResource) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save to ServiceToResourceCustomization table with ServiceModelUuid of " + serviceToResource.getServiceModelUUID() + ", ResourceModelUUID of " + serviceToResource.getResourceModelCustomizationUUID() + " and model_type=" + serviceToResource.getModelType());
+        ServiceToResourceCustomization strc = this.getServiceToResourceCustomization(serviceToResource.getServiceModelUUID(), serviceToResource.getResourceModelCustomizationUUID(), serviceToResource.getModelType());
+        try {
+        	if (strc != null) {
+        		LOGGER.debug("**This ServiceToResourceCustomization record already exists - no need to save");
+        	} else {
+        	 this.getSession ().save(serviceToResource);
+        	}
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveServiceToResourceCustomization", null);
+        }
+    }
+    
+    @Deprecated // table is gone - mapped to ServiceToResourceCustomization
     public void saveServiceToAllottedResources (ServiceToAllottedResources serviceToAllottedResources) {
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - save to serviceToAllottedResources table with ARModelCustomizationUUID of " + serviceToAllottedResources.getArModelCustomizationUuid() + " and ServiceModelUUID of " + serviceToAllottedResources.getServiceModelUuid());
@@ -2546,11 +4019,11 @@
 
     public void saveService (Service service) {
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save Service with ServiceName/Version/serviceUUID(SERVICE_NAME_VERSION_ID)" + service.getServiceName()+"/"+service.getVersion()+"/"+service.getServiceNameVersionId());
+        LOGGER.debug ("Catalog database - save Service with ServiceName/Version/serviceUUID(SERVICE_NAME_VERSION_ID)" + service.getModelName()+"/"+service.getVersion()+"/"+service.getModelUUID());
         try {
             Service serviceInvariantDB = null;
             // Retrieve existing service record by nameVersionId
-            Service serviceDB = this.getServiceByUUID(service.getServiceNameVersionId());
+        	Service serviceDB = this.getServiceByModelUUID(service.getModelUUID());
             if (serviceDB == null) {
                 // Check to see if a record with the same modelInvariantId already exists.  This tells us that a previous version exists and we can copy its recipe Record for the new service record.
                 serviceInvariantDB = this.getServiceByInvariantUUID(service.getModelInvariantUUID());
@@ -2560,13 +4033,13 @@
 
             if(serviceInvariantDB != null){  // existing modelInvariantId was found.
                 // copy the recipe record with the matching invariant id.  We will duplicate this for the new service record
-                List<ServiceRecipe> serviceRecipes = getServiceRecipes(serviceInvariantDB.getId());
+            	List<ServiceRecipe> serviceRecipes = getServiceRecipes(serviceInvariantDB.getModelUUID());
 
                 if(serviceRecipes != null && serviceRecipes.size() > 0){
                     for(ServiceRecipe serviceRecipe : serviceRecipes){
                         if(serviceRecipe != null){
                             // Fetch the service record that we just added.  We do this so we can extract its Id column value, this will be the foreign key we use in the service recipe table.
-                            Service newService = this.getServiceByUUID(service.getServiceNameVersionId());
+            				Service newService = this.getServiceByModelUUID(service.getModelUUID());
                             // Create a new ServiceRecipe record based on the existing one we just copied from the DB.
                             ServiceRecipe newServiceRecipe = new ServiceRecipe();
                             newServiceRecipe.setAction(serviceRecipe.getAction());
@@ -2574,16 +4047,20 @@
                             newServiceRecipe.setOrchestrationUri(serviceRecipe.getOrchestrationUri());
                             newServiceRecipe.setRecipeTimeout(serviceRecipe.getRecipeTimeout());
                             newServiceRecipe.setServiceParamXSD(serviceRecipe.getServiceParamXSD());
-                            newServiceRecipe.setServiceId(newService.getId());
+            				newServiceRecipe.setServiceModelUUID(newService.getModelUUID());
                             newServiceRecipe.setVersion(serviceRecipe.getVersion());
+            				// Check recipe does not exist before inserting
+            				ServiceRecipe recipe = getServiceRecipeByModelUUID(newServiceRecipe.getServiceModelUUID(), newServiceRecipe.getAction());
                             // Save the new recipe record in the service_recipe table and associate it to the new service record that we just added.
+            				if(recipe == null){
                             this.getSession ().save (newServiceRecipe);
                         }
                     }
-                }
-
+            	}
+              }
             }
 
+               
         } finally {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateService", null);
         }
@@ -2591,26 +4068,118 @@
 
     public void saveOrUpdateVfModule (VfModule vfModule) {
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - save VNF Module with VF Model Name " + vfModule.getModelName());
+        LOGGER.debug ("Catalog database - save or update VF Module with VF Model Name " + vfModule.getModelName());
+        VfModule vfModuleInvariantDB = null;
         try {
-
-            if (vfModule.getId() != 0) {
-                this.getSession ().merge (vfModule);
-            } else {
+        	LOGGER.debug("heat template id = " + vfModule.getHeatTemplateArtifactUUId() + ", vol template id = "+ vfModule.getVolHeatTemplateArtifactUUId());
+        	LOGGER.debug(vfModule.toString());
+        } catch (Exception e) {
+        	LOGGER.debug("unable to print vfmodule " + e.getMessage());
+        }
+        try {
+        	VfModule existing = this.getVfModuleByModelUUID(vfModule.getModelUUID());
+        	if (existing == null) {
+        		// Check to see if a record with the same modelInvariantId already exists.  This tells us that a previous version exists and we can copy its recipe Record for the new service record.
+        		vfModuleInvariantDB = this.getVfModuleByModelInvariantUuid(vfModule.getModelInvariantUUID());
+        		LOGGER.debug("No existing entry found, attempting to save...");
                 this.getSession ().save (vfModule);
+        	} else {
+        		try {
+        			LOGGER.debug("Found an existing vf module!\n" + existing.toString());
+        		} catch (Exception e) {
+        			LOGGER.debug("unable to print vfmodule2 " + e.getMessage());
             }
+        	}
+        	
+            if(vfModuleInvariantDB != null){  // existing modelInvariantId was found.
+                // copy the recipe record with the matching invariant id.  We will duplicate this for the new service record             	
+             	List<VnfComponentsRecipe> vfRecipes = getVnfComponentRecipes(vfModuleInvariantDB.getModelUUID());
+
+             	
+             	if(vfRecipes != null && vfRecipes.size() > 0){
+             		for(VnfComponentsRecipe vfRecipe : vfRecipes){
+             			if(vfRecipe != null){
+             				// Fetch the service record that we just added.  We do this so we can extract its Id column value, this will be the foreign key we use in the service recipe table.
+             				VfModule newRecipe = this.getVfModuleByModelUUID(vfModule.getModelUUID());
+             				// Create a new ServiceRecipe record based on the existing one we just copied from the DB.
+             				VnfComponentsRecipe newVnfRecipe = new VnfComponentsRecipe();
+             				newVnfRecipe.setAction(vfRecipe.getAction());
+             				newVnfRecipe.setDescription(vfRecipe.getDescription());
+             				newVnfRecipe.setOrchestrationUri(vfRecipe.getOrchestrationUri());
+             				newVnfRecipe.setRecipeTimeout(vfRecipe.getRecipeTimeout());
+             				newVnfRecipe.setVnfComponentParamXSD(vfRecipe.getVnfComponentParamXSD());
+             				newVnfRecipe.setVfModuleModelUUId(newRecipe.getModelUUID());
+             				newVnfRecipe.setVersion(vfRecipe.getVersion());
+             				newVnfRecipe.setVnfComponentType(vfRecipe.getVnfComponentType());
+             				newVnfRecipe.setVnfType(vfRecipe.getVnfType());
+             				// Check recipe does not exist before inserting
+         //    				VnfComponentsRecipe recipe = getVnfComponentRecipes(newVnfRecipe.getVfModuleModelUUId());
+             				List<VnfComponentsRecipe> recipe = getVnfComponentRecipes(newVnfRecipe.getVfModuleModelUUId());
+             				// Save the new recipe record in the service_recipe table and associate it to the new service record that we just added.
+        //     				if(recipe == null){
+            					this.getSession ().save (newVnfRecipe);
+        //     				}
+             			}
+             		}
+             	}
+  
+             }
 
         } finally {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVfModule", null);
         }
     }
 
+    public void saveOrUpdateVfModuleCustomization (VfModuleCustomization vfModuleCustomization) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save VF Module Customization with VF Customization Model Name UUID " + vfModuleCustomization.getVfModuleModelUuid());
+        try {
+        	LOGGER.debug("env id = " + vfModuleCustomization.getHeatEnvironmentArtifactUuid() + ", vol Env=" + vfModuleCustomization.getVolEnvironmentArtifactUuid());
+        	LOGGER.debug(vfModuleCustomization.toString());
+        } catch (Exception e) {
+        	LOGGER.debug("unable to print vfmodulecust " + e.getMessage());
+        }
+        try {
+        	VfModuleCustomization existing = this.getVfModuleCustomizationByModelCustomizationId(vfModuleCustomization.getModelCustomizationUuid());
+        	if (existing == null) {
+        		LOGGER.debug("No existing entry found, attempting to save...");
+                this.getSession ().save (vfModuleCustomization);
+        	} else {
+        		try {
+        			LOGGER.debug("Found an existing vf module customization entry\n" + existing.toString());
+        		} catch (Exception e) {
+        			LOGGER.debug("unable to print vfmodulecust2 " + e.getMessage());
+            	}
+        	}
+      
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVfModuleCustomization", null); 
+        }
+    }
+
+    @Deprecated
     public HeatNestedTemplate getNestedHeatTemplate(int parentTemplateId, int childTemplateId) {
     	  long startTime = System.currentTimeMillis ();
           LOGGER.debug ("Catalog database - get nested Heat template with PerentId-Child Id "
                                         + parentTemplateId +"-"+childTemplateId);
           try {
               HeatNestedTemplate nestedTemplate = new HeatNestedTemplate ();
+//              nestedTemplate.setParentTemplateId (parentTemplateId);
+//              nestedTemplate.setChildTemplateId (childTemplateId);
+              
+              return (HeatNestedTemplate)session.get (HeatNestedTemplate.class,nestedTemplate);
+          } finally {
+              LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNestedHeatTemplate", null);
+          }
+    }
+    
+    // 1707 version
+    public HeatNestedTemplate getNestedHeatTemplate(String parentTemplateId, String childTemplateId) {
+  	  long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get nested Heat template with PerentId="
+                                      + parentTemplateId +", ChildId="+childTemplateId);
+        try {
+            HeatNestedTemplate nestedTemplate = new HeatNestedTemplate ();
               nestedTemplate.setParentTemplateId (parentTemplateId);
               nestedTemplate.setChildTemplateId (childTemplateId);
 
@@ -2620,7 +4189,9 @@
           }
     }
 
+    @Deprecated
     public void saveNestedHeatTemplate (int parentTemplateId, HeatTemplate childTemplate, String yamlFile) {
+    	/*
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - save nested Heat template with name "
                                       + childTemplate.getTemplateName ());
@@ -2637,8 +4208,31 @@
         } finally {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNestedHeatTemplate", null);
         }
+        */
+    }
+    
+    // 1707
+    public void saveNestedHeatTemplate (String parentTemplateId, HeatTemplate childTemplate, String yamlFile) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save nested Heat template with name "
+                                      + childTemplate.getTemplateName () + ",parentId=" + parentTemplateId + ",childId=" + childTemplate.getArtifactUuid() + ", providerResourceFile=" + yamlFile);
+        try {
+      
+	        saveHeatTemplate(childTemplate, childTemplate.getParameters());
+	        if (getNestedHeatTemplate(parentTemplateId,childTemplate.getArtifactUuid()) == null) { 
+	            HeatNestedTemplate nestedTemplate = new HeatNestedTemplate ();
+	            nestedTemplate.setParentTemplateId (parentTemplateId);
+	            nestedTemplate.setChildTemplateId (childTemplate.getArtifactUuid ());
+	            nestedTemplate.setProviderResourceFile (yamlFile);
+	            session.flush();
+	            session.save (nestedTemplate);
+        	}
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveNestedHeatTemplate", null);
+        }
     }
 
+    @Deprecated
     public HeatFiles getHeatFiles(int vnfResourceId,String fileName,String asdcResourceName, String version) {
     	  long startTime = System.currentTimeMillis ();
           LOGGER.debug ("Catalog database - getHeatFiles with name " + fileName
@@ -2665,14 +4259,17 @@
           	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version);
           	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for fileName=" + fileName + " and vnfResourceId=" + vnfResourceId + " and asdcResourceName=" + asdcResourceName + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for fileName=" + fileName);
           	heatFilesResult = null;
+          	throw nure;
           } catch (org.hibernate.HibernateException he) {
-          	LOGGER.debug("Hibernate Exception - while searching for: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version);
+          	LOGGER.debug("Hibernate Exception - while searching for: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version + " " + he.getMessage());
           	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for fileName=" + fileName + " and vnfResourceId=" + vnfResourceId + " and asdcResourceName=" + asdcResourceName + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for fileName=" + fileName);
           	heatFilesResult = null;
+          	throw he;
           } catch (Exception e) {
-          	LOGGER.debug("Generic Exception - while searching for: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version);
+          	LOGGER.debug("Generic Exception - while searching for: fileName='" + fileName + "', vnfResourceId='" + vnfResourceId + "' and asdcResourceName=" + asdcResourceName + " and version=" + version + " " + e.getMessage());
           	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for fileName=" + fileName + " and vnfResourceId=" + vnfResourceId + " and asdcResourceName=" + asdcResourceName + " and version=" + version, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for fileName=" + fileName);
           	heatFilesResult = null;
+          	throw e;
           }
 
           // See if something came back.
@@ -2685,12 +4282,53 @@
           return heatFilesResult;
     }
 
+    public HeatFiles getHeatFiles(String artifactUuid) {
+  	  long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - getHeatFiles with artifactUuid " + artifactUuid);
+
+        String hql = "FROM HeatFiles WHERE artifactUuid = :artifactUuid";
+        Query query = getSession ().createQuery (hql);
+        query.setParameter ("artifactUuid", artifactUuid);
+
+        @SuppressWarnings("unchecked")
+      
+        HeatFiles heatFilesResult = null;
+        try {
+      	  heatFilesResult = (HeatFiles) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: artifactUuid='" + artifactUuid );
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for artifactUuid=" + artifactUuid);
+        	heatFilesResult = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while searching for: artifactUuid='" + artifactUuid + " " + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for artifactUuid=" + artifactUuid);
+        	heatFilesResult = null;
+        	throw he;
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while searching for: artifactUuid='" + artifactUuid  + " " + e.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for artifactUuid=" + artifactUuid , "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for artifactUuid=" + artifactUuid);
+        	heatFilesResult = null;
+        	throw e;
+        } 
+        
+        // See if something came back.
+        if (heatFilesResult == null) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. HeatFiles not found", "CatalogDB", "getHeatFiles", null);
+            return null;
+        }
+        // Name + Version is unique, so should only be one element
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatFiles", null);
+        return heatFilesResult;
+  }
+    
     public void saveHeatFiles (HeatFiles childFile) {
     	 long startTime = System.currentTimeMillis ();
          LOGGER.debug ("Catalog database - save Heat File with name "
                                        + childFile.getFileName());
          try {
-             HeatFiles heatFiles = getHeatFiles (childFile.getVnfResourceId(), childFile.getFileName(), childFile.getAsdcResourceName (),childFile.getVersion());
+//             HeatFiles heatFiles = getHeatFiles (childFile.getVnfResourceId(), childFile.getFileName(), childFile.getAsdcResourceName (),childFile.getVersion());
+             HeatFiles heatFiles = getHeatFiles (childFile.getArtifactUuid());
              if (heatFiles == null) {
 
             	 // asdc_heat_files_save
@@ -2701,7 +4339,7 @@
             	    Based on following comment:
 					It must be childFile.setId instead of heatFiles.setId, we must return the ID if it exists in DB.
 				 */
-            	 childFile.setId(heatFiles.getId());
+            	 childFile.setArtifactUuid(heatFiles.getArtifactUuid());
              }
 
          } finally {
@@ -2709,7 +4347,9 @@
          }
     }
 
+    @Deprecated
     public void saveVfModuleToHeatFiles (int parentVfModuleId, HeatFiles childFile) {
+    	/*
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - save Heat File to VFmodule link "
                                       + childFile.getFileName());
@@ -2724,6 +4364,67 @@
         } finally {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVfModuleToHeatFiles", null);
         }
+        */
+    }
+    
+    public void saveVfModuleToHeatFiles (String parentVfModuleId, HeatFiles childFile) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save Heat File to VFmodule link "
+                                      + childFile.getFileName());
+        try {
+            saveHeatFiles (childFile);
+            VfModuleToHeatFiles checkExistingEntry = this.getVfModuleToHeatFilesEntry(parentVfModuleId, childFile.getArtifactUuid());
+            if (checkExistingEntry == null) {
+            	VfModuleToHeatFiles vfModuleToHeatFile = new VfModuleToHeatFiles ();
+	        	vfModuleToHeatFile.setVfModuleModelUuid(parentVfModuleId);
+	        	vfModuleToHeatFile.setHeatFilesArtifactUuid(childFile.getArtifactUuid());
+	        	session.flush();
+	        	session.save (vfModuleToHeatFile);
+            } else {
+            	LOGGER.debug("**Found existing VfModuleToHeatFiles entry for " + checkExistingEntry.toString());
+            	LOGGER.debug("No need to save...");
+            }
+          
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveVfModuleToHeatFiles", null);
+        }
+    }
+
+    /**
+     * Return a Network Resource that matches the Network Customization defined by given MODEL_CUSTOMIZATION_UUID
+     *
+     * @param networkType
+     * @param action
+     * @param serviceType
+     * @return NetworkRecipe object or null if none found
+     */
+    public NetworkResource getNetworkResourceByModelUuid(String modelUUID) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get network resource with modelUUID " + modelUUID);
+
+        try {
+            String hql =  "FROM NetworkResource WHERE modelUUID=:modelUUID";
+            Query query = getSession ().createQuery (hql);
+            query.setParameter (MODEL_UUID, modelUUID);
+
+            @SuppressWarnings("unchecked")
+            List <NetworkResource> resultList = query.list ();
+
+            if (resultList.isEmpty ()) {
+                return null;
+            }
+            
+            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            Collections.reverse (resultList);
+            
+            return resultList.get (0);
+        } catch (Exception e) {
+        	LOGGER.debug("Error trying to find Network Resource with " + modelUUID +", " + e.getMessage());
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceByModelUuid", null);
+        }
+        return null;
     }
 
 
@@ -2774,26 +4475,27 @@
         }
     }
 
+    
     /**
-     * Return a Network recipe that matches a given NETWORK_TYPE and ACTION
+     * Return a Network recipe that matches a given MODEL_NAME and ACTION
      *
-     * @param networkType
+     * @param modelName
      * @param action
      * @return NetworkRecipe object or null if none found
      */
-    public NetworkRecipe getNetworkRecipe (String networkType, String action) {
+    public NetworkRecipe getNetworkRecipe (String modelName, String action) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get network recipe with network type " + networkType
+        LOGGER.debug ("Catalog database - get network recipe with network model name " + modelName
                                       + " and action "
                                       + action
                                       );
 
         try {
-            String hql = "FROM NetworkRecipe WHERE networkType = :networkType AND action = :action";
+            String hql = "FROM NetworkRecipe WHERE modelName = :modelName AND action = :action";
 
             Query query = getSession ().createQuery (hql);
-            query.setParameter (NETWORK_TYPE, networkType);
+            query.setParameter (MODEL_NAME, modelName);
             query.setParameter (ACTION, action);
 
             @SuppressWarnings("unchecked")
@@ -2826,7 +4528,7 @@
         LOGGER.debug ("Catalog database - get network resource with modelCustomizationUuid " + modelCustomizationUuid);
 
         try {
-            String hql =  "select n FROM NetworkResource n, NetworkResourceCustomization c WHERE n.id=c.networkResourceId and c.modelCustomizationUuid = :modelCustomizationUuid";
+            String hql =  "select n FROM NetworkResource n, NetworkResourceCustomization c WHERE n.modelUUID=c.networkResourceModelUuid and c.modelCustomizationUuid = :modelCustomizationUuid";
             Query query = getSession ().createQuery (hql);
             query.setParameter (MODEL_CUSTOMIZATION_UUID, modelCustomizationUuid);
 
@@ -2841,9 +4543,12 @@
             Collections.reverse (resultList);
 
             return resultList.get (0);
+        } catch (Exception e) {
+        	LOGGER.debug("Error trying to find Network Resource with " + modelCustomizationUuid +", " + e.getMessage());
         } finally {
-            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceBySvcNtwkRsrc", null);
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceByModelCustUuid", null);
         }
+        return null;
     }
 
     /**
@@ -2908,12 +4613,12 @@
      * @param action
      * @return VnfComponentsRecipe object or null if none found
      */
-    public VnfComponentsRecipe getVnfComponentsRecipeByVfModuleId (String vfModuleId,
+    public VnfComponentsRecipe getVnfComponentsRecipeByVfModuleModelUUId (String vfModuleModelUUId,
                                                        String vnfComponentType,
                                                        String action) {
 
         long startTime = System.currentTimeMillis ();
-        LOGGER.debug ("Catalog database - get Vnf Component recipe with vfModuleId " + vfModuleId
+        LOGGER.debug ("Catalog database - get Vnf Component recipe with vfModuleModelUUId " + vfModuleModelUUId
                                       + " and component type "
                                       + vnfComponentType
                                       + " and action "
@@ -2921,10 +4626,10 @@
 
         try {
             String hql;
-            hql = "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND vnfComponentType = :vnfComponentType AND action = :action ";
+            hql = "FROM VnfComponentsRecipe WHERE vfModuleModelUUId = :vfModuleModelUUId AND vnfComponentType = :vnfComponentType AND action = :action ";
 
             Query query = getSession ().createQuery (hql);
-            query.setParameter (VF_MODULE_ID, vfModuleId);
+            query.setParameter (VF_MODULE_MODEL_UUID, vfModuleModelUUId);
             query.setParameter (VNF_COMPONENT_TYPE, vnfComponentType);
             query.setParameter (ACTION, action);
 
@@ -2939,9 +4644,36 @@
 
             return resultList.get (0);
         } finally {
-            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfComponentsRecipeByVfModuleId", null);
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfComponentsRecipeByVfModuleModelUUId", null);
         }
     }
+    
+    public List<VnfComponentsRecipe> getVnfComponentRecipes (String vfModuleModelUUId) {
+        
+        StringBuilder hql = null;
+    	
+       	hql = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleModelUUId = :vfModuleModelUUId");
+    	
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get Service recipe with vfModuleModelUUId " + vfModuleModelUUId);
+
+        Query query = getSession ().createQuery (hql.toString ());
+        query.setParameter ("vfModuleModelUUId", vfModuleModelUUId);
+        
+        @SuppressWarnings("unchecked")
+        List <VnfComponentsRecipe> resultList = query.list ();
+
+        if (resultList.isEmpty ()) {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service recipe not found", "CatalogDB", "getVfModuleRecipes", null);
+            return null;
+        }
+        
+        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        Collections.reverse (resultList);
+
+        LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleRecipes", null);
+        return resultList;
+    }
 
 
 
@@ -2954,11 +4686,11 @@
 
         try {
 
-            if (vnfComponentDb != null) {
-                this.getSession ().merge (vnfComponent);
-            } else {
+            //if (vnfComponentDb != null) {
+            //    this.getSession ().merge (vnfComponent);
+            //} else {
                 this.getSession ().save (vnfComponent);
-            }
+            //}
 
         } finally {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVnfComponent", null);
@@ -3000,6 +4732,154 @@
     }
 
     /**
+     * Return a VfModule record that matches a given MODEL_NAME
+     *
+     * @param modelName
+     * @return VfModule object or null if none found
+     */
+    public VfModule getVfModuleByModelUUID (String modelUUID) {
+
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - get vf module with modelUUID " + modelUUID);
+
+        try {
+            String hql;
+
+            hql = "FROM VfModule WHERE modelUUID = :modelUUID";
+
+            Query query = getSession ().createQuery (hql);
+            query.setParameter (MODEL_UUID, modelUUID);
+
+            @SuppressWarnings("unchecked")
+            List <VfModule> resultList = query.list ();
+
+            if (resultList.isEmpty ()) {
+                return null;
+            }
+            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            Collections.reverse (resultList);
+
+            return resultList.get (0);
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleByModelUUID", null);
+        }
+    }
+    
+    /**
+     * Return a Service recipe that matches a given service ModelUUID and action
+     * (modelUUID) and ACTION
+     *
+     * @param modelUUID
+     * @param action    
+     * @return ServiceRecipe object or null if none found
+     */
+    public ServiceRecipe getServiceRecipeByModelUUID(String modelUUID, String action) {                     
+
+        long startTime = System.currentTimeMillis();
+        LOGGER.debug("Catalog database - get Service recipe with modelUUID=" + modelUUID + " and action=" + action);
+
+        try {
+			String hql;
+			// based on the new SERVICE_RECIPE schema where SERVICE_MODEL_UUID == MODEL_UUID, a JOIN with the SERVICE table is no longer needed
+//			hql = "SELECT new ServiceRecipe(SR.id, SR.serviceModelUUID, SR.action, SR.description, " +
+//					"SR.orchestrationUri, SR.serviceParamXSD, case when SR.recipeTimeout is null then 0 else SR.recipeTimeout end, " +
+//					"case when SR.serviceTimeoutInterim is null then 0 else SR.serviceTimeoutInterim end, SR.created) " +
+//					"FROM Service as S RIGHT OUTER JOIN S.recipes SR " +
+//					"WHERE SR.serviceModelUUID = :modelUUID AND SR.action = :action";
+			hql = "FROM ServiceRecipe WHERE serviceModelUUID = :modelUUID AND action = :action";
+			Query query = getSession().createQuery(hql);
+			query.setParameter(MODEL_UUID, modelUUID);
+			query.setParameter(ACTION, action);
+
+			@SuppressWarnings("unchecked")
+			List<ServiceRecipe> recipeResultList = query.list();
+			if (recipeResultList.isEmpty()) {
+				LOGGER.debug("Catalog database - recipeResultList is null");
+				return null;
+			}
+			Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+			Collections.reverse(recipeResultList);
+			LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
+
+			return recipeResultList.get(0);
+        } finally {
+            LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipeByModelUUID", null);
+        }
+    }
+    
+    /**
+     * Return a Service recipe that matches a given SERVICE_NAME_VERSION_ID
+     * (MODEL_VERSION_ID) and ACTION
+     *
+     * @param modelVersionId
+     * @param action    
+     * @return ServiceRecipe object or null if none found
+     */
+    @Deprecated
+    public ServiceRecipe getServiceRecipe(String modelVersionId,
+                                       String action) {                     
+
+        long startTime = System.currentTimeMillis();
+        LOGGER.debug("Catalog database - get Service recipe with modeVersionId=" + modelVersionId
+                                      + " and action=" + action);
+
+        try {
+			String hql;
+			// Note: Even with the implementation of the HQL JOIN below, the code for the two separate
+			//       SELECTs will be retained/commented for now in the event some subsequent JOIN issue arises
+			// 1st query to get the Service record for the given SERVICE_NAME_VERSION_ID (MODEL_VERSION_ID)
+/*			hql = "FROM Service WHERE serviceNameVersionId = :serviceNameVersionId";
+			Query query = getSession().createQuery(hql);
+			query.setParameter(SERVICE_NAME_VERSION_ID, modelVersionId);
+
+			@SuppressWarnings("unchecked")
+			List<Service> serviceResultList = query.list();
+			if (serviceResultList.isEmpty()) {
+				LOGGER.debug("Catalog database - serviceResultList is null");
+				return null;
+			}
+			Collections.sort(serviceResultList, new MavenLikeVersioningComparator());
+			Collections.reverse(serviceResultList);
+			LOGGER.debug("Catalog database - serviceResultList contains " + serviceResultList.get(0).toString());
+
+			// 2nd query to get the ServiceRecipe record corresponding to the Service from the 1st query
+			hql = "FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID AND action = :action";
+			query = getSession().createQuery(hql);
+			// The SERVICE table 'id' field maps to the SERVICE_RECIPE table 'SERVICE_ID' field
+			query.setParameter(SERVICE_ID, serviceResultList.get(0).getId());
+			query.setParameter(ACTION, action);
+*/
+			// The following SELECT performs a JOIN across the SERVICE and SERVICE_RECIPE tables. It required a new
+			// CTR in the ServiceRecipe Class to populate that object (the other option was to parse the Object[]
+			// returned by createQuery() and manually populate the ServiceRecipe object). Two of the 'int' fields in the
+			// SERVICE_RECIPE DB schema (the timeouts) permit NULL values which required some additional code in the
+			// SELECT to generate a default of 0 (needed by the CTR) in the cases where the value is NULL.
+			hql = "SELECT new ServiceRecipe(SR.id, SR.serviceModelUUID, SR.action, SR.description, " +
+					"SR.orchestrationUri, SR.serviceParamXSD, case when SR.recipeTimeout is null then 0 else SR.recipeTimeout end, " +
+					"case when SR.serviceTimeoutInterim is null then 0 else SR.serviceTimeoutInterim end, SR.created) " +
+					"FROM Service as S RIGHT OUTER JOIN S.recipes SR " +
+					"WHERE SR.serviceModelUUID = S.id AND S.serviceNameVersionId = :serviceNameVersionId AND SR.action = :action";
+			Query query = getSession().createQuery(hql);
+			query.setParameter(MODEL_UUID, modelVersionId);
+			query.setParameter(ACTION, action);
+
+			@SuppressWarnings("unchecked")
+			List<ServiceRecipe> recipeResultList = query.list();
+			if (recipeResultList.isEmpty()) {
+				LOGGER.debug("Catalog database - recipeResultList is null");
+				return null;
+			}
+			Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+			Collections.reverse(recipeResultList);
+			LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
+
+			return recipeResultList.get(0);
+        } finally {
+            LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
+        }
+    }
+
+    /**
      * Return a Model recipe that matches a given MODEL_TYPE, MODEL_VERSION_ID, ACTION
      * Note: This method is not currently used but was retained in the event the
      *       architecture moves back to a MODEL/MODEL_RECIPE structure.
@@ -3074,10 +4954,118 @@
         long startTime = System.currentTimeMillis ();
         Session session = this.getSession ();
 
+        // Query query = session.createQuery (" from ActiveRequests ");
         Query query = session.createSQLQuery (" show tables ");
 
         List<?> list = query.list();
         LOGGER.debug("healthCheck CatalogDB - Successful");
         return true;
     }
+    
+    public < E > E executeQuerySingleRow(String hql, HashMap<String, String> variables, boolean retry) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug("Catalog database - executeQuery: " + hql + (retry ? ", retry=true" : ", retry=false"));
+        Query query = getSession().createQuery(hql);
+
+        StringBuffer sb = new StringBuffer();
+        if (variables != null) {
+        	for (String key : variables.keySet()) {
+        		sb.append(key + "=" + variables.get(key) + "\n");
+        		query.setParameter(key, variables.get(key));
+        	}
+        }
+        LOGGER.debug("Variables:\n" + sb.toString());
+
+        E theObject = null;
+        try {
+        	theObject = (E) query.uniqueResult ();
+        } catch (org.hibernate.NonUniqueResultException nure) {
+        	LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for " + hql, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for " + hql );
+        	theObject = null;
+        	throw nure;
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while performing " + hql + "; he message:" + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception while performing hql=" + hql, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for hql=" + hql);
+        	theObject = null;
+        	if (retry) {
+        		LOGGER.debug("***WILL RETRY***");
+        		return this.executeQuerySingleRow(hql, variables, false);
+        	} else {
+        		throw he;
+        	}
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while performing '" + hql + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception performing " + hql, "", "", MsoLogger.ErrorCode.DataError, "Generic exception performing " + hql);
+        	theObject = null;
+        	if (retry) {
+        		LOGGER.debug("***WILL RETRY***");
+        		return this.executeQuerySingleRow(hql, variables, false);
+        	} else {
+        		throw e;
+        	}
+        }
+
+        if (theObject == null) {
+        	LOGGER.debug("Returning null");
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "executeQuerySingleRow", null);
+        } else {
+        	LOGGER.debug("Returning an Object");
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "executeQuerySingleRow", null);
+        }
+        return theObject;
+    }
+    
+    public < E > List<E> executeQueryMultipleRows(String hql, HashMap<String, String> variables, boolean retry) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug("Catalog database - executeQuery: " + hql + (retry ? ", retry=true" : ", retry=false"));
+        Query query = getSession().createQuery(hql);
+
+        StringBuffer sb = new StringBuffer();
+        if (variables != null) {
+        	for (String key : variables.keySet()) {
+        		sb.append(key + "=" + variables.get(key) + "\n");
+        		query.setParameter(key, variables.get(key));
+        	}
+        }
+        LOGGER.debug("Variables:\n" + sb.toString());
+
+        List<E> theObjects = null;
+        try {
+        	theObjects = (List<E>) query.list ();
+        } catch (org.hibernate.HibernateException he) {
+        	LOGGER.debug("Hibernate Exception - while performing " + hql + "; he message:" + he.getMessage());
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception while performing hql=" + hql, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for hql=" + hql);
+        	theObjects = null;
+        	if (retry) {
+        		LOGGER.debug("***WILL RETRY***");
+        		return this.executeQuerySingleRow(hql, variables, false);
+        	} else {
+        		throw he;
+        	}
+        } catch (Exception e) {
+        	LOGGER.debug("Generic Exception - while performing '" + hql + "'");
+        	LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception performing " + hql, "", "", MsoLogger.ErrorCode.DataError, "Generic exception performing " + hql);
+        	theObjects = null;
+        	if (retry) {
+        		LOGGER.debug("***WILL RETRY***");
+        		return this.executeQuerySingleRow(hql, variables, false);
+        	} else {
+        		throw e;
+        	}
+        }
+
+        if (theObjects == null) {
+        	LOGGER.debug("Returning null");
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "executeQuerySingleRow", null);
+        } else {
+        	try {
+        		LOGGER.debug("Returning theObjects:" + theObjects.size());
+        	} catch (Exception e) {
+        		LOGGER.debug("Returning theObjects");
+        	}
+        	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "executeQuerySingleRow", null);
+        }
+        return theObjects;
+    }
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDbSessionFactoryManager.java
similarity index 93%
rename from mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java
rename to mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDbSessionFactoryManager.java
index c4069be..fab69c5 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/HibernateUtilsCatalogDb.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDbSessionFactoryManager.java
@@ -19,12 +19,12 @@
  */
 package org.openecomp.mso.db.catalog;
 
-import org.openecomp.mso.db.HibernateUtils;
+import org.openecomp.mso.db.AbstractSessionFactoryManager;
 import org.openecomp.mso.logger.MessageEnum;
 import org.openecomp.mso.logger.MsoLogger;
 import java.net.URL;
 
-public class HibernateUtilsCatalogDb extends HibernateUtils {
+public class CatalogDbSessionFactoryManager extends AbstractSessionFactoryManager {
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
 
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java
new file mode 100644
index 0000000..477b688
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class AllottedResource extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+	
+	private String modelUuid;
+	private String modelInvariantUuid;
+	private String modelVersion; 
+	private String modelName;
+	private String toscaNodeType;
+	private String subcategory;
+	private String description;
+	private Timestamp created;
+
+	public AllottedResource() {
+	}
+	
+	public String getModelUuid() {
+		return this.modelUuid;
+	}
+	public void setModelUuid(String modelUuid) {
+		this.modelUuid = modelUuid;
+	}
+	public String getModelInvariantUuid() {
+		return this.modelInvariantUuid;
+	}
+	public void setModelInvariantUuid(String modelInvariantUuid) {
+		this.modelInvariantUuid = modelInvariantUuid;
+	}
+	public String getModelVersion() {
+		return this.modelVersion;
+	}
+	public void setModelVersion(String modelVersion) {
+		this.modelVersion = modelVersion;
+	}
+	public String getModelName() {
+		return this.modelName;
+	}
+	public void setModelName(String modelName) {
+		this.modelName = modelName;
+	}
+	public String getToscaNodeType() {
+		return this.toscaNodeType;
+	}
+	public void setToscaNodeType(String toscaNodeType) {
+		this.toscaNodeType = toscaNodeType;
+	}	
+	public String getSubcategory() {
+		return this.subcategory;
+	}
+	public void setSubcategory(String subcategory) {
+		this.subcategory = subcategory;
+	}	
+	public String getDescription() {
+		return this.description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public Timestamp getCreated() {
+		return created;
+	}
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}	
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
index d7dd2ad..d9a36a1 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
@@ -19,20 +19,29 @@
  */
 package org.openecomp.mso.db.catalog.beans;
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+import org.openecomp.mso.db.catalog.beans.AllottedResource;
 
-public class AllottedResourceCustomization extends MavenLikeVersioning {
+public class AllottedResourceCustomization extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
 	private String modelCustomizationUuid;
-	private String modelUuid;
-	private String modelInvariantUuid;
-	private String modelVersion = null; // duplicate of version kept in parent class
-	private String modelName;
-	private String description;
+	private String arModelUuid;
 	private Timestamp created;
 	private String modelInstanceName;
+	private String providingServiceModelInvariantUuid;
+	private String targetNetworkRole;
+	private String nfFunction;
+	private String nfType;
+	private String nfRole;
+	private String nfNamingCode;
+	private Integer minInstances;
+	private Integer maxInstances;
+	private AllottedResource ar = null;
 
 	public AllottedResourceCustomization() {
 		super();
@@ -45,32 +54,11 @@
 		this.modelCustomizationUuid = modelCustomizationUuid;
 	}
 
-	public String getModelUuid() {
-		return this.modelUuid;
+	public String getArModelUuid() {
+		return this.arModelUuid;
 	}
-	public void setModelUuid(String modelUuid) {
-		this.modelUuid = modelUuid;
-	}
-
-	public String getModelInvariantUuid() {
-		return this.modelInvariantUuid;
-	}
-	public void setModelInvariantUuid(String modelInvariantUuid) {
-		this.modelInvariantUuid = modelInvariantUuid;
-	}
-
-	public String getModelName() {
-		return this.modelName;
-	}
-	public void setModelName(String modelName) {
-		this.modelName = modelName;
-	}
-
-	public String getDescription() {
-		return this.description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
+	public void setArModelUuid(String arModelUuid) {
+		this.arModelUuid = arModelUuid;
 	}
 
 	public Timestamp getCreated() {
@@ -86,38 +74,74 @@
 	public void setModelInstanceName(String modelInstanceName) {
 		this.modelInstanceName = modelInstanceName;
 	}
-	public String getModelVersion() {
-		return this.modelVersion;
+	public AllottedResource getAllottedResource() {
+		return this.ar;
 	}
-	public void setModelVersion(String modelVersion) {
-		this.modelVersion = modelVersion;
+	public void setAllottedResource(AllottedResource ar) {
+		this.ar = ar;
 	}
-
-	public String getModelInvariantId() { return "not yet implemented"; }
+	public String getProvidingServiceModelInvariantUuid() {
+		return this.providingServiceModelInvariantUuid;
+	}
+	public void setProvidingServiceModelInvariantUuid(String providingServiceModelInvariantUuid) {
+		this.providingServiceModelInvariantUuid = providingServiceModelInvariantUuid;
+	}
+	public String getTargetNetworkRole() {
+		return this.targetNetworkRole;
+	}
+	public void setTargetNetworkRole(String targetNetworkRole) {
+		this.targetNetworkRole = targetNetworkRole;
+	}
+	public String getNfFunction() {
+		return this.nfFunction;
+	}
+	public void setNfFunction(String nfFunction) {
+		this.nfFunction = nfFunction;
+	}
+	public String getNfType() {
+		return this.nfType;
+	}
+	public void setNfType(String nfType) {
+		this.nfType = nfType;
+	}
+	public String getNfRole() {
+		return this.nfRole;
+	}
+	public void setNfRole(String nfRole) {
+		this.nfRole = nfRole;
+	}
+	public String getNfNamingCode() {
+		return this.nfNamingCode;
+	}
+	public void setNfNamingCode(String nfNamingCode) {
+		this.nfNamingCode = nfNamingCode;
+	}
+	public Integer getMinInstances() {
+		return this.minInstances;
+	}
+	public void setMinInstances(Integer minInstances) {
+		this.minInstances = minInstances;
+	}
+	public Integer getMaxInstances() {
+		return this.maxInstances;
+	}
+	public void setMaxInstances(Integer maxInstances) {
+		this.maxInstances = maxInstances;
+	}
 
 	@Override
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
-		sb.append("modelName=");
-		sb.append(this.modelName);
-		sb.append(",modelVersion=");
-		sb.append(this.modelVersion);
-		sb.append(",version=");
-		sb.append(this.version);
-		sb.append(",modelUuid=");
-		sb.append(this.modelUuid);
-		sb.append(",modelInvariantUuid=");
-		sb.append(this.modelInvariantUuid);
-		sb.append(",modelCustomizationUuid=");
+		sb.append("modelCustomizationUuid=");
 		sb.append(this.modelCustomizationUuid);
 		sb.append(",modelInstanceName=");
 		sb.append(this.modelInstanceName);
-		sb.append(",description=");
-		sb.append(this.description);
 		sb.append(",modelInstanceName=");
 		sb.append(this.modelInstanceName);
 		sb.append(",created=");
 		sb.append(this.created);
+		sb.append(",ar=");
+		sb.append(this.ar);
 
 		return sb.toString();
 	}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
index a920375..b7275f1 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java
@@ -20,47 +20,37 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class HeatEnvironment extends MavenLikeVersioning {
-	private int id;
+public class HeatEnvironment extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+
+	private String artifactUuid;
 	private String name = null;
 	private String description = null;
 	private String environment = null;
-
-	private String asdcUuid;
-	private String asdcResourceName;
-	private String asdcLabel;
 	private String artifactChecksum;
 
 	private Timestamp created;
 
 	public HeatEnvironment() {}
 
-	public int getId() {
-		return this.id;
+	public String getArtifactUuid() {
+		return this.artifactUuid;
+	}
+	public void setArtifactUuid(String artifactUuid) {
+		this.artifactUuid = artifactUuid;
 	}
 
-	public void setId(int id) {
-		this.id = id;
-	}
-
-
-    /**
-     * @return the name
-     */
     public String getName () {
         return name;
     }
 
-
-    /**
-     * @param name the name to set
-     */
     public void setName (String name) {
         this.name = name;
     }
@@ -79,20 +69,6 @@
 		this.environment = environment;
 	}
 
-	public String getAsdcUuid() {
-		return asdcUuid;
-	}
-
-	public void setAsdcUuid(String asdcUuid) {
-		this.asdcUuid = asdcUuid;
-	}
-	public String getAsdcLabel() {
-		return this.asdcLabel;
-	}
-	public void setAsdcLabel(String asdcLabel) {
-		this.asdcLabel = asdcLabel;
-	}
-
 	public String getArtifactChecksum() {
 		return artifactChecksum;
 	}
@@ -101,21 +77,6 @@
 		this.artifactChecksum = artifactChecksum;
 	}
 
-	/**
-     * @return the asdcResourceName
-     */
-    public String getAsdcResourceName () {
-        return asdcResourceName;
-    }
-
-
-    /**
-     * @param asdcResourceName the asdcResourceName to set
-     */
-    public void setAsdcResourceName (String asdcResourceName) {
-        this.asdcResourceName = asdcResourceName;
-    }
-
 	public Timestamp getCreated() {
 		return created;
 	}
@@ -127,22 +88,18 @@
     @Override
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
-		sb.append ("ID=" + this.id);
+		sb.append ("Artifact UUID=" + this.artifactUuid);
         sb.append (", name=");
         sb.append (name);
         sb.append (", version=");
         sb.append (version);
         sb.append(", description=");
-        sb.append (description == null ? "null" : description);
-        sb.append(", environment=");
-        sb.append (environment == null ? "null" : environment);
-        sb.append(", asdcUuid=");
-        sb.append (asdcUuid == null ? "null" : asdcUuid);
-		sb.append (", asdcResourceName=");
-		sb.append (asdcResourceName == null ? "null" : asdcResourceName);
-		if (created != null) {
-	        sb.append (",created=");
-	        sb.append (DateFormat.getInstance().format(created));
+        sb.append (this.description == null ? "null" : this.description);
+        sb.append(", body=");
+        sb.append (this.environment == null ? "null" : this.environment);
+		if (this.created != null) {
+	        sb.append (",creationTimestamp=");
+	        sb.append (DateFormat.getInstance().format(this.created));
 	    }
 		return sb.toString();
 	}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
index d379c24..b85ff34 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java
@@ -20,32 +20,31 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class HeatFiles extends MavenLikeVersioning {
-	private int id;
+public class HeatFiles extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+
+	private String artifactUuid;
 	private String description = null;
 	private String fileName;
 	private String fileBody;
-	private int vnfResourceId;
 	private Timestamp created;
-	private String asdcUuid;
-	private String asdcLabel;
-    private String asdcResourceName;
+	private String version;
 	private String artifactChecksum;
 
 	public HeatFiles() {}
 
-	public int getId() {
-		return this.id;
+	public String getArtifactUuid() {
+		return this.artifactUuid;
 	}
-
-	public void setId(int id) {
-		this.id = id;
+	public void setArtifactUuid(String artifactUuid) {
+		this.artifactUuid = artifactUuid;
 	}
 
 	public String getDescription() {
@@ -69,13 +68,6 @@
 		this.fileBody = fileBody;
 	}
 
-	public int getVnfResourceId() {
-		return this.vnfResourceId;
-	}
-	public void setVnfResourceId(int vnfResourceId) {
-		this.vnfResourceId = vnfResourceId;
-	}
-
 	public Timestamp getCreated() {
 		return created;
 	}
@@ -85,29 +77,22 @@
 	}
 
 	public String getAsdcUuid() {
-		return this.asdcUuid;
+		return this.artifactUuid;
 	}
-	public void setAsdcUuid(String asdcUuid) {
-		this.asdcUuid = asdcUuid;
+	public void setAsdcUuid(String artifactUuid) {
+		this.artifactUuid = artifactUuid;
 	}
-	public String getAsdcLabel() {
-		return this.asdcLabel;
-	}
-	public void setAsdcLabel(String asdcLabel) {
-		this.asdcLabel = asdcLabel;
-	}
-	public String getAsdcResourceName() {
-		return asdcResourceName;
+	public String getVersion() {
+		return version;
 	}
 
-	public void setAsdcResourceName(String asdcResourceName) {
-		this.asdcResourceName = asdcResourceName;
+	public void setVersion(String version) {
+		this.version = version;
 	}
 
 	public String getArtifactChecksum() {
 		return artifactChecksum;
 	}
-
 	public void setArtifactChecksum(String artifactChecksum) {
 		this.artifactChecksum = artifactChecksum;
 	}
@@ -115,7 +100,7 @@
 	@Override
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
-		sb.append ("ID=" + this.id);
+		sb.append ("artifactUuid=" + this.artifactUuid);
 		if (this.description == null) {
 			sb.append(", description=null");
 		} else {
@@ -131,16 +116,11 @@
 		} else {
 			sb.append(",fileBody=" + this.fileBody);
 		}
-		if (this.asdcResourceName == null) {
-			sb.append(", asdcResourceName=null");
-		} else {
-			sb.append(",asdcResourceName=" + this.asdcResourceName);
-		}
+		sb.append(", artifactChecksum=" + this.artifactChecksum);
 		if (created != null) {
 	        sb.append (",created=");
 	        sb.append (DateFormat.getInstance().format(created));
 	    }
-		sb.append(", vnfResourceId=" + this.vnfResourceId);
 		return sb.toString();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java
index eabbacf..5bdf21b 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java
@@ -25,8 +25,8 @@
 
 public class HeatNestedTemplate implements Serializable {
 
-    private int parentTemplateId;
-    private int childTemplateId;
+    private String parentTemplateId;
+    private String childTemplateId;
     private String providerResourceFile;
     public static final long serialVersionUID = -1322322139926390329L;
 
@@ -34,19 +34,19 @@
         super ();
     }
 
-    public void setParentTemplateId (int parentTemplateId) {
+    public void setParentTemplateId (String parentTemplateId) {
         this.parentTemplateId = parentTemplateId;
     }
 
-    public int getParentTemplateId () {
+    public String getParentTemplateId () {
         return this.parentTemplateId;
     }
 
-    public void setChildTemplateId (int childTemplateId) {
+    public void setChildTemplateId (String childTemplateId) {
         this.childTemplateId = childTemplateId;
     }
 
-    public int getChildTemplateId () {
+    public String getChildTemplateId () {
         return this.childTemplateId;
     }
 
@@ -91,7 +91,7 @@
         // hash code does not have to be a unique result - only that two objects that should be treated as equal
         // return the same value. so this should work.
         int result = 0;
-        result = this.parentTemplateId + this.childTemplateId;
+        result = this.parentTemplateId.hashCode() + this.childTemplateId.hashCode();
         return result;
     }
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
index 5762837..c045a7e 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java
@@ -20,32 +20,28 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
-import java.io.BufferedReader;
-import java.io.FileReader;
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
-import java.util.Date;
 import java.util.Set;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 import org.openecomp.mso.logger.MsoLogger;
 
-public class HeatTemplate extends MavenLikeVersioning {
+public class HeatTemplate extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
 
-    private int id;
+    private String artifactUuid;
     private String templateName;
-    private String templatePath = null;
     private String templateBody = null;
     private int timeoutMinutes;
     private Set <HeatTemplateParam> parameters;
     private Set <HeatNestedTemplate> files;
     private String description;
     private String asdcUuid;
-    private String asdcResourceName;
-    private String asdcLabel;
     private String artifactChecksum;
 
     private Timestamp created;
@@ -57,12 +53,12 @@
     public HeatTemplate () {
     }
 
-    public int getId () {
-        return id;
+    public String getArtifactUuid() {
+        return this.artifactUuid;
     }
 
-    public void setId (int id) {
-        this.id = id;
+    public void setArtifactUuid (String artifactUuid) {
+        this.artifactUuid = artifactUuid;
     }
 
     public String getTemplateName () {
@@ -73,14 +69,6 @@
         this.templateName = templateName;
     }
 
-    public String getTemplatePath () {
-        return templatePath;
-    }
-
-    public void setTemplatePath (String templatePath) {
-        this.templatePath = templatePath;
-    }
-
     public String getTemplateBody () {
         return templateBody;
     }
@@ -114,26 +102,7 @@
 	}
 
 	public String getHeatTemplate () {
-        if (templateBody != null && !templateBody.isEmpty ()) {
-            // The template body is in the DB table. Just return it.
-            return templateBody;
-        }
-
-        String body = null;
-
-        try (BufferedReader reader = new BufferedReader (new FileReader (templatePath)))
-        {
-            String line = null;
-            StringBuilder stringBuilder = new StringBuilder ();
-            while ((line = reader.readLine ()) != null) {
-                stringBuilder.append (line);
-            }
-            body = stringBuilder.toString ();
-        } catch (Exception e) {
-            LOGGER.debug ("Error reading template file " + templatePath, e);
-        }
-
-        return body;
+		return this.templateBody;
     }
 
     public void setFiles (Set <HeatNestedTemplate> files) {
@@ -152,20 +121,6 @@
 		this.asdcUuid = asdcUuidp;
 	}
 
-    public String getAsdcResourceName() {
-		return asdcResourceName;
-	}
-
-	public void setAsdcResourceName(String asdcResourceName) {
-		this.asdcResourceName = asdcResourceName;
-	}
-	public String getAsdcLabel() {
-		return this.asdcLabel;
-	}
-	public void setAsdcLabel(String asdcLabel) {
-		this.asdcLabel = asdcLabel;
-	}
-
     public String getArtifactChecksum() {
         return artifactChecksum;
     }
@@ -173,6 +128,7 @@
     public void setArtifactChecksum(String artifactChecksum) {
         this.artifactChecksum = artifactChecksum;
     }
+
     public Timestamp getCreated() {
 		return created;
 	}
@@ -189,16 +145,12 @@
           .append (templateName)
           .append (",version=")
           .append (version)
-          .append (",path=")
-          .append (templatePath)
           .append (",body=")
           .append (body)
           .append (",timeout=")
           .append (timeoutMinutes)
           .append (",asdcUuid=")
           .append (asdcUuid)
-          .append (",asdcResourceName=")
-          .append (asdcResourceName)
           .append (",description=")
           .append (description);
         if (created != null) {
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
new file mode 100644
index 0000000..c507b39
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+
+// an embeddable class to represent the Composite key for NetworkResource in the 1707 db refactoring
+public class HeatTemplateArtifactUuidModelUuid implements Serializable {
+	
+	private String heatTemplateArtifactUuid;
+	private String modelUuid;
+	public static final long serialVersionUID = -1322322139926390329L;
+
+	public HeatTemplateArtifactUuidModelUuid() {
+	}
+	
+	public String getHeatTemplateArtifactUuid() {
+		return this.heatTemplateArtifactUuid;
+	}
+	public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
+		this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
+	}
+	public String getModelUuid() {
+		return this.modelUuid;
+	}
+	public void setModelUuid(String modelUuid) {
+		this.modelUuid = modelUuid;
+	}
+	
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid);
+		sb.append(" modelUuid=" + this.modelUuid);
+		return sb.toString();
+	}
+	
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof HeatTemplateArtifactUuidModelUuid)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        HeatTemplateArtifactUuidModelUuid htaumu = (HeatTemplateArtifactUuidModelUuid) o;
+        if (htaumu.getHeatTemplateArtifactUuid().equals(this.getHeatTemplateArtifactUuid()) 
+        		&& htaumu.getModelUuid().equals(this.getModelUuid())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        // hash code does not have to be a unique result - only that two objects that should be treated as equal
+        // return the same value. so this should work.
+        int result = 0;
+        result = this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();
+        return result;
+    }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java
index 0d77a0a..939b0d1 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java
@@ -20,29 +20,26 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
+import java.io.Serializable;
 
-public class HeatTemplateParam {
-	private int id;
-	private int heatTemplateId;
+public class HeatTemplateParam implements Serializable {
+
+	private String heatTemplateArtifactUuid;
 	private String paramName;
 	private boolean required;
 	private String paramType;
 	private String paramAlias;
+    public static final long serialVersionUID = -1322322139926390329L;
 	
 	public HeatTemplateParam() {}
 	
-	public int getId() {
-		return id;
+	public String getHeatTemplateArtifactUuid() {
+		return this.heatTemplateArtifactUuid;
 	}
-	public void setId(int id) {
-		this.id = id;
+	public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
+		this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
 	}
-	public int getHeatTemplateId() {
-		return heatTemplateId;
-	}
-	public void setHeatTemplateId(int heatTemplateId) {
-		this.heatTemplateId = heatTemplateId;
-	}
+
 	public String getParamName() {
 		return paramName;
 	}
@@ -65,7 +62,6 @@
 	public String getParamType() {
 	    return paramType;
 	}
-	
 	public void setParamType (String paramType) {
 	    this.paramType = paramType;
 	}
@@ -73,6 +69,28 @@
 	
 	@Override
 	public String toString () {
-		return "Param=" + paramName + ",type=" + paramType + ",required=" + required + ",paramAlias=" + paramAlias;
+		return "Param=" + paramName + ",type=" + paramType + ",required=" + required + ",paramAlias=" + paramAlias + ", heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid;
+	}
+	
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof HeatTemplateParam)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        HeatTemplateParam htp = (HeatTemplateParam) o;
+        if (htp.getHeatTemplateArtifactUuid().equals(this.heatTemplateArtifactUuid) && htp.getParamName().equalsIgnoreCase(this.paramName)) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        int result = 0;
+        result = this.paramName == null ? 0 : this.paramName.hashCode() + this.heatTemplateArtifactUuid == null ? 0 : this.heatTemplateArtifactUuid.hashCode();
+        return result;
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java
index 51153c9..45d812d 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java
@@ -20,13 +20,16 @@
 package org.openecomp.mso.db.catalog.beans;
 
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.util.Map;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+public class Model extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
-public class Model extends MavenLikeVersioning {
 	private int id;
 	private String modelCustomizationId;
 	private String modelCustomizationName;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
index 83fb773..4af501a 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
@@ -20,11 +20,15 @@
 package org.openecomp.mso.db.catalog.beans;
 
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class ModelRecipe extends MavenLikeVersioning {
+public class ModelRecipe extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+	
 	private int id;
 	private Integer modelId;
 	private String action;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
index 1cd3526..40612ad 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
@@ -21,16 +21,19 @@
 package org.openecomp.mso.db.catalog.beans;
 
 
-public class NetworkRecipe extends Recipe {
-	private String networkType;
+import java.io.Serializable;
+
+public class NetworkRecipe extends Recipe implements Serializable {
+	private static final long serialVersionUID = 768026109321305392L;
+	private String modelName;
 	private String networkParamXSD;
 	public NetworkRecipe() {}
 
-	public String getNetworkType() {
-		return networkType;
+	public String getModelName() {
+		return modelName;
 	}
-	public void setNetworkType(String networkType) {
-		this.networkType = networkType;
+	public void setModelName(String modelName) {
+		this.modelName = modelName;
 	}
 
 	public String getNetworkParamXSD() {
@@ -44,7 +47,7 @@
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
 		sb.append(super.toString());
-		sb.append (",networkType=" + networkType);
+		sb.append (",modelName=" + modelName);
 		sb.append (",networkParamXSD=" + networkParamXSD);
 		return sb.toString();
 	}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java
index be812fa..9dbdb92 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java
@@ -20,44 +20,35 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
-import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
-
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 
-public class NetworkResource extends MavenLikeVersioning {
-	private int id;
-	private String networkType;
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class NetworkResource extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+
 	private String orchestrationMode = null;
 	private String description = null;
-	private int templateId;
 	private String neutronNetworkType = null;
 	private String aicVersionMin = null;
 	private String aicVersionMax = null;
-	
+	private String modelName;
+	private String modelInvariantUUID;
+	private String modelVersion;
+	private String toscaNodeType;
 	private Timestamp created;
+	private String modelUUID;
+	private String heatTemplateArtifactUUID;
 	
 	public NetworkResource() {}
 	
-	public int getId() {
-		return id;
-	}
-	
-	public void setId(int id) {
-		this.id = id;
-	}
-	
-	public String getNetworkType() {
-		return networkType;
-	}
-	public void setNetworkType(String networkType) {
-		this.networkType = networkType;
-	}
-	
 	public String getOrchestrationMode() {
 		return orchestrationMode;
 	}
+	
 	public void setOrchestrationMode(String orchestrationMode) {
 		this.orchestrationMode = orchestrationMode;
 	}
@@ -69,14 +60,6 @@
 		this.description = description;
 	}
 	
-	public int getTemplateId () {
-		return templateId;
-	}
-	
-	public void setTemplateId (int templateId) {
-		this.templateId = templateId;
-	}
-	
 	public String getNeutronNetworkType() {
 		return neutronNetworkType;
 	}
@@ -109,31 +92,84 @@
 		this.aicVersionMax = aicVersionMax;
 	}
 
+	public String getModelName() {
+		return modelName;
+	}
+
+	public void setModelName(String modelName) {
+		this.modelName = modelName;
+	}
+
+	public String getModelInvariantUUID() {
+		return modelInvariantUUID;
+	}
+
+	public void setModelInvariantUUID(String modelInvariantUUID) {
+		this.modelInvariantUUID = modelInvariantUUID;
+	}
+
+	public String getToscaNodeType() {
+		return toscaNodeType;
+	}
+
+	public void setToscaNodeType(String toscaNodeType) {
+		this.toscaNodeType = toscaNodeType;
+	}
+
+	public String getModelUUID() {
+		return modelUUID;
+	}
+
+	public void setModelUUID(String modelUUID) {
+		this.modelUUID = modelUUID;
+	}
+
+	public String getHeatTemplateArtifactUUID() {
+		return heatTemplateArtifactUUID;
+	}
+
+	public void setHeatTemplateArtifactUUID(String heatTemplateArtifactUUID) {
+		this.heatTemplateArtifactUUID = heatTemplateArtifactUUID;
+	}
+
+	public String getModelVersion() {
+		return modelVersion;
+	}
+
+	public void setModelVersion(String modelVersion) {
+		this.modelVersion = modelVersion;
+	}
+
 	@Override
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
-		sb.append("NETWORK=");
-		sb.append(networkType);
-		sb.append(",version=");
-		sb.append(version);
+		sb.append("NETWORK Resource:");
+		sb.append("modelVersion=");
+		sb.append(modelVersion);
 		sb.append(",mode=");
 		sb.append(orchestrationMode);
-		sb.append(",template=");
-		sb.append(templateId);
 		sb.append(",neutronType=");
 		sb.append(neutronNetworkType);
 		sb.append(",aicVersionMin=");
 		sb.append(aicVersionMin);
 		sb.append(",aicVersionMax=");
 		sb.append(aicVersionMax);
-		
-		sb.append("id=");
-		sb.append(id);
+		sb.append(",modelName=");
+		sb.append(modelName);
+		sb.append(",modelInvariantUUID=");
+		sb.append(modelInvariantUUID);
+		sb.append(",toscaNodeType=");
+		sb.append(toscaNodeType);
+		sb.append(",modelUUID=");
+		sb.append(modelUUID);
+		sb.append(",heatTemplateArtifactUUID=");
+		sb.append(heatTemplateArtifactUUID);
 		
 		if (created != null) {
 	        sb.append (",created=");
 	        sb.append (DateFormat.getInstance().format(created));
 	    }
+		
 		return sb.toString();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
index dc8aaad..aa84aeb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
@@ -20,56 +20,28 @@
 package org.openecomp.mso.db.catalog.beans;
 
 import java.sql.Timestamp;
+import java.io.Serializable;
 
-import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+public class NetworkResourceCustomization implements Serializable{
 
-public class NetworkResourceCustomization extends MavenLikeVersioning{
-
-	private String modelCustomizationUuid;
-	private String modelName;
+	// modelCustomizationUuid and networkResourceModelUuid form a composite primary key
+	private String modelCustomizationUuid = null;
+	private String networkResourceModelUuid = null;
+	public static final long serialVersionUID = -1322322139926390329L;
 	private String modelInstanceName;
-	private String modelUuid;
-	private String modelVersion;
-	private String modelInvariantUuid;
-	private int networkResourceId = 0;
 	private Timestamp created;
+	private String networkTechnology;
+	private String networkType = null;
+	private String networkScope;
+	private String networkRole;
 
 	// These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with
 	private NetworkResource networkResource = null;
-	private String networkType = null;
 
 	public NetworkResourceCustomization() {
 		super();
 	}
 
-	public int getNetworkResourceId() {
-		return this.networkResourceId;
-	}
-	public void setNetworkResourceId(int networkResourceId) {
-		this.networkResourceId = networkResourceId;
-	}
-
-	public String getModelUuid() {
-		return this.modelUuid;
-	}
-	public void setModelUuid(String modelUuid) {
-		this.modelUuid = modelUuid;
-	}
-
-	public String getModelInvariantUuid() {
-		return this.modelInvariantUuid;
-	}
-	public void setModelInvariantUuid(String modelInvariantUuid) {
-		this.modelInvariantUuid = modelInvariantUuid;
-	}
-
-	public String getModelVersion() {
-		return this.modelVersion;
-	}
-	public void setModelVersion(String modelVersion) {
-		this.modelVersion = modelVersion;
-	}
-
 	public String getModelCustomizationUuid() {
 		return this.modelCustomizationUuid;
 	}
@@ -77,6 +49,13 @@
 		this.modelCustomizationUuid = modelCustomizationUuid;
 	}
 
+	public String getNetworkResourceModelUuid() {
+		return this.networkResourceModelUuid;
+	}
+	public void setNetworkResourceModelUuid(String networkResourceModelUuid) {
+		this.networkResourceModelUuid = networkResourceModelUuid;
+	}
+
 	public String getModelInstanceName() {
 		return  this.modelInstanceName;
 	}
@@ -84,13 +63,6 @@
 		this.modelInstanceName = modelInstanceName;
 	}
 
-	public String getModelName() {
-		return  this.modelName;
-	}
-	public void setModelName(String modelName) {
-		this.modelName = modelName;
-	}
-
 	public NetworkResource getNetworkResource() {
 		return this.networkResource;
 	}
@@ -107,35 +79,73 @@
 	public Timestamp getCreated() {
 		return this.created;
 	}
-	public void setCreated(Timestamp timestamp) {
+	public void setCreated(java.sql.Timestamp timestamp) {
 		this.created = timestamp;
 	}
 
-	public String getModelInvariantId() { return "not yet implemented"; }
+	public String getNetworkTechnology() {
+		return this.networkTechnology;
+	}
+	public void setNetworkTechnology(String networkTechnology) {
+		this.networkTechnology = networkTechnology;
+	}
+	public String getNetworkScope() {
+		return this.networkScope;
+	}
+	public void setNetworkScope(String networkScope) {
+		this.networkScope = networkScope;
+	}
+	public void setNetworkRole(String networkRole) {
+		this.networkRole = networkRole;
+	}
+	public String getNetworkRole() {
+		return this.networkRole;
+	}
 
 	@Override
 	public String toString () {
 		StringBuffer sb = new StringBuffer();
-		sb.append("modelName=");
-		sb.append(this.modelName);
-		sb.append("modelUuid=");
-		sb.append(this.modelUuid);
-		sb.append("modelUuid=");
-		sb.append(this.modelUuid);
-		sb.append("modelInvariantUuid=");
-		sb.append(this.modelInvariantUuid);
-		sb.append("modelVersion=");
-		sb.append(this.modelVersion);
 		sb.append("modelCustomizationUuid=");
 		sb.append(this.modelCustomizationUuid);
+		sb.append("networkResourceModelUuid=");
+		sb.append(this.networkResourceModelUuid);
 		sb.append("modelInstanceName=");
 		sb.append(this.modelInstanceName);
-		sb.append("networkResourceId=");
-		sb.append(this.networkResourceId);
 		sb.append("networkType=");
 		sb.append(this.networkType);
+		sb.append("networkTechnology=");
+		sb.append(this.networkTechnology);
+		sb.append("networkScope=");
+		sb.append(this.networkScope);
+		sb.append("networkRole=");
+		sb.append(this.networkRole);
 
 		return sb.toString();
 	}
 
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof NetworkResourceCustomization)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        NetworkResourceCustomization nrc = (NetworkResourceCustomization) o;
+        if (nrc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid()) 
+        		&& nrc.getNetworkResourceModelUuid().equals(this.getNetworkResourceModelUuid())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        // hash code does not have to be a unique result - only that two objects that should be treated as equal
+        // return the same value. so this should work.
+        int result = 0;
+        result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.networkResourceModelUuid != null ? this.networkResourceModelUuid.hashCode() : 0);
+        return result;
+    }
+
 }
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java
index b0a34e6..365cfb0 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java
@@ -21,12 +21,15 @@
 package org.openecomp.mso.db.catalog.beans;
 
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class Recipe extends MavenLikeVersioning {
+public class Recipe extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
     private int id;
     protected String action;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java
index 07fb355..1caa348 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java
@@ -20,40 +20,37 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
-
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.util.Map;
+import java.util.Set;
 
-public class Service extends MavenLikeVersioning {
-	private int id;
-	private String serviceName;
-	private String description;
-	private String httpMethod;
-	private String serviceNameVersionId;
-	private String serviceVersion;
-	private Map<String,ServiceRecipe> recipes;
+public class Service extends MavenLikeVersioning implements Serializable {
 	
+	private static final long serialVersionUID = 768026109321305392L;
+
+	private String modelName;
+	private String description;
+	private String modelUUID;
 	private String modelInvariantUUID;
 	private Timestamp created;
+	private String toscaCsarArtifactUUID;
+	private String modelVersion;
+	private String serviceType;
+	private String serviceRole;
+	private Map<String,ServiceRecipe> recipes;
+	private Set<ServiceToResourceCustomization> serviceResourceCustomizations;
 	
 	public Service() {}
 	
-	public int getId() {
-		return id;
+	public String getModelName() {
+		return modelName;
 	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	
-	public String getServiceName() {
-		return serviceName;
-	}
-	public void setServiceName(String serviceName) {
-		this.serviceName = serviceName;
+	public void setModelName(String modelName) {
+		this.modelName = modelName;
 	}
 	
 	public String getDescription() {
@@ -78,30 +75,14 @@
 		this.created = created;
 	}
 		
-	public String getHttpMethod() {
-		return httpMethod;
+	public String getModelUUID() {
+		return modelUUID;
 	}
 
-	public void setHttpMethod(String httpMethod) {
-		this.httpMethod = httpMethod;
+	public void setModelUUID(String modelUUID) {
+		this.modelUUID = modelUUID;
 	}
 
-	public String getServiceNameVersionId() {
-		return serviceNameVersionId;
-	}
-
-	public void setServiceNameVersionId(String serviceNameVersionId) {
-		this.serviceNameVersionId = serviceNameVersionId;
-	}
-
-	public String getServiceVersion() {
-		return serviceVersion;
-	}
-
-	public void setServiceVersion(String serviceVersion) {
-		this.serviceVersion = serviceVersion;
-	}
-	
 	public String getModelInvariantUUID() {
 		return modelInvariantUUID;
 	}
@@ -110,14 +91,59 @@
 		this.modelInvariantUUID = modelInvariantUUID;
 	}
 
+	public String getToscaCsarArtifactUUID() {
+		return toscaCsarArtifactUUID;
+	}
+
+	public void setToscaCsarArtifactUUID(String toscaCsarArtifactUUID) {
+		this.toscaCsarArtifactUUID = toscaCsarArtifactUUID;
+	}
+
+	public Set<ServiceToResourceCustomization> getServiceResourceCustomizations() {
+		return serviceResourceCustomizations;
+	}
+
+	public void setServiceResourceCustomizations(Set<ServiceToResourceCustomization> serviceResourceCustomizations) {
+		this.serviceResourceCustomizations = serviceResourceCustomizations;
+	}
+	
+	public String getModelVersion() {
+		return modelVersion;
+	}
+
+	public void setModelVersion(String modelVersion) {
+		this.modelVersion = modelVersion;
+	}
+
+	
+	public String getServiceType() {
+		return serviceType;
+	}
+
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+
+	public String getServiceRole() {
+		return serviceRole;
+	}
+
+	public void setServiceRole(String serviceRole) {
+		this.serviceRole = serviceRole;
+	}
+
 	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
-		sb.append("SERVICE: id=" + id + ",name=" + serviceName + ",version=" + version + ",description=" + description+",modelInvariantUUID="+modelInvariantUUID);
+		sb.append("SERVICE: name=" + modelName + ",modelVersion=" + modelVersion + ",description=" + description+",modelInvariantUUID="+modelInvariantUUID+",toscaCsarArtifactUUID="+toscaCsarArtifactUUID+",serviceType="+serviceType+",serviceRole="+serviceRole);
 		for (String recipeAction : recipes.keySet()) {
 			ServiceRecipe recipe = recipes.get(recipeAction);
 			sb.append ("\n" + recipe.toString());
 		}
+		
+		for(ServiceToResourceCustomization serviceResourceCustomization : serviceResourceCustomizations) {
+			sb.append("\n" + serviceResourceCustomization.toString());
+		}
 		if (created != null) {
 		        sb.append (",created=");
 		        sb.append (DateFormat.getInstance().format(created));
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
index 01369c4..81409b1 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
@@ -22,6 +22,7 @@
 import org.openecomp.mso.db.catalog.beans.Service;
 import org.openecomp.mso.db.catalog.beans.VnfResource;
 import org.openecomp.mso.db.catalog.beans.VfModule;
+import java.io.Serializable;
 import java.util.ArrayList;
 
 /*
@@ -29,12 +30,15 @@
  * VnfResource, 1-n VfModule, Network TBD
  */
 
-public class ServiceMacroHolder {
+public class ServiceMacroHolder implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
 	private Service service;
 	private ArrayList<VnfResource> vnfResources;
 	private ArrayList<NetworkResourceCustomization> networkResourceCustomizations;
 	private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations;
+	private ArrayList<VnfResourceCustomization> vnfResourceCustomizations;
 
 	public ServiceMacroHolder() {
 		super();
@@ -42,6 +46,7 @@
 		this.vnfResources = new ArrayList<VnfResource>();
 		this.networkResourceCustomizations = new ArrayList<NetworkResourceCustomization>();
 		this.allottedResourceCustomizations = new ArrayList<AllottedResourceCustomization>();
+		this.vnfResourceCustomizations = new ArrayList<VnfResourceCustomization>();
 	}
 	public ServiceMacroHolder(Service service) {
 		this();
@@ -72,6 +77,23 @@
 		}
 	}
 
+	public void setVnfResourceCustomizations(ArrayList<VnfResourceCustomization> vnfResourceCustomizations) {
+		this.vnfResourceCustomizations = vnfResourceCustomizations;
+	}
+	public ArrayList<VnfResourceCustomization> getVnfResourceCustomizations() {
+		return this.vnfResourceCustomizations;
+	}
+	public void addVnfResourceCustomizations(VnfResourceCustomization vrc) {
+		if (vrc != null) {
+			if (this.vnfResourceCustomizations != null) {
+				this.vnfResourceCustomizations.add(vrc);
+			} else {
+				this.vnfResourceCustomizations = new ArrayList<VnfResourceCustomization>();
+				this.vnfResourceCustomizations.add(vrc);
+			}
+		}
+	}
+	
 	public void setNetworkResourceCustomization(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) {
 		this.networkResourceCustomizations = networkResourceCustomizations;
 	}
@@ -110,6 +132,15 @@
 		} else {
 			sb.append("service: null");
 		}
+		if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) {
+			int i=0;
+			sb.append("VnfResources: ");
+			for (VnfResourceCustomization vrc : this.vnfResourceCustomizations) {
+				sb.append(", vnfResourceCustomization[" + i++ + "]:" + vrc.toString());
+			}
+		} else {
+			sb.append("none");
+		}
 		if (this.vnfResources != null && this.vnfResources.size() > 0) {
 			int i=0;
 			sb.append("VnfResources: ");
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
index cc203ff..763c304 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java
@@ -20,48 +20,47 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
-
-
-
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
-import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 import java.util.Date;
+
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 import org.openecomp.mso.logger.MsoLogger;
 
-public class ServiceRecipe extends MavenLikeVersioning {
+public class ServiceRecipe extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+	
 	private int id;
-	private int serviceId;
+	private String serviceModelUUID;
 	private String action;
 	private String description;
 	private String orchestrationUri;
 	private String serviceParamXSD;
 	private int recipeTimeout;
 	private Integer serviceTimeoutInterim;
-
 	private Timestamp created;
 
-
 	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
+	
 	// This 'default' CTR is now needed for backward compatibility since a new CTR was added below
 	public ServiceRecipe() {
 		super();
 	}
-
+	
 	// This CTR is needed by the HQL SELECT JOIN between the SERVICE and SERVICE_RECIPE tables
 	// in CatalogDatabase::getServiceRecipe()
-	public ServiceRecipe(int id, int serviceId, String action,
-						 String description, String orchestrationUri,
-						 String serviceParamXSD, int recipeTimeout,
-						 int serviceTimeoutInterim, Date created) {
+	public ServiceRecipe(int id, String serviceModelUUID, String action,
+			String description, String orchestrationUri,
+			String serviceParamXSD, int recipeTimeout,
+			int serviceTimeoutInterim, Date created) {
 		super();
-		LOGGER.debug("ServiceRecipe id=" + id + ", serviceId=" + serviceId + ", action=" + action + ", description=" + description +
+		LOGGER.debug("ServiceRecipe id=" + id + ", serviceModelUUID=" + serviceModelUUID + ", action=" + action + ", description=" + description +
 				", orchestrationUri=" + orchestrationUri + ", serviceParamXSD=" + serviceParamXSD +
 				", recipeTimeout=" + recipeTimeout + ", serviceTimeoutInterim=" + serviceTimeoutInterim + ", created=" + created);
 		this.id = id;
-		this.serviceId = serviceId;
+		this.serviceModelUUID = serviceModelUUID;
 		this.action = action;
 		this.description = description;
 		this.orchestrationUri = orchestrationUri;
@@ -79,11 +78,11 @@
 		this.id = id;
 	}
 
-	public int getServiceId() {
-		return serviceId;
+	public String getServiceModelUUID() {
+		return serviceModelUUID;
 	}
-	public void setServiceId(int serviceId) {
-		this.serviceId = serviceId;
+	public void setServiceModelUUID(String serviceModelUUID) {
+		this.serviceModelUUID = serviceModelUUID;
 	}
 
 	public String getAction() {
@@ -128,7 +127,7 @@
 	public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) {
 		this.serviceTimeoutInterim = serviceTimeoutInterim;
 	}
-
+	
 	public Timestamp getCreated() {
 		return created;
 	}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
index 1fc93be..1fb1f31 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
@@ -54,6 +54,31 @@
 	}
 
 	@Override
+	public boolean equals(Object o) {
+        if (!(o instanceof ServiceToAllottedResources)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        ServiceToAllottedResources star = (ServiceToAllottedResources) o;
+        if (star.getArModelCustomizationUuid().equals(this.getArModelCustomizationUuid())
+        		&& star.getServiceModelUuid().equals(this.getServiceModelUuid())) {
+            return true;
+        } 
+        return false;
+	}
+	
+	@Override 
+	public int hashCode() {
+		
+		int code = this.arModelCustomizationUuid == null ? 0 : this.arModelCustomizationUuid.hashCode();
+		code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode();
+		
+		return code;
+	}
+	
+	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
 		sb.append("serviceModelUuid=");
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
index 5ea171e..e1b2c7c 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
@@ -57,6 +57,31 @@
 	}
 
 	@Override
+	public boolean equals(Object o) {
+        if (!(o instanceof ServiceToNetworks)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        ServiceToNetworks stn = (ServiceToNetworks) o;
+        if (stn.getNetworkModelCustomizationUuid().equals(this.getNetworkModelCustomizationUuid())
+        		&& stn.getServiceModelUuid().equals(this.getServiceModelUuid())) {
+            return true;
+        } 
+        return false;
+	}
+	
+	@Override 
+	public int hashCode() {
+		
+		int code = this.networkModelCustomizationUuid == null ? 0 : this.networkModelCustomizationUuid.hashCode();
+		code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode();
+		
+		return code;
+	}
+	
+	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
 		sb.append("ServiceToNetworks mapping: ");
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java
new file mode 100644
index 0000000..bb3dfd5
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java
@@ -0,0 +1,110 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+
+public class ServiceToResourceCustomization implements Serializable {
+
+	private static final long serialVersionUID = 768026109321305392L;
+	
+	private String modelType;
+	private String serviceModelUUID;
+	private Timestamp created;
+	private String resourceModelCustomizationUUID;
+	
+	public ServiceToResourceCustomization() {}
+	
+	public String getServiceModelUUID() {
+		return serviceModelUUID;
+	}
+	
+	public void setServiceModelUUID(String serviceModelUUID) {
+		this.serviceModelUUID = serviceModelUUID;
+	}
+	
+	public String getModelType() {
+		return modelType;
+	}
+	
+	public void setModelType(String modelType) {
+		this.modelType = modelType;
+	}
+	
+	public Timestamp getCreated() {
+		return created;
+	}
+	
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}
+	
+	public String getResourceModelCustomizationUUID() {
+		return resourceModelCustomizationUUID;
+	}
+
+	public void setResourceModelCustomizationUUID(String resourceModelCustomizationUUID) {
+		this.resourceModelCustomizationUUID = resourceModelCustomizationUUID;
+	}
+	
+	@Override
+	public boolean equals(Object o) {
+        if (!(o instanceof ServiceToResourceCustomization)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        ServiceToResourceCustomization strc = (ServiceToResourceCustomization) o;
+        if (strc.getServiceModelUUID().equals(this.getServiceModelUUID()) 
+        		&& strc.getResourceModelCustomizationUUID().equals(this.getResourceModelCustomizationUUID())
+        		&& strc.getModelType().equals(this.getModelType())) {
+            return true;
+        }
+        return false;
+		
+	}
+	
+	@Override 
+	public int hashCode() {
+		
+		int code = this.modelType == null ? 0 : this.modelType.hashCode();
+		code += this.serviceModelUUID == null ? 0 : this.serviceModelUUID.hashCode();
+		code += this.resourceModelCustomizationUUID == null ? 0 : this.resourceModelCustomizationUUID.hashCode();
+		
+		return code;
+		
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("ServiceToResourceCustomization: modelType=" + modelType + ",serviceModelUUID=" + serviceModelUUID+",resourceModelCustomizationUUID="+resourceModelCustomizationUUID);
+		if (created != null) {
+		        sb.append (",created=");
+		        sb.append (DateFormat.getInstance().format(created));
+		}
+		return sb.toString();
+	}
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
new file mode 100644
index 0000000..1b534a2
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+
+public class TempNetworkHeatTemplateLookup implements Serializable {
+	
+	private String networkResourceModelName;
+	private String heatTemplateArtifactUuid;
+	private String aicVersionMin;
+	private String aicVersionMax;
+    public static final long serialVersionUID = -1322322139926390329L;
+
+	public TempNetworkHeatTemplateLookup() {
+		super();
+	}
+	
+	public String getNetworkResourceModelName() {
+		return this.networkResourceModelName;
+	}
+	public void setNetworkResourceModelName(String networkResourceModelName) {
+		this.networkResourceModelName = networkResourceModelName;
+	}
+	
+	public String getHeatTemplateArtifactUuid() {
+		return this.heatTemplateArtifactUuid;
+	}
+	public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
+		this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
+	}
+	public String getAicVersionMin() {
+		return this.aicVersionMin;
+	}
+	
+	public void setAicVersionMin(String aicVersionMin) {
+		this.aicVersionMin = aicVersionMin;
+	}
+	
+	public String getAicVersionMax() {
+		return this.aicVersionMax;
+	}
+	
+	public void setAicVersionMax(String aicVersionMax) {
+		this.aicVersionMax = aicVersionMax;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("NetworkResourceModelName=" + this.networkResourceModelName);
+		sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid);
+		sb.append("aicVersionMin=" + this.aicVersionMin);
+		sb.append("aicVersionMax=" + this.aicVersionMax);
+		return sb.toString();
+	}
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof TempNetworkHeatTemplateLookup)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        TempNetworkHeatTemplateLookup tnhtl = (TempNetworkHeatTemplateLookup) o;
+        if (tnhtl.getHeatTemplateArtifactUuid().equals(this.getHeatTemplateArtifactUuid()) && tnhtl.getNetworkResourceModelName().equals(this.getNetworkResourceModelName())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        // hash code does not have to be a unique result - only that two objects that should be treated as equal
+        // return the same value. so this should work.
+        int result = 0;
+        result = (this.networkResourceModelName != null ? this.networkResourceModelName.hashCode() : 0) + (this.heatTemplateArtifactUuid != null ? this.heatTemplateArtifactUuid.hashCode() : 0);
+        return result;
+    }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java
new file mode 100644
index 0000000..277025b
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.util.Set;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class ToscaCsar extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
+
+	private String artifactUUID;
+	private String name;
+	private String artifactChecksum;
+	private String url;
+	private String description;
+	private Timestamp created;
+	private Set<Service> services;
+	
+	public ToscaCsar() { }
+	
+	public String getArtifactUUID() {
+		return artifactUUID;
+	}
+	
+	public void setArtifactUUID(String artifactUUID) {
+		this.artifactUUID = artifactUUID;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	public String getArtifactChecksum() {
+		return artifactChecksum;
+	}
+	
+	public void setArtifactChecksum(String artifactChecksum) {
+		this.artifactChecksum = artifactChecksum;
+	}
+	
+	public String getUrl() {
+		return url;
+	}
+	
+	public void setUrl(String url) {
+		this.url = url;
+	}
+	
+	public String getDescription() {
+		return description;
+	}
+	
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	public Timestamp getCreated() {
+		return created;
+	}
+	
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}
+	
+	public Set<Service> getServices() {
+		return services;
+	}
+	
+	public void setServices(Set<Service> services) {
+		this.services = services;
+	}
+	
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("TOSCACSAR: artifactUUID=" + artifactUUID + ",name=" + name + ",version=" + version + ",description=" + description+",artifactChecksum="+artifactChecksum+",url="+url);
+		for (Service service : services) {
+			sb.append ("\n" + service.toString());
+		}
+		if (created != null) {
+		        sb.append (",created=");
+		        sb.append (DateFormat.getInstance().format(created));
+		}
+		return sb.toString();
+	}
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
index 2b13a45..40e2dac 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java
@@ -22,73 +22,55 @@
 
 
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class VfModule extends MavenLikeVersioning {
+public class VfModule extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
-	private int id;
-	private Integer vnfResourceId;
-	private String type;
+	private String modelInvariantUUID;
 	private String modelName;
-	private int isBase;
-	private Integer templateId;
-	private Integer environmentId;
-	private Integer volTemplateId;
-	private Integer volEnvironmentId;
+	private String modelVersion;
 	private String description;
-	private String asdcUuid;
+	private int isBase;
+	private String heatTemplateArtifactUUId;
+	private String volHeatTemplateArtifactUUId;
     private Timestamp created;
-    private String modelInvariantUuid;
-    private String modelVersion;
-	private String modelCustomizationUuid = null;
-	private Integer minInstances;
-	private Integer maxInstances;
-	private Integer initialCount;
-	private String label;
-	private String modelUuid;
+	private String modelUUID;
+	private String vnfResourceModelUUId;
 
     public VfModule() {
 		super();
 	}
 
-	public int getId(){
-		return this.id;
-	}
-	public void setId(int id) {
-		this.id = id;
+	public String getVnfResourceModelUUId() {
+		return this.vnfResourceModelUUId;
 	}
 
-	public Integer getVnfResourceId() {
-		return this.vnfResourceId;
-	}
-	public void setVnfResourceId(Integer vnfResourceId) {
-		this.vnfResourceId = vnfResourceId;
+	public void setVnfResourceModelUUId(String vnfResourceModelUUId) {
+		this.vnfResourceModelUUId = vnfResourceModelUUId;
 	}
 
 	public String getModelName() {
 		return this.modelName;
 	}
+	
 	public void setModelName(String modelName) {
 		this.modelName = modelName;
 	}
 
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
 	public int getIsBase() {
 		return this.isBase;
 	}
+	
 	public void setIsBase(int isBase) {
 		this.isBase = isBase;
 	}
+	
 	public boolean isBase() {
 		if (this.isBase == 0) {
 			return false;
@@ -97,49 +79,22 @@
 		}
 	}
 
-	public Integer getTemplateId() {
-		return this.templateId;
-	}
-	public void setTemplateId(Integer templateId) {
-		this.templateId = templateId;
+	public String getHeatTemplateArtifactUUId() {
+		return this.heatTemplateArtifactUUId;
 	}
 
-	public Integer getEnvironmentId() {
-		return this.environmentId;
-	}
-	public void setEnvironmentId(Integer environmentId) {
-		this.environmentId = environmentId;
-	}
-
-	public Integer getVolTemplateId() {
-		return this.volTemplateId;
-	}
-	public void setVolTemplateId(Integer volTemplateId) {
-		this.volTemplateId = volTemplateId;
-	}
-
-	public Integer getVolEnvironmentId() {
-		return this.volEnvironmentId;
-	}
-	public void setVolEnvironmentId(Integer volEnvironmentId) {
-		this.volEnvironmentId = volEnvironmentId;
+	public void setHeatTemplateArtifactUUId(String heatTemplateArtifactUUId) {
+		this.heatTemplateArtifactUUId = heatTemplateArtifactUUId;
 	}
 
 	public String getDescription() {
 		return this.description;
 	}
+	
 	public void setDescription(String description) {
 		this.description = description;
 	}
 
-	public String getAsdcUuid() {
-		return asdcUuid;
-	}
-
-	public void setAsdcUuid(String asdcUuidp) {
-		this.asdcUuid = asdcUuidp;
-	}
-
 	public Timestamp getCreated() {
 		return created;
 	}
@@ -147,111 +102,73 @@
 	public void setCreated(Timestamp created) {
 		this.created = created;
 	}
+	
 	public String getModelInvariantUuid() {
-		return this.modelInvariantUuid;
+		return this.modelInvariantUUID;
 	}
 	public void setModelInvariantUuid(String modelInvariantUuid) {
-		this.modelInvariantUuid = modelInvariantUuid;
+		this.modelInvariantUUID = modelInvariantUuid;
+	}
+	public String getModelInvariantUUID() {
+		return this.modelInvariantUUID;
+	}
+	public void setModelInvariantUUID(String modelInvariantUuid) {
+		this.modelInvariantUUID = modelInvariantUuid;
+	}
+	
+	public String getVolHeatTemplateArtifactUUId() {
+		return this.volHeatTemplateArtifactUUId;
+	}
+	
+	public void setVolHeatTemplateArtifactUUId(String volHeatTemplateArtifactUUId) {
+		this.volHeatTemplateArtifactUUId = volHeatTemplateArtifactUUId;
 	}
 
+    public String getModelUUID() {
+		return modelUUID;
+	}
+
+	public void setModelUUID(String modelUUID) {
+		this.modelUUID = modelUUID;
+	}
 
 	public String getModelVersion() {
-		return this.modelVersion;
-	}
-	public void setModelVersion(String modelVersion) {
-		this.modelVersion = modelVersion;
-	}
-	public String getModelCustomizationUuid() {
-		return this.modelCustomizationUuid;
-	}
-	public void setModelCustomizationUuid(String modelCustomizationUuid) {
-		this.modelCustomizationUuid = modelCustomizationUuid;
-	}
-	public Integer getMinInstances() {
-		return this.minInstances;
-	}
-	public void setMinInstances(Integer minInstances) {
-		this.minInstances = minInstances;
-	}
-	public Integer getMaxInstances() {
-		return this.maxInstances;
-	}
-	public void setMaxInstances(Integer maxInstances) {
-		this.maxInstances = maxInstances;
-	}
-	public Integer getInitialCount() {
-		return this.initialCount;
-	}
-	public void setInitialCount(Integer initialCount) {
-		this.initialCount = initialCount;
-	}
-	public String getLabel() {
-		return this.label;
-	}
-	public void setLabel(String label) {
-		this.label = label;
+		return modelVersion;
 	}
 
-	// Will be fixed pending finalizing of 1707 catalog db schema changes
-	public void setModelUuid(String modelUuid) {
-		this.modelUuid = modelUuid;
-	}
-	public String getModelUuid() {
-		return this.modelUuid;
-	}
-	public String getModelInvariantId() {
-		return this.modelInvariantUuid;
-	}
-	public String getVfModuleType() {
-		return this.type;
-	}
-	public String getVfModuleLabel() {
-		return this.label;
+	public void setModelVersion(String modelVersion) {
+		this.modelVersion = modelVersion;
 	}
 
 	@Override
 	public String toString () {
        StringBuffer buf = new StringBuffer();
 
-       buf.append("VF=");
-       buf.append(this.type);
-       buf.append(",modelName=");
+       buf.append("VFModule:");
+       buf.append("modelName=");
        buf.append(modelName);
-       buf.append(",version=");
-       buf.append(version);
-       buf.append(",id=");
-       buf.append(this.id);
-       buf.append(",vnfResourceId=");
-       buf.append(this.vnfResourceId);
-       buf.append(",templateId=");
-       buf.append(this.templateId);
-       buf.append(",envtId=");
-       buf.append(this.environmentId);
-       buf.append(",volTemplateId=");
-       buf.append(this.volTemplateId);
-       buf.append(",volEnvtId=");
-       buf.append(this.volEnvironmentId);
+       buf.append(",modelVersion=");
+       buf.append(modelVersion);
+       buf.append(",vnfResourceModelUUId=");
+       buf.append(this.vnfResourceModelUUId);
+       buf.append(",heatTemplateArtifactUUId=");
+       buf.append(this.heatTemplateArtifactUUId);
        buf.append(", description=");
        buf.append(this.description);
-       buf.append(",asdcUuid=");
-       buf.append(asdcUuid);
-       buf.append(",modelVersion=");
-       buf.append(this.modelVersion);
-       buf.append(",modelCustomizationUuid=");
-       buf.append(this.modelCustomizationUuid);
-       buf.append(",minInstances=");
-       buf.append(this.minInstances);
-       buf.append(",maxInstances=");
-       buf.append(this.maxInstances);
-       buf.append(",initialCount=");
-       buf.append(this.initialCount);
-       buf.append(",label=");
-       buf.append(this.label);
+       buf.append(",volHeatTemplateArtifactUUId=");
+       buf.append(this.volHeatTemplateArtifactUUId);
+       buf.append(",isBase=");
+       buf.append(this.isBase);
+       buf.append(",modelInvariantUUID=");
+       buf.append(this.modelInvariantUUID);
+       buf.append(",modelUUID=");
+       buf.append(this.modelUUID);
 
     	 if (this.created != null) {
     		 buf.append (",created=");
     		 buf.append (DateFormat.getInstance().format(this.created));
          }
+		 
     	return buf.toString();
     }
 
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
new file mode 100644
index 0000000..ed89802
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class VfModuleCustomization implements Serializable {
+	
+	private String modelCustomizationUuid;
+	private String vfModuleModelUuid;
+	private String label;
+    private Integer minInstances;
+    private Integer maxInstances;
+    private Integer initialCount;
+    private Integer availabilityZoneCount;
+    private String heatEnvironmentArtifactUuid;
+    private String volEnvironmentArtifactUuid;
+    private Timestamp created;
+    private VfModule vfModule;
+    public static final long serialVersionUID = -1322322139926390329L;
+
+	public VfModuleCustomization() {
+		super();
+	}
+	
+	public String getModelCustomizationUuid() {
+		return this.modelCustomizationUuid;
+	}
+	public void setModelCustomizationUuid(String modelCustomizationUuid) {
+		this.modelCustomizationUuid = modelCustomizationUuid;
+	}
+	public String getVfModuleModelUuid() {
+		return this.vfModuleModelUuid;
+	}
+	public void setVfModuleModelUuid(String vfModuleModelUuid) {
+		this.vfModuleModelUuid = vfModuleModelUuid;
+	}
+	public String getHeatEnvironmentArtifactUuid() {
+		return this.heatEnvironmentArtifactUuid;
+	}
+	public void setHeatEnvironmentArtifactUuid(String heatEnvironmentArtifactUuid) {
+		this.heatEnvironmentArtifactUuid = heatEnvironmentArtifactUuid;
+	}
+	public String getVolEnvironmentArtifactUuid() {
+		return this.volEnvironmentArtifactUuid;
+	}
+	public void setVolEnvironmentArtifactUuid(String volEnvironmentArtifactUuid) {
+		this.volEnvironmentArtifactUuid = volEnvironmentArtifactUuid;
+	}
+	
+	public Integer getMinInstances() {
+		return this.minInstances;
+	}
+	public void setMinInstances(Integer minInstances) {
+		this.minInstances = minInstances;
+	}
+	public Integer getMaxInstances() {
+		return this.maxInstances;
+	}
+	public void setMaxInstances(Integer maxInstances) {
+		this.maxInstances = maxInstances;
+	}
+	public Integer getInitialCount() {
+		return this.initialCount;
+	}
+	public void setInitialCount(Integer initialCount) {
+		this.initialCount = initialCount;
+	}
+	public Integer getAvailabilityZoneCount() {
+		return this.availabilityZoneCount;
+	}
+	public void setAvailabilityZoneCount(Integer availabilityZoneCount) {
+		this.availabilityZoneCount = availabilityZoneCount;
+	}
+	public Timestamp getCreated() {
+		return created;
+	}
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}
+	public String getLabel() {
+		return this.label;
+	}
+	public void setLabel(String label) {
+		this.label = label;
+	}
+	public VfModule getVfModule() {
+		return this.vfModule;
+	}
+	public void setVfModule(VfModule vfModule) {
+		this.vfModule = vfModule;
+	}
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("modelCustomizationUuid=" + this.modelCustomizationUuid);
+		sb.append("vfModuleModelUuid=" + this.vfModuleModelUuid);
+		sb.append("label=" + this.label);
+		sb.append("initalCount=" + this.initialCount);
+		sb.append("minInstances=" + this.minInstances);
+		sb.append("maxInstances=" + this.maxInstances);
+		sb.append("availabilityZoneCount=" + this.availabilityZoneCount);
+		sb.append("heatEnvironmentArtifactUuid=" + this.heatEnvironmentArtifactUuid);
+		sb.append("volEnvironmentArtifactUuid=" + this.volEnvironmentArtifactUuid);
+		sb.append("created=" + this.created);
+		return sb.toString();
+	}
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof VfModuleCustomization)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        VfModuleCustomization vfmc = (VfModuleCustomization) o;
+        if (vfmc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid()) && vfmc.getVfModuleModelUuid().equals(this.getVfModuleModelUuid())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        // hash code does not have to be a unique result - only that two objects that should be treated as equal
+        // return the same value. so this should work.
+        int result = 0;
+        result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.vfModuleModelUuid != null ? this.vfModuleModelUuid.hashCode() : 0);
+        return result;
+    }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
index b0b0075..fa26d78 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
@@ -26,58 +26,33 @@
 
 public class VfModuleToHeatFiles implements Serializable {
 	
-    private int vfModuleId;
-    private int heatFilesId;
+    private String vfModuleModelUuid;
+    private String heatFilesArtifactUuid;
     public static final long serialVersionUID = -1322322139926390329L;
 
 	public VfModuleToHeatFiles() {
 		super();
 	}
 	
-	public int getVfModuleId() {
-		return this.vfModuleId;
+	public String getVfModuleModelUuid() {
+		return this.vfModuleModelUuid;
 	}
-	public void setVfModuleId(int vfModuleId) {
-		this.vfModuleId = vfModuleId;
+	public void setVfModuleModelUuid(String vfModuleModelUuid) {
+		this.vfModuleModelUuid = vfModuleModelUuid;
 	}
-	
-	public int getHeatFilesId() {
-		return this.heatFilesId;
+	public String getHeatFilesArtifactUuid() {
+		return this.heatFilesArtifactUuid;
 	}
-	public void setHeatFilesId(int heatFilesId) {
-		this.heatFilesId = heatFilesId;
+	public void setHeatFilesArtifactUuid(String heatFilesArtifactUuid) {
+		this.heatFilesArtifactUuid = heatFilesArtifactUuid;
 	}
 	
     @Override
     public String toString () {
         StringBuilder sb = new StringBuilder ();
-        sb.append ("VF_MODULE_ID=" + this.vfModuleId);
-        sb.append (", HEAT_FILES_ID=" + this.heatFilesId);
+        sb.append ("vfModuleModelUuid=" + this.vfModuleModelUuid);
+        sb.append (", heatFilesArtifactUuid=" + this.heatFilesArtifactUuid);
         return sb.toString ();
     }
 
-    @Override
-    public boolean equals (Object o) {
-        if (!(o instanceof VfModuleToHeatFiles)) {
-            return false;
-        }
-        if (this == o) {
-            return true;
-        }
-        VfModuleToHeatFiles vmthf = (VfModuleToHeatFiles) o;
-        if (vmthf.getVfModuleId() == this.getVfModuleId() && vmthf.getVfModuleId() == this.getVfModuleId()) {
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode () {
-        // hash code does not have to be a unique result - only that two objects that should be treated as equal
-        // return the same value. so this should work.
-        int result = 0;
-        result = this.vfModuleId + this.heatFilesId;
-        return result;
-    }
-
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
index 547b2fc..92e63ae 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
@@ -20,13 +20,16 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
+import java.io.Serializable;
 
-public class VnfComponentsRecipe extends Recipe {
+public class VnfComponentsRecipe extends Recipe implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
 	private String vnfType;
 	private String vnfComponentParamXSD;
 	private String vnfComponentType;
-	private String vfModuleId; 
+	private String vfModuleModelUUId; 
 
 	public VnfComponentsRecipe() {}
 
@@ -51,12 +54,12 @@
 		this.vnfComponentType = vnfComponentType;
 	}
 	
-    public String getVfModuleId() {
-		return vfModuleId;
+    public String getVfModuleModelUUId() {
+		return vfModuleModelUUId;
 	}
 
-	public void setVfModuleId(String vfModuleId) {
-		this.vfModuleId = vfModuleId;
+	public void setVfModuleModelUUId(String vfModuleModelUUId) {
+		this.vfModuleModelUUId = vfModuleModelUUId;
 	}
 
 	@Override
@@ -66,7 +69,7 @@
 		sb.append (",vnfComponentParamXSD=" + vnfComponentParamXSD);
 		sb.append (",serviceType=" + getServiceType ());
 		sb.append (",vnfComponentType=" + getVnfComponentType ());
-		sb.append (",vfModuleId=" + getVfModuleId ());
+		sb.append (",vfModuleId=" + getVfModuleModelUUId());
 		return sb.toString();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
index 1f0cd0a..075b3ab 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
@@ -20,8 +20,11 @@
 
 package org.openecomp.mso.db.catalog.beans;
 
+import java.io.Serializable;
 
-public class VnfRecipe extends Recipe {
+public class VnfRecipe extends Recipe implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
 	private String vnfType;
 	private String vnfParamXSD;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
new file mode 100644
index 0000000..0317653
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class VnfResCustomToVfModuleCustom implements Serializable {
+	
+	private String vnfResourceCustModelCustomizationUuid;
+	private String vfModuleCustModelCustomizationUuid;
+	private Timestamp created;
+	
+    public static final long serialVersionUID = -1322322139926390329L;
+
+
+	public VnfResCustomToVfModuleCustom() {
+		super();
+	}
+	public String getVnfResourceCustModelCustomizationUuid() {
+		return this.vnfResourceCustModelCustomizationUuid;
+	}
+	public void setVnfResourceCustModelCustomizationUuid(String vnfResourceCustModelCustomizationUuid) {
+		this.vnfResourceCustModelCustomizationUuid = vnfResourceCustModelCustomizationUuid;
+	}
+	public String getVfModuleCustModelCustomizationUuid() {
+		return this.vfModuleCustModelCustomizationUuid;
+	}
+	public void setVfModuleCustModelCustomizationUuid(String vfModuleCustModelCustomizationUuid) {
+		this.vfModuleCustModelCustomizationUuid = vfModuleCustModelCustomizationUuid;
+	}
+	public Timestamp getCreated() {
+		return created;
+	}
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("vnfResourceCustModelCustomizationUuid=" + this.vnfResourceCustModelCustomizationUuid);
+		sb.append("vfModuleCustModelCustomizationUuid=" + this.vfModuleCustModelCustomizationUuid);
+		sb.append("created=" + this.created);
+		return sb.toString();
+	}
+    @Override
+    public boolean equals (Object o) {
+        if (!(o instanceof VnfResCustomToVfModuleCustom)) {
+            return false;
+        }
+        if (this == o) {
+            return true;
+        }
+        VnfResCustomToVfModuleCustom vrctvmc = (VnfResCustomToVfModuleCustom) o;
+        if (vrctvmc.getVnfResourceCustModelCustomizationUuid().equals(this.getVnfResourceCustModelCustomizationUuid()) && vrctvmc.getVfModuleCustModelCustomizationUuid().equals(this.getVfModuleCustModelCustomizationUuid())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode () {
+        // hash code does not have to be a unique result - only that two objects that should be treated as equal
+        // return the same value. so this should work.
+        int result = 0;
+        result = (this.vnfResourceCustModelCustomizationUuid != null ? this.vnfResourceCustModelCustomizationUuid.hashCode() : 0) + (this.vfModuleCustModelCustomizationUuid != null ? this.vfModuleCustModelCustomizationUuid.hashCode() : 0);
+        return result;
+    }
+
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
index fa54d00..6f8ca96 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
@@ -21,66 +21,37 @@
 package org.openecomp.mso.db.catalog.beans;
 
 
+import java.io.Serializable;
 import java.sql.Timestamp;
 import java.text.DateFormat;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.List;
 import java.util.ArrayList;
-import java.util.Map;
 
 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-public class VnfResource extends MavenLikeVersioning {
+public class VnfResource extends MavenLikeVersioning implements Serializable {
+	
+	private static final long serialVersionUID = 768026109321305392L;
 
-    private int id;
-    private String vnfType;
-
-    private String orchestrationMode = null;
-    private String description = null;
-    private Integer templateId;
-    private Integer environmentId = null;
-
-    private Map <String, HeatFiles> heatFiles;
-
-    private String asdcUuid;
-
+	private String modelUuid;
+	private String modelInvariantUuid;
+	private String modelName;
+    private String toscaNodeType;
+    private String description;
+    private String orchestrationMode;
+    private String aicVersionMin;
+    private String aicVersionMax;
+    private String heatTemplateArtifactUUId;
     private Timestamp created;
+    private String modelVersion;
+    private Set<VnfResourceCustomization> vnfResourceCustomizations;
+    private Set<VfModule> vfModules;
+    private List<VfModule> vfModuleList;
+    private List<VfModuleCustomization> vfModuleCustomizations;
 
-    private String aicVersionMin = null;
-    private String aicVersionMax = null;
-
-    private String modelInvariantUuid = null;
-    private String modelVersion = null;
-
-    private String modelCustomizationName = null;
-
-    private String modelName = null;
-    private String serviceModelInvariantUUID = null;
-	private String modelCustomizationUuid = null;
-
-	private String modelUuid = null;
-	private String modelInstanceName = null;
-
-	private ArrayList<VfModule> vfModules;
-
-    public VnfResource () {
-		super();
-		this.vfModules = new ArrayList<VfModule>();
-    }
-
-    public int getId () {
-        return id;
-    }
-
-    public void setId (int id) {
-        this.id = id;
-    }
-
-    public String getVnfType () {
-        return vnfType;
-    }
-
-    public void setVnfType (String vnfType) {
-        this.vnfType = vnfType;
-    }
+    public VnfResource () { }
 
     public String getOrchestrationMode () {
         return orchestrationMode;
@@ -98,36 +69,19 @@
         this.description = description;
     }
 
-    public Integer getTemplateId () {
-        return templateId;
+    public String getTemplateId () {
+        return heatTemplateArtifactUUId;
     }
 
-    public void setTemplateId (Integer templateId) {
-        this.templateId = templateId;
+    public void setTemplateId (String heatTemplateArtifactUUId) {
+        this.heatTemplateArtifactUUId = heatTemplateArtifactUUId;
+    }
+    public String getHeatTemplateArtifactUUId () {
+        return heatTemplateArtifactUUId;
     }
 
-    public Integer getEnvironmentId () {
-        return this.environmentId;
-    }
-
-    public void setEnvironmentId (Integer environmentId) {
-        this.environmentId = environmentId;
-    }
-
-    public Map <String, HeatFiles> getHeatFiles () {
-        return this.heatFiles;
-    }
-
-    public void setHeatFiles (Map <String, HeatFiles> heatFiles) {
-        this.heatFiles = heatFiles;
-    }
-
-	public String getAsdcUuid() {
-		return asdcUuid;
-	}
-
-	public void setAsdcUuid(String asdcUuidp) {
-		this.asdcUuid = asdcUuidp;
+    public void setHeatTemplateArtifactUUId (String heatTemplateArtifactUUId) {
+        this.heatTemplateArtifactUUId = heatTemplateArtifactUUId;
 	}
 
 	public Timestamp getCreated() {
@@ -162,21 +116,6 @@
 		this.modelInvariantUuid = modelInvariantUuid;
 	}
 
-	public String getModelVersion() {
-		return this.modelVersion;
-	}
-	public void setModelVersion(String modelVersion) {
-		this.modelVersion = modelVersion;
-	}
-
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-
 	public String getModelName() {
 		return modelName;
 	}
@@ -185,53 +124,86 @@
 		this.modelName = modelName;
 	}
 
-	public String getServiceModelInvariantUUID() {
-		return serviceModelInvariantUUID;
+	public String getModelUuid() {
+		return modelUuid;
 	}
 
-	public void setServiceModelInvariantUUID(String serviceModelInvariantUUID) {
-		this.serviceModelInvariantUUID = serviceModelInvariantUUID;
+	public void setModelUuid(String modelUuid) {
+		this.modelUuid = modelUuid;
 	}
 
-	public String getModelCustomizationUuid() {
-		return this.modelCustomizationUuid;
-	}
-	public void setModelCustomizationUuid(String modelCustomizationUuid) {
-		this.modelCustomizationUuid = modelCustomizationUuid;
+	public String getModelInvariantId() {
+		return this.modelInvariantUuid;
 	}
 
-	public ArrayList<VfModule> getVfModules() {
-		return this.vfModules;
+	public String getToscaNodeType() {
+		return toscaNodeType;
 	}
-	public void setVfModules(ArrayList<VfModule> vfModules) {
+
+	public void setToscaNodeType(String toscaNodeType) {
+		this.toscaNodeType = toscaNodeType;
+	}
+
+	public Set<VnfResourceCustomization> getVnfResourceCustomizations() {
+		return vnfResourceCustomizations;
+	}
+
+	public void setVnfResourceCustomizations(Set<VnfResourceCustomization> vnfResourceCustomizations) {
+		this.vnfResourceCustomizations = vnfResourceCustomizations;
+	}
+
+	public Set<VfModule> getVfModules() {
+		return vfModules;
+	}
+
+	public void setVfModules(Set<VfModule> vfModules) {
 		this.vfModules = vfModules;
 	}
+
+	public List<VfModuleCustomization> getVfModuleCustomizations() {
+		return this.vfModuleCustomizations == null ? new ArrayList<VfModuleCustomization>() : this.vfModuleCustomizations;
+	}
+	public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) {
+		this.vfModuleCustomizations = vfModuleCustomizations;
+	}
+	public void addVfModuleCustomization(VfModuleCustomization vfmc) {
+		if (vfmc != null) {
+			if (this.vfModuleCustomizations != null) {
+				this.vfModuleCustomizations.add(vfmc);
+			} else {
+				this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+				this.vfModuleCustomizations.add(vfmc);
+			}
+	}
+	}
+
 	public void addVfModule(VfModule vfm) {
 		if (vfm != null) {
 			if (this.vfModules != null) {
 				this.vfModules.add(vfm);
 			} else {
-				this.vfModules = new ArrayList<VfModule>();
+				this.vfModules = new HashSet<VfModule>();
 				this.vfModules.add(vfm);
 			}
 		}
 	}
+	public ArrayList<VfModule> getVfModuleList() {
+		if (this.vfModules == null || this.vfModules.size() < 1) {
+			return null;
+	}
+		ArrayList<VfModule> list = new ArrayList<VfModule>();
+		for (VfModule vfm : this.vfModules) {
+			list.add(vfm);
+	}
+		return list;
+	}
+	
+	public String getModelVersion() {
+		return modelVersion;
+	}
 
-	//Placeholders for now until new design is finalized:
-	public void setModelUuid(String modelUuid) {
-		this.modelUuid = modelUuid;
-	}
-	public String getModelUuid() {
-		return this.modelUuid;
-	}
-	public String getModelInvariantId() {
-		return this.modelInvariantUuid;
-	}
-	public void setModelInstanceName(String modelInstanceName) {
-		this.modelInstanceName = modelInstanceName;
-	}
-	public String getModelInstanceName() {
-		return this.modelInstanceName;
+	public void setModelVersion(String modelVersion) {
+		this.modelVersion = modelVersion;
 	}
 
 	@Override
@@ -239,17 +211,14 @@
 		StringBuffer buf = new StringBuffer();
 
 		buf.append("VNF=");
-		buf.append(vnfType);
-		buf.append(",version=");
-		buf.append(version);
+		buf.append(",modelVersion=");
+		buf.append(modelVersion);
 		buf.append(",mode=");
 		buf.append(orchestrationMode);
-		buf.append(",template=");
-		buf.append(templateId);
+		buf.append(",heatTemplateArtifactUUId=");
+		buf.append(heatTemplateArtifactUUId);
 		buf.append(",envtId=");
-		buf.append(environmentId);
 		buf.append(",asdcUuid=");
-		buf.append(asdcUuid);
 		buf.append(",aicVersionMin=");
 		buf.append(this.aicVersionMin);
 		buf.append(",aicVersionMax=");
@@ -257,28 +226,25 @@
         buf.append(",modelInvariantUuid=");
         buf.append(this.modelInvariantUuid);
         buf.append(",modelVersion=");
-        buf.append(this.modelVersion);
         buf.append(",modelCustomizationName=");
-        buf.append(this.modelCustomizationName);
         buf.append(",modelName=");
         buf.append(this.modelName);
         buf.append(",serviceModelInvariantUUID=");
-        buf.append(this.serviceModelInvariantUUID);
 		buf.append(",modelCustomizationUuid=");
-		buf.append(this.modelCustomizationUuid);
+        buf.append(",toscaNodeType=");
+        buf.append(toscaNodeType);
 
 		if (created != null) {
 			buf.append(",created=");
 			buf.append(DateFormat.getInstance().format(created));
 		}
-		if (this.vfModules != null && this.vfModules.size() > 0) {
-			buf.append("VfModules:");
-			int i=0;
-			for (VfModule vfm : this.vfModules) {
-				buf.append("vfModule[" + i++ + "]:" + vfm.toString());
+		
+		for(VnfResourceCustomization vrc : vnfResourceCustomizations) {
+			buf.append("/n" + vrc.toString());
 			}
-		} else {
-			buf.append("VfModules: NONE");
+		
+		for(VfModule vfm : vfModules) {
+			buf.append("/n" + vfm.toString());
 		}
 		return buf.toString();
     }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
index 2bc6b3e..9b835d4 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
@@ -19,27 +19,42 @@
  */
 package org.openecomp.mso.db.catalog.beans;
 
+import java.io.Serializable;
 import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
-public class VnfResourceCustomization {
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
 
-	private String modelCustomizationUuid;
+public class VnfResourceCustomization extends MavenLikeVersioning implements Serializable {
+
+	private static final long serialVersionUID = 768026109321305392L;
+	
+	private String modelCustomizationUuid = null;
 	private String modelInstanceName;
-	private Integer ecompHomed;
-	private String homingPolicy;
-	private Timestamp creationTimestamp;
-	private String vnfResourceModelUuid;
+	private Timestamp created;
+	private String vnfResourceModelUuid = null;
+	private String vnfResourceModelUUID;
 	private Integer minInstances;
 	private Integer maxInstances;
 	private Integer availabilityZoneMaxCount;
 	private VnfResource vnfResource;
+	private String nfFunction;
+	private String nfType;
+	private String nfRole;
+	private String nfNamingCode;
+    private List<VfModuleCustomization> vfModuleCustomizations;
+    private Set<ServiceToResourceCustomization> serviceResourceCustomizations;
 
 	public VnfResourceCustomization() {
 	}
 
+
 	public String getModelCustomizationUuid() {
-		return this.modelCustomizationUuid;
+		return modelCustomizationUuid;
 	}
+
 	public void setModelCustomizationUuid(String modelCustomizationUuid) {
 		this.modelCustomizationUuid = modelCustomizationUuid;
 	}
@@ -51,33 +66,25 @@
 		this.modelInstanceName = modelInstanceName;
 	}
 
-	public Integer getEcompHomed() {
-		return this.ecompHomed;
-	}
-	public void setEcompHomed(Integer ecompHomed) {
-		this.ecompHomed = ecompHomed;
-	}
-
-	public String getHomingPolicy() {
-		return this.homingPolicy;
-	}
-	public void setHomingPolicy(String homingPolicy) {
-		this.homingPolicy = homingPolicy;
-	}
-
 	public Timestamp getCreationTimestamp() {
-		return this.creationTimestamp;
+		return this.created;
 	}
-	public void setCreationTimestamp(Timestamp creationTimestamp) {
-		this.creationTimestamp = creationTimestamp;
+	public void setCreationTimestamp(Timestamp created) {
+		this.created = created;
 	}
 
 	public String getVnfResourceModelUuid() {
-		return this.vnfResourceModelUuid;
+		return this.vnfResourceModelUuid == null ? this.vnfResourceModelUUID : this.vnfResourceModelUuid;
 	}
 	public void setVnfResourceModelUuid(String vnfResourceModelUuid) {
 		this.vnfResourceModelUuid = vnfResourceModelUuid;
 	}
+	public String getVnfResourceModelUUID() {
+		return this.vnfResourceModelUUID;
+	}
+	public void setVnfResourceModelUUID(String vnfResourceModelUUID) {
+		this.vnfResourceModelUUID = vnfResourceModelUUID;
+	}
 	public Integer getMinInstances() {
 		return this.minInstances;
 	}
@@ -106,22 +113,87 @@
 		this.vnfResource = vnfResource;
 	}
 
+	public String getNfFunction() {
+		return nfFunction;
+	}
+
+	public void setNfFunction(String nfFunction) {
+		this.nfFunction = nfFunction;
+	}
+
+	public String getNfType() {
+		return nfType;
+	}
+
+	public void setNfType(String nfType) {
+		this.nfType = nfType;
+	}
+
+	public String getNfRole() {
+		return nfRole;
+	}
+
+	public void setNfRole(String nfRole) {
+		this.nfRole = nfRole;
+	}
+
+	public String getNfNamingCode() {
+		return nfNamingCode;
+	}
+
+	public void setNfNamingCode(String nfNamingCode) {
+		this.nfNamingCode = nfNamingCode;
+	}
+	public List<VfModuleCustomization> getVfModuleCustomizations() {
+		return this.vfModuleCustomizations;
+	}
+	public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) {
+		this.vfModuleCustomizations = vfModuleCustomizations;
+	}
+	public void addVfModuleCustomization(VfModuleCustomization vfmc) {
+		if (vfmc != null) {
+			if (this.vfModuleCustomizations != null) {
+				this.vfModuleCustomizations.add(vfmc);
+			} else {
+				this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+				this.vfModuleCustomizations.add(vfmc);
+			}
+		}
+	}
+	public Timestamp getCreated() {
+		return created;
+	}
+
+	public void setCreated(Timestamp created) {
+		this.created = created;
+	}
+
+	public Set<ServiceToResourceCustomization> getServiceResourceCustomizations() {
+		return serviceResourceCustomizations;
+	}
+
+	public void setServiceResourceCustomizations(
+			Set<ServiceToResourceCustomization> serviceResourceCustomizations) {
+		this.serviceResourceCustomizations = serviceResourceCustomizations;
+	}
+
 	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder("VnfResourceCustomization: ");
-		sb.append("ModelCustUuid=" + this.modelCustomizationUuid);
+		sb.append("ModelCustUuid=" + this.modelCustomizationUuid ); 
 		sb.append(", ModelInstanceName=" + this.modelInstanceName);
-		sb.append(", ecompHomed=" + this.ecompHomed);
-		sb.append(", homingPolicy=" + this.homingPolicy);
-		sb.append(", vnfResourceModelUuid=" + this.vnfResourceModelUuid);
-		sb.append(", creationTimestamp=" + this.creationTimestamp);
+		sb.append(", vnfResourceModelUuid=" + this.vnfResourceModelUUID); 
+		sb.append(", creationTimestamp=" + this.created); 
 		sb.append(", minInstances=" + this.minInstances);
 		sb.append(", maxInstances=" + this.maxInstances);
 		sb.append(", availabilityZoneMaxCount=" + this.availabilityZoneMaxCount);
-		sb.append(", vnfResource:\n" + this.vnfResource.toString());
+//		sb.append(", vnfResource:\n" + this.vnfResource == null ? "null" : this.vnfResource.toString());
+		sb.append(", nfFunction=" + this.nfFunction); 
+		sb.append(", nfType=" + this.nfType);
+		sb.append(", nfRole=" + this.nfRole);
+		sb.append(", nfNamingCode=" + this.nfNamingCode);
+		
 		return sb.toString();
 	}
 
-
-
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
index df1a1cb..d557938 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
@@ -51,7 +51,7 @@
 	 *
 	 */
 	public boolean isMoreRecentThan (String versionToCompare) {
-		if (versionToCompare == null || this.version == null) {
+		if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null || this.version.trim().equals("")) {
 			return false;
 		}
 		String [] currentVersionArray = this.version.split("\\.");
@@ -87,7 +87,7 @@
 	public boolean isTheSameVersion (String versionToCompare) {
 		if (versionToCompare == null && this.version == null) {
 			return true;
-		} else if (versionToCompare == null || this.version == null) {
+		} else if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null || this.version.trim().equals("")) {
 			return false;
 		}
 		String [] currentVersionArray = this.version.split("\\.");
diff --git a/mso-catalog-db/src/main/resources/AllottedResource.hbm.xml b/mso-catalog-db/src/main/resources/AllottedResource.hbm.xml
new file mode 100644
index 0000000..15fe12f
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/AllottedResource.hbm.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Generated Mar 29, 2017 4:25:31 PM by Hibernate Tools 3.4.0.CR1 -->
+<hibernate-mapping>
+    <class name="org.openecomp.mso.db.catalog.beans.AllottedResource" table="ALLOTTED_RESOURCE">
+        <id name="modelUuid" type="java.lang.String"  length="200">
+            <column name="MODEL_UUID" />
+            <generator class="assigned" />
+        </id>
+        <property name="modelInvariantUuid" type="java.lang.String" length="200" not-null="true">
+            <column name="MODEL_INVARIANT_UUID" />
+        </property>
+        <property name="modelVersion" type="java.lang.String" length="20" not-null="true">
+            <column name="MODEL_VERSION" />
+        </property>
+        <property name="modelName" type="java.lang.String" length="200" not-null="true">
+            <column name="MODEL_NAME" />
+        </property>
+        <property name="toscaNodeType" type="java.lang.String" length="200">
+            <column name="TOSCA_NODE_TYPE" />
+        </property>
+        <property name="subcategory" type="java.lang.String" length="200">
+            <column name="SUBCATEGORY" />
+        </property>
+        <property name="description" type="java.lang.String" length="1200">
+            <column name="DESCRIPTION" />
+        </property>
+        <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+		    <column name="CREATION_TIMESTAMP" not-null="true"/>
+		</property>
+    </class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml
index 2ca823f..7720a93 100644
--- a/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml
+++ b/mso-catalog-db/src/main/resources/AllottedResourceCustomization.hbm.xml
@@ -25,32 +25,41 @@
     <class name="org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization"
     table="ALLOTTED_RESOURCE_CUSTOMIZATION">
         <id name="modelCustomizationUuid" type="java.lang.String">
-            <column name="MODEL_CUSTOMIZATION_UUID" length="200" not-null="true"/>
+            <column name="MODEL_CUSTOMIZATION_UUID" length="200"/>
             <generator class="assigned" />
         </id>
-        <property name="version">
-            <column name="MODEL_VERSION" length="20" not-null="true"/>
+        <property name="modelInstanceName" type="java.lang.String" length="200" not-null="true">
+            <column name="MODEL_INSTANCE_NAME" />
         </property>
-        <property name="modelVersion" update="false" insert="false">
-            <column name="MODEL_VERSION" />
+        <property name="arModelUuid" type="java.lang.String" length="200" not-null="true">
+            <column name="AR_MODEL_UUID" />
         </property>
-        <property name="modelUuid" type="java.lang.String">
-            <column name="MODEL_UUID" length="200" not-null="true"/>
+        <property name="providingServiceModelInvariantUuid" type="java.lang.String" length="200">
+            <column name="PROVIDING_SERVICE_MODEL_INVARIANT_UUID" />
         </property>
-        <property name="modelName" type="java.lang.String">
-            <column name="MODEL_NAME" length="200" not-null="true"/>
+        <property name="targetNetworkRole" type="java.lang.String" length="200">
+            <column name="TARGET_NETWORK_ROLE" />
         </property>
-        <property name="modelInstanceName" type="java.lang.String">
-            <column name="MODEL_INSTANCE_NAME" length="200" not-null="true"/>
+        <property name="nfFunction" type="java.lang.String" length="200">
+            <column name="NF_FUNCTION" />
+        </property>
+        <property name="nfType" type="java.lang.String" length="200">
+            <column name="NF_TYPE" />
+        </property>
+        <property name="nfRole" type="java.lang.String" length="200">
+            <column name="NF_ROLE" />
+        </property>
+        <property name="nfNamingCode" type="java.lang.String" length="200">
+            <column name="NF_NAMING_CODE" />
+        </property>
+        <property name="minInstances" type="java.lang.Integer">
+            <column name="MIN_INSTANCES" />
+        </property>
+        <property name="maxInstances" type="java.lang.Integer">
+            <column name="MAX_INSTANCES" />
         </property>
         <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
 		    <column name="CREATION_TIMESTAMP" not-null="true"/>
 		</property>
-        <property name="description" type="java.lang.String">
-            <column name="DESCRIPTION" length="200" not-null="false" default="null"/>
-        </property>
-        <property name="modelInvariantUuid" type="java.lang.String">
-            <column name="MODEL_INVARIANT_UUID" length="200" not-null="true"/>
-        </property>
     </class>
 </hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml b/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
index 8e86c58..711b73a 100644
--- a/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
+++ b/mso-catalog-db/src/main/resources/HeatEnvironment.hbm.xml
@@ -27,35 +27,24 @@
 		<meta attribute="class-description">
 			This class describes a HEAT Environment
 		</meta>
-
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
+		<id name="artifactUuid" type="string" column="ARTIFACT_UUID" length="200">
+		    <generator class="assigned" />
 		</id>
-		<properties name="uk_heatenv" unique="true">
 			<property name="name" type="string" >
 			     <column name="NAME" length="100" not-null="true"/>
 			</property>
 			<property name="version" type="string" >
 			      <column name="VERSION" length="20" not-null="true"/>
 			</property>
-			<property name="asdcResourceName" type="string" >
-			      <column name="ASDC_RESOURCE_NAME" length="100" default="'MANUAL RECORD'" not-null="true"/>
-			</property>
-			<property name="asdcUuid" type="string">
-				<column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="true"/>
-			</property>
-		</properties>
 		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
 		<property name="environment" type="text">
-		      <column name="ENVIRONMENT" not-null="true"/>
+		      <column name="BODY" not-null="true"/>
 		</property>
 		<property name="created" type="timestamp" generated="insert" insert="false" update="false">
 		    <column name="CREATION_TIMESTAMP" not-null="true"/>
 		</property>
-		<property name="asdcLabel" column="ASDC_LABEL" type="string" length="200"/>
 		<property name="artifactChecksum" type="string">
-			<column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
+		  <column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="false"/>
 		</property>
-
     </class>
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml b/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml
new file mode 100644
index 0000000..252649c
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Generated Mar 31, 2017 3:39:01 PM by Hibernate Tools 3.4.0.CR1 -->
+<hibernate-mapping>
+    <class name="org.openecomp.mso.db.catalog.beans.HeatFiles" table="HEAT_FILES">
+        <id name="artifactUuid" type="java.lang.String" length="200">
+            <column name="ARTIFACT_UUID" />
+            <generator class="assigned" />
+        </id>
+        <property name="description" type="java.lang.String" length="1200">
+            <column name="DESCRIPTION" />
+        </property>
+        <property name="fileName" type="java.lang.String" length="200" not-null="true">
+            <column name="NAME" />
+        </property>
+        <property name="version" type="java.lang.String" length="20" not-null="true">
+            <column name="VERSION" />
+        </property>
+        <property name="fileBody" type="java.lang.String" not-null="true">
+            <column name="BODY" />
+        </property>
+        <property name="created" type="java.sql.Timestamp" generated="insert" update="false" insert="false">
+            <column name="CREATION_TIMESTAMP" not-null="true"/>
+        </property>
+        <property name="artifactChecksum" type="java.lang.String" length="200" not-null="true">
+            <column name="ARTIFACT_CHECKSUM"/>
+        </property>
+    </class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/HeatNestedTemplate.hbm.xml b/mso-catalog-db/src/main/resources/HeatNestedTemplate.hbm.xml
index 90ae8ab..b89a93c 100644
--- a/mso-catalog-db/src/main/resources/HeatNestedTemplate.hbm.xml
+++ b/mso-catalog-db/src/main/resources/HeatNestedTemplate.hbm.xml
@@ -27,12 +27,12 @@
 		</meta>
 		
 		<composite-id>
-			<key-property name="parentTemplateId" column="PARENT_TEMPLATE_ID" type="int" />
-			<key-property name="childTemplateId" column="CHILD_TEMPLATE_ID" type="int" />
+			<key-property name="parentTemplateId" column="PARENT_HEAT_TEMPLATE_UUID" type="string" length="200"/>
+			<key-property name="childTemplateId" column="CHILD_HEAT_TEMPLATE_UUID" type="string" length="200"/>
 		</composite-id> 
 				
 		<property name="providerResourceFile" column="PROVIDER_RESOURCE_FILE" type="string" length="100"/>
 		
 	</class>
 	
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml b/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
index b776568..c1866e9 100644
--- a/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
+++ b/mso-catalog-db/src/main/resources/HeatTemplate.hbm.xml
@@ -27,47 +27,33 @@
 			This class describes a HEAT template
 		</meta>
 
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
+		<id name="artifactUuid" type="string" column="ARTIFACT_UUID" length="200">
+		            <generator class="assigned" />
 		</id>
 
-		<properties name="uk_template" unique="true">
 			<property name="templateName" type="string" >
-			     <column name="TEMPLATE_NAME" length="200" not-null="true"/>
+			<column name="NAME" length="200" not-null="true"/>
 			</property>
 			<property name="version" type="string" >
 			     <column name="VERSION" length="20" not-null="true"/>
 			</property>
-			<property name="asdcResourceName" type="string" >
-			      <column name="ASDC_RESOURCE_NAME" default="'MANUAL RECORD'" length="100" not-null="true"/>
-			</property>
-			<property name="asdcUuid" type="string" >
-				<column name="ASDC_UUID" length="200" default="'MANUAL RECORD'" not-null="true"/>
-			</property>
-		</properties>
 
-		<property name="templatePath" column="TEMPLATE_PATH" type="string" length="100"/>
 		<property name="templateBody" type="text">
-		   <column name="TEMPLATE_BODY" not-null="true"/>
+		   <column name="BODY" not-null="true"/>
 		</property>
 		<property name="timeoutMinutes" column="TIMEOUT_MINUTES" type="int"/>
 		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
-		<property name="asdcLabel" column="ASDC_LABEL" type="string" length="200"/>
-		<property name="artifactChecksum" type="string">
-			<column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
-		</property>
 		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
 		  <column name="CREATION_TIMESTAMP" not-null="true"/>
 		</property>
-
-		<set name="parameters" cascade="all">
-			<key column="HEAT_TEMPLATE_ID"/>
+		<property name="artifactChecksum" type="string">
+		  <column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
+		</property>
+		<set name="parameters" inverse="true" cascade="all">
+			<key column="HEAT_TEMPLATE_ARTIFACT_UUID"/>
 			<one-to-many class="HeatTemplateParam"/>
 		</set>
-		<set name="files" table="HEAT_NESTED_TEMPLATE" cascade="all">
-			<key column="CHILD_TEMPLATE_ID"/>
-			<one-to-many class="HeatTemplate" not-found="ignore"/>
-		</set>
+		
 
 	</class>
 
@@ -76,16 +62,17 @@
 			This class describes an input parameter to a heat template
 		</meta>
 
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
-		</id>
+		<composite-id>
+			<key-property name="heatTemplateArtifactUuid" column="HEAT_TEMPLATE_ARTIFACT_UUID" type="string" />
+			<key-property name="paramName" column="PARAM_NAME" type="string" />
+		</composite-id> 
 
 		<properties name="uk_heat_params" unique="true">
-			<property name="heatTemplateId" type="int">
-			     <column name="HEAT_TEMPLATE_ID" not-null="true"/>
+			<property name="heatTemplateArtifactUuid" type="string" insert="false" update="false">
+			     <column name="HEAT_TEMPLATE_ARTIFACT_UUID" not-null="true"/>
 			</property>
-			<property name="paramName" type="string" >
-			     <column name="PARAM_NAME" length="100" not-null="true"/>
+			<property name="paramName" type="string"  insert="false" update="false">
+			     <column name="PARAM_NAME" length="100" not-null="true" />
 			</property>
 		</properties>
 		<property name="required" type="boolean">
@@ -94,4 +81,5 @@
 		<property name="paramType" column="PARAM_TYPE" type="string" length="20"/>
 		<property name="paramAlias" column="PARAM_ALIAS" type="string" length="45"/>
 	</class>
+	
 </hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
index 28589ea..25c5ccd 100644
--- a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
@@ -26,14 +26,14 @@
 		<meta attribute="class-description">
 			This class describes a Network recipe
 		</meta>
-
+		
 		<id name="id" type="int" column="id">
 			<generator class="native"/>
 		</id>
 
 		<properties name="uk_network_recipe" unique="true">
-			<property name="networkType" type="string" >
-			     <column name="NETWORK_TYPE" not-null="true" length="20"/>
+			<property name="modelName" type="string" >
+			     <column name="MODEL_NAME" not-null="true" length="20"/>
 			</property>
 			<property name="action" type="string" >
 			     <column name="ACTION" not-null="true" length="20"/>
@@ -41,21 +41,21 @@
 			<property name="version" type="string">
 			     <column name="VERSION_STR" not-null="true" length="20"/>
 			</property>
-
+			
 		</properties>
-
+		
+		<property name="serviceType" type="string" length="45">
+                 <column name="SERVICE_TYPE" not-null="false" length="45"/>
+        </property>
 		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
 		<property name="orchestrationUri" type="string">
 		  <column name="ORCHESTRATION_URI" not-null="true" length="256"/>
 		</property>
 		<property name="networkParamXSD" column="NETWORK_PARAM_XSD" type="string" length="2048"/>
 		<property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
-		<property name="serviceType" type="string" >
-			<column name="SERVICE_TYPE" not-null="false" length="45" default="null"/>
-		</property>
 		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
 		    <column name="CREATION_TIMESTAMP" not-null="true"/>
 		</property>
 	</class>
-
-</hibernate-mapping>
+	
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
index 931db68..b8c2f39 100644
--- a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
@@ -27,31 +27,25 @@
 			This class describes a Network Resource
 		</meta>
 
-		<id name="id" type="int" column="id"/>
+		<id 	  name="modelUUID" 					column="MODEL_UUID" 					type="string" 	length="200"/>
+		<property name="modelName" 					column="MODEL_NAME" 					type="string" 	length="200"	not-null="true" />
+		<property name="modelInvariantUUID" 		column="MODEL_INVARIANT_UUID" 			type="string" 	length="20"/>
+		<property name="modelVersion" 				column="MODEL_VERSION" 					type="string" 	length="20"/>
+		<property name="toscaNodeType" 				column="TOSCA_NODE_TYPE" 				type="string" 	length="200"/>
+		<property name="neutronNetworkType" 		column="NEUTRON_NETWORK_TYPE" 			type="string" 	length="20"/>
+		<property name="description" 				column="DESCRIPTION" 					type="string" 	length="1200"/>
+		<property name="orchestrationMode" 			column="ORCHESTRATION_MODE" 			type="string" 	length="20"/>
+		<property name="heatTemplateArtifactUUID"	column="HEAT_TEMPLATE_ARTIFACT_UUID" 	type="string"	length="200"	not-null="true" />
 
-		<properties name="uk_network_resource" unique="true">
-			<property name="networkType" type="string" >
-			   <column name="NETWORK_TYPE" not-null="true" length="45"/>
-			</property>
-			<property name="version" type="string" >
-			  <column name="VERSION_STR" not-null="true" length="20"/>
-			</property>
-		</properties>
-		<property name="orchestrationMode" column="ORCHESTRATION_MODE" type="string" length="20"/>
-		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
-		<property name="templateId" column="TEMPLATE_ID" type="int"/>
-		<property name="neutronNetworkType" type="string"  >
-			<column name="NEUTRON_NETWORK_TYPE" not-null="false" default="null" length="20" />
-		</property>
-		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
-		    <column name="CREATION_TIMESTAMP" not-null="true"/>
-		</property>
 		<property name="aicVersionMin" type="string" >
-			<column name="AIC_VERSION_MIN" not-null="true" length="20" />
+			<column name="AIC_VERSION_MIN" not-null="true" default="2.5" length="20" />
 		</property>
 		<property name="aicVersionMax" type="string">
-			<column name="AIC_VERSION_MAX" not-null="false" default="null" length="20"/>
+			<column name="AIC_VERSION_MAX" not-null="false" default="2.5" length="20"/>
 		</property>
+		
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+
 	</class>
 
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml
index b8287ed..37bb77f 100644
--- a/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkResourceCustomization.hbm.xml
@@ -21,34 +21,24 @@
 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
 <hibernate-mapping>
-    <class name="org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization" table="NETWORK_RESOURCE_CUSTOMIZATION">
-
-
-        <composite-id>
-            <key-property name="modelCustomizationUuid"  type="java.lang.String" >
-                <column name="MODEL_CUSTOMIZATION_UUID" length="200" not-null="true"/>
-            </key-property>
-            <key-property name="networkResourceId" type="int" >
-                <column name="NETWORK_RESOURCE_ID" length="11" not-null="false" default="null" />
-            </key-property>
-        </composite-id>
-
-        <property name="modelUuid" type="java.lang.String">
-            <column name="MODEL_UUID" length="200" not-null="true"/>
+    <class name="org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization" table="NETWORK_RESOURCE_CUSTOMIZATION"> 
+		<id name="modelCustomizationUuid" column="MODEL_CUSTOMIZATION_UUID" type="java.lang.String" length="200"/>
+		<property name="networkResourceModelUuid" column="NETWORK_RESOURCE_MODEL_UUID" type="java.lang.String" length="200" not-null="true"/>
+        <property name="modelInstanceName" type="java.lang.String" length="200" not-null="true">
+            <column name="MODEL_INSTANCE_NAME" />
         </property>
-        <property name="modelName" type="java.lang.String">
-            <column name="MODEL_NAME" length="200" not-null="true"/>
+        <property name="networkTechnology" type="java.lang.String" length="45">
+            <column name="NETWORK_TECHNOLOGY" />
         </property>
-        <property name="modelInstanceName" type="java.lang.String">
-            <column name="MODEL_INSTANCE_NAME" length="200" not-null="true"/>
+        <property name="networkType" type="java.lang.String" length="45">
+            <column name="NETWORK_TYPE" />
         </property>
-        <property name="modelVersion" type="java.lang.String">
-            <column name="MODEL_VERSION" length="20" not-null="true"/>
+        <property name="networkScope" type="java.lang.String" length="45">
+            <column name="NETWORK_SCOPE" />
         </property>
-        <property name="modelInvariantUuid" type="java.lang.String">
-            <column name="MODEL_INVARIANT_UUID" length="200" not-null="true"/>
+        <property name="networkRole" type="java.lang.String" length="200">
+            <column name="NETWORK_ROLE" />
         </property>
-
         <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
             <column name="CREATION_TIMESTAMP" not-null="true"/>
         </property>
diff --git a/mso-catalog-db/src/main/resources/Service.hbm.xml b/mso-catalog-db/src/main/resources/Service.hbm.xml
index f604996..b48c55d 100644
--- a/mso-catalog-db/src/main/resources/Service.hbm.xml
+++ b/mso-catalog-db/src/main/resources/Service.hbm.xml
@@ -27,67 +27,28 @@
 			This class describes a Service that may be orchestrated
 		</meta>
 
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
-		</id>
-
-		<properties name="uk" unique="true">
-			<property name="serviceNameVersionId" type="string" >
-				<column name="SERVICE_NAME_VERSION_ID" length="50" not-null="true" default="'MANUAL_RECORD'" />
-			</property>
-			<property name="serviceName" column="SERVICE_NAME" type="string" length="40"/>
-		</properties>
-
-		<property name="version"  type="string" >
-				<column name="VERSION_STR" length="20" not-null="true"/>
-		</property>
+		<id name="modelUUID"  					column="MODEL_UUID"					type="string"		length="200"/>
+		<property name="modelName" 				column="MODEL_NAME" 				type="string" 		length="200"	not-null="true"/>
+		<property name="version" 				column="MODEL_VERSION" 				type="string" 		length="20"		not-null="true"/>
 		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
+		<property name="toscaCsarArtifactUUID" 	column="TOSCA_CSAR_ARTIFACT_UUID" 	type="string" 		length="200" />
 
-		<property name="serviceVersion" column="SERVICE_VERSION" type="string" length="10"/>
-		<property name="httpMethod" column="HTTP_METHOD" type="string" length="50"/>
-		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
-		   <column name="CREATION_TIMESTAMP" not-null="true"/>
-		</property>
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
 		<property name="modelInvariantUUID" type="string">
            <column name="MODEL_INVARIANT_UUID" default="'MANUAL_RECORD'" not-null="true" length="200"/>
         </property>
-
-		<map name="recipes" cascade="all">
-			<key column="SERVICE_ID"/>
+        <property name="serviceType" 				column="SERVICE_TYPE" 				type="string" 		length="20"/>
+        <property name="serviceRole" 				column="SERVICE_ROLE" 				type="string" 		length="20"/>
+        
+		<map name="recipes" inverse="true" cascade="all">
+			<key column="SERVICE_MODEL_UUID"/>
 			<map-key column="action" type="string"/>
 			<one-to-many class="ServiceRecipe"/>
 		</map>
+
+		<set name="serviceResourceCustomizations" inverse="true" cascade="all">
+            <key column="SERVICE_MODEL_UUID" not-null="true" />
+            <one-to-many class="ServiceToResourceCustomization" />
+        </set>
 	</class>
-
-	<class name="ServiceRecipe" table="SERVICE_RECIPE">
-		<meta attribute="class-description">
-			This class describes a Service recipe
-		</meta>
-
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
-		</id>
-
-		<properties name="uk1_service_recipe" unique="true">
-			<property name="serviceId" type="int">
-			     <column name="SERVICE_ID" not-null="true" length="11"/>
-			</property>
-			<property name="action" type="string" >
-			     <column name="ACTION" not-null="true" length="40"/>
-			</property>
-		</properties>
-		<property name="version" type="string">
-			<column name="VERSION_STR" not-null="false" length="20" default="null"/>
-		</property>
-		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
-		<property name="orchestrationUri" type="string">
-          <column name="ORCHESTRATION_URI" not-null="true" length="256"/>
-        </property>
-		<property name="serviceParamXSD" column="SERVICE_PARAM_XSD" type="string" length="2048"/>
-		<property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
-		<property name="serviceTimeoutInterim" column="SERVICE_TIMEOUT_INTERIM" type="java.lang.Integer"/>
-		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
-		    <column name="CREATION_TIMESTAMP" not-null="true"/>
-		</property>
-	</class>
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml b/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml
new file mode 100644
index 0000000..0003c37
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="ServiceRecipe" table="SERVICE_RECIPE">
+		<meta attribute="class-description">
+			This class describes a Service recipe
+		</meta>
+		
+		<id name="id" type="int" column="id">
+			<generator class="native"/>
+		</id>
+
+		<properties name="uk1_service_recipe" unique="true">
+			<property name="serviceModelUUID" type="string" >
+			     <column name="SERVICE_MODEL_UUID" not-null="true" length="200" />
+			</property>
+			<property name="action" type="string" >
+			     <column name="ACTION" not-null="true" length="40" />
+			</property>
+		</properties>
+		
+		<property name="orchestrationUri" type="string" column="ORCHESTRATION_URI" not-null="true" length="256"/>
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+
+		<property name="action" 				column="ACTION" 					type="string" 			length="20" insert="false" update="false" />
+		<property name="version" 				column="VERSION_STR" 				type="string" 			length="20"/>
+		<property name="description" 			column="DESCRIPTION" 				type="string" 			length="1200"/>
+		<property name="serviceParamXSD" 		column="SERVICE_PARAM_XSD" 			type="string" 			length="2048"/>
+		<property name="recipeTimeout" 			column="RECIPE_TIMEOUT" 			type="int"/>
+		<property name="serviceTimeoutInterim" 	column="SERVICE_TIMEOUT_INTERIM" 	type="java.lang.Integer"/>
+	</class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/ServiceToResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/ServiceToResourceCustomization.hbm.xml
new file mode 100644
index 0000000..dde156c
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ServiceToResourceCustomization.hbm.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="ServiceToResourceCustomization" table="SERVICE_TO_RESOURCE_CUSTOMIZATIONS">
+		<meta attribute="class-description">
+			This class describes a Service To Resource Customization
+		</meta>
+		
+		<composite-id>
+			<key-property name="modelType"  					type="string" column="MODEL_TYPE" length="20" />
+			<key-property name="resourceModelCustomizationUUID" type="string" column="RESOURCE_MODEL_CUSTOMIZATION_UUID" length="200" />
+		</composite-id>
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+		<property name="serviceModelUUID" 				type="string" column="SERVICE_MODEL_UUID" length="200" not-null="true"/>
+
+	</class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/TempNetworkHeatTemplateLookup.hbm.xml b/mso-catalog-db/src/main/resources/TempNetworkHeatTemplateLookup.hbm.xml
new file mode 100644
index 0000000..d5d2108
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/TempNetworkHeatTemplateLookup.hbm.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="TempNetworkHeatTemplateLookup" table="TEMP_NETWORK_HEAT_TEMPLATE_LOOKUP">
+		<meta attribute="class-description">
+			This class describes a VF Module to HEAT Files Entry
+		</meta>
+		
+		<id name="networkResourceModelName" column="NETWORK_RESOURCE_MODEL_NAME" type="java.lang.String"  length="200"/>
+		
+		<property name="heatTemplateArtifactUuid" column="HEAT_TEMPLATE_ARTIFACT_UUID" type="java.lang.String" length="200" not-null="true"/>
+		<property name="aicVersionMin" type="string" >
+		  <column name="AIC_VERSION_MIN" not-null="true" length="20"/>
+		</property>
+		<property name="aicVersionMax" type="string" >
+		  <column name="AIC_VERSION_MAX" not-null="false" length="20"/>
+		</property>
+		
+				
+	</class>
+	
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/ToscaCsar.hbm.xml b/mso-catalog-db/src/main/resources/ToscaCsar.hbm.xml
new file mode 100644
index 0000000..9ffb782
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/ToscaCsar.hbm.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="ToscaCsar" table="TOSCA_CSAR">
+		<meta attribute="class-description">
+			This class describes a Tosca Csar
+		</meta>
+		
+		<id name="artifactUUID"  				column="ARTIFACT_UUID"			type="string"			length="200"/>
+		<property name="name" 					column="NAME" 					type="string" 			length="200" 	not-null="true"/>
+		<property name="version" 				column="VERSION" 				type="string" 			length="20" 	not-null="true"/>
+		<property name="artifactChecksum" 		column="ARTIFACT_CHECKSUM" 		type="string" 			length="200"	not-null="true"/>
+		<property name="url" 					column="URL" 					type="string" 			length="200" 	not-null="true"/>
+		<property name="description" 			column="DESCRIPTION" 			type="string" 			length="1200"/>
+		
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+	
+		<set name="services" inverse="true" cascade="all">
+            <key column="TOSCA_CSAR_ARTIFACT_UUID" not-null="true" />
+            <one-to-many class="Service" />
+        </set>
+	</class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/VfModule.hbm.xml b/mso-catalog-db/src/main/resources/VfModule.hbm.xml
index 1631057..16f3d39 100644
--- a/mso-catalog-db/src/main/resources/VfModule.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VfModule.hbm.xml
@@ -24,69 +24,19 @@
 <!-- Generated Apr 28, 2016 2:44:06 PM by Hibernate Tools 3.4.0.CR1 -->
 <hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
     <class name="VfModule" table="VF_MODULE">
-        <id name="id" type="int" column="id">
-        	<generator class="native"/>
-        </id>
-        <property name="asdcUuid" type="java.lang.String" >
-            <column name="ASDC_UUID" not-null="false" length="200" default="null"/>
-        </property>
-        <property name="volEnvironmentId" type="java.lang.Integer" >
-            <column name="VOL_ENVIRONMENT_ID" not-null="false" length="11" default="null"/>
-        </property>
-        <properties name="uk_vfmodule" unique="true">
-            <property name="type" type="string" >
-                <column name="TYPE" not-null="true" length="200"/>
-            </property>
-            <property name="version" type="string">
-                <column name="ASDC_SERVICE_MODEL_VERSION" not-null="true" length="20"/>
-            </property>
-        </properties>
-        <property name="modelCustomizationUuid" type="java.lang.String" >
-            <column name="MODEL_CUSTOMIZATION_UUID" not-null="false" length="200"/>
-        </property>
-        <property name="modelName" type="string" >
-            <column name="MODEL_NAME" not-null="true" length="200"/>
-        </property>
-        <property name="modelVersion" type="string" >
-            <column name="MODEL_VERSION" not-null="true" length="20"/>
-        </property>
 
-       	<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
-       	      <column name="CREATION_TIMESTAMP" not-null="true"/>
-       	</property>
-        <property name="description" type="java.lang.String" >
-            <column name="DESCRIPTION" not-null="false" length="255" default="null"/>
-        </property>
-        <property name="volTemplateId" type="java.lang.Integer" >
-            <column name="VOL_TEMPLATE_ID" not-null="false" default="null" length="11"/>
-        </property>
-        <property name="templateId" type="java.lang.Integer" >
-            <column name="TEMPLATE_ID" not-null="false" length="11" default="null"/>
-        </property>
-        <property name="vnfResourceId" type="java.lang.Integer" >
-            <column name="VNF_RESOURCE_ID" not-null="true" length="11"/>
-        </property>
-        <property name="isBase" type="int">
-            <column name="IS_BASE" not-null="true" length="11"/>
-        </property>
-        <property name="environmentId" type="java.lang.Integer" >
-            <column name="ENVIRONMENT_ID" not-null="false"/>
-        </property>
-        <property name="modelInvariantUuid" type="java.lang.String" >
-            <column name="MODEL_INVARIANT_UUID" not-null="false" length="200" default="null"/>
-        </property>
+        <id name="modelUUID" 				type="string" 				column="MODEL_UUID" 				length="200" />
 
-        <property name="minInstances" type="java.lang.Integer" >
-            <column name="MIN_INSTANCES" not-null="false" length="11" default="0"/>
-        </property>
-        <property name="maxInstances" type="java.lang.Integer" >
-            <column name="MAX_INSTANCES" not-null="false" length="11" default="null"/>
-        </property>
-        <property name="initialCount" type="java.lang.Integer" >
-            <column name="INITIAL_COUNT" not-null="false" length="11" default="0"/>
-        </property>
-        <property name="label" type="java.lang.String" >
-            <column name="LABEL" not-null="false" length="200" default="null"/>
-        </property>
+        <property name="vnfResourceModelUUId" 			type="string" 			column="VNF_RESOURCE_MODEL_UUID"	length="200" />
+        <property name="modelInvariantUUID" 			type="string" 			column="MODEL_INVARIANT_UUID"				length="200"/>
+        <property name="version" 						type="string" 			column="MODEL_VERSION" 						length="20"		not-null="true"/>
+        <property name="modelName" 						type="string" 			column="MODEL_NAME"							length="200"	not-null="true" />
+        <property name="description" 					type="string" 			column="DESCRIPTION" 						length="1200"/>
+        <property name="isBase" 						type="int" 				column="IS_BASE" 											not-null="true"/>
+        <property name="heatTemplateArtifactUUId" 		type="string" 			column="HEAT_TEMPLATE_ARTIFACT_UUID" 		length="200"	not-null="true" />
+        <property name="volHeatTemplateArtifactUUId"	type="string" 			column="VOL_HEAT_TEMPLATE_ARTIFACT_UUID" 	length="200" />
+       	
+       	<property name="created" type="timestamp" generated="insert" update="false" insert="false" column ="CREATION_TIMESTAMP" not-null="true"/>
+
     </class>
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/VfModuleCustomization.hbm.xml b/mso-catalog-db/src/main/resources/VfModuleCustomization.hbm.xml
new file mode 100644
index 0000000..2bf5be2
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/VfModuleCustomization.hbm.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+    <class name="VfModuleCustomization" table="VF_MODULE_CUSTOMIZATION">
+    
+    	<id name="modelCustomizationUuid" type="string" column="MODEL_CUSTOMIZATION_UUID" length="200">
+		</id>
+    
+		<property name="vfModuleModelUuid" column="VF_MODULE_MODEL_UUID" type="java.lang.String" length="200" not-null="true"/>
+        
+        <property name="volEnvironmentArtifactUuid" type="java.lang.String">
+            <column name="VOL_ENVIRONMENT_ARTIFACT_UUID" length="200" not-null="false" />
+        </property>
+
+       	<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+       	      <column name="CREATION_TIMESTAMP" not-null="true"/>
+       	</property>
+        
+        <property name="heatEnvironmentArtifactUuid" type="java.lang.String">
+            <column name="HEAT_ENVIRONMENT_ARTIFACT_UUID" length="200" not-null="false" />
+        </property>
+        <property name="minInstances" type="java.lang.Integer" >
+            <column name="MIN_INSTANCES" not-null="false"/>
+        </property>
+        <property name="maxInstances" type="java.lang.Integer" >
+            <column name="MAX_INSTANCES" not-null="false"/>
+        </property>
+        <property name="initialCount" type="java.lang.Integer" >
+            <column name="INITIAL_COUNT" not-null="false"/>
+        </property>
+        <property name="availabilityZoneCount" type="java.lang.Integer" >
+            <column name="AVAILABILITY_ZONE_COUNT" not-null="false"/>
+        </property>
+        <property name="label" type="java.lang.String" >
+            <column name="LABEL" not-null="false" length="200"/>
+        </property>
+
+    </class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/VfModuleToHeatFiles.hbm.xml b/mso-catalog-db/src/main/resources/VfModuleToHeatFiles.hbm.xml
index 9af02d8..b8498be 100644
--- a/mso-catalog-db/src/main/resources/VfModuleToHeatFiles.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VfModuleToHeatFiles.hbm.xml
@@ -27,10 +27,10 @@
 		</meta>
 		
 		<composite-id>
-			<key-property name="vfModuleId" column="VF_MODULE_ID" type="int" />
-			<key-property name="heatFilesId" column="HEAT_FILES_ID" type="int" />
+			<key-property name="vfModuleModelUuid" column="VF_MODULE_MODEL_UUID" type="java.lang.String" length="200"/>
+			<key-property name="heatFilesArtifactUuid" column="HEAT_FILES_ARTIFACT_UUID" type="java.lang.String" length="200"/>
 		</composite-id> 
 				
 	</class>
 	
-</hibernate-mapping>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
index 6297e1c..69a3a45 100644
--- a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
@@ -32,16 +32,14 @@
 		</id>
 		<properties name="uk_vnf_component_recipe" unique="true">
 			<property name="vnfType" column="VNF_TYPE" type="string" length="200"/>
+			<property name="vfModuleModelUUId" column="VF_MODULE_MODEL_UUID" type="string" length="100" not-null="false"/>
 			<property name="vnfComponentType" type="string">
 				<column name="VNF_COMPONENT_TYPE" not-null="true" length="45"/>
 			</property>
-			<property name="vfModuleId" column="VF_MODULE_ID" type="string" length="100" not-null="false"/>
 			<property name="action" type="string">
 			     <column name="ACTION" not-null="true" length="20"/>
 			</property>
-			<property name="serviceType" type="string">
-				<column name="SERVICE_TYPE" not-null="false" length="45" default="null"/>
-			</property>
+			<property name="serviceType" column="SERVICE_TYPE" type="string" length="45"/>
 			<property name="version" column="VERSION" type="string" length="20"/>
 		</properties>
 		<property name="description" column="DESCRIPTION" type="string" length="1200"/>
diff --git a/mso-catalog-db/src/main/resources/VnfResCustomToVfModuleCustom.hbm.xml b/mso-catalog-db/src/main/resources/VnfResCustomToVfModuleCustom.hbm.xml
new file mode 100644
index 0000000..77d1dfe
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/VnfResCustomToVfModuleCustom.hbm.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="VnfResCustomToVfModuleCustom" table="VNF_RES_CUSTOM_TO_VF_MODULE_CUSTOM">
+		<meta attribute="class-description">
+			This class maps two UUIDs
+		</meta>
+		
+		<composite-id>
+			<key-property name="vnfResourceCustModelCustomizationUuid" column="VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID" type="java.lang.String" length="200"/>
+			<key-property name="vfModuleCustModelCustomizationUuid" column="VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID" type="java.lang.String" length="200"/>
+		</composite-id> 
+		
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
+       	      <column name="CREATION_TIMESTAMP" not-null="true"/>
+       	</property>
+				
+	</class>
+	
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/VnfResource.hbm.xml b/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
index 2fc4700..85b9e2a 100644
--- a/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfResource.hbm.xml
@@ -27,110 +27,26 @@
 			This class describes a VNF Resource
 		</meta>
 
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
-		</id>
-		<properties name="uk1" unique="true">
-			<property name="vnfType" type="string" >
-			  <column name="VNF_TYPE" not-null="true" length="200"/>
-			</property>
-		    <property name="version" type="string" >
-		      <column name="ASDC_SERVICE_MODEL_VERSION" not-null="true" length="20"/>
-		    </property>
-			<property name="serviceModelInvariantUUID" type="string" >
-				<column name="SERVICE_MODEL_INVARIANT_UUID" not-null="false" length="200"/>
-			</property>
-		</properties>
-		<property name="modelCustomizationName" type="string" >
-			<column name="MODEL_CUSTOMIZATION_NAME" not-null="false" length="200"/>
-		</property>
-		<property name="orchestrationMode" type="string" >
-		      <column name="ORCHESTRATION_MODE" not-null="true" length="20"/>
-		</property>
-		<property name="description" type="string" >
-		  <column name="DESCRIPTION" not-null="false" length="1200"/>
-		</property>
-
-		<property name="templateId" type="int" not-null="false">
-		  <column name="TEMPLATE_ID" not-null="false"/>
-		</property>
-		<property name="environmentId"  type="int">
-		  <column name="ENVIRONMENT_ID" not-null="false"/>
-		</property>
-		<property name="created" type="timestamp" generated="insert" update="false" insert="false" >
-		  <column name="CREATION_TIMESTAMP" not-null="true"/>
-		</property>
-		<property name="asdcUuid" type="string" >
-		  <column name="ASDC_UUID" not-null="false" length="200"/>
-		</property>
-		<property name="aicVersionMin" type="string" >
-		  <column name="AIC_VERSION_MIN" not-null="false" length="20"/>
-		</property>
-		<property name="aicVersionMax" type="string" >
-		  <column name="AIC_VERSION_MAX" not-null="false" length="20"/>
-		</property>
-		<property name="modelInvariantUuid" type="string" >
-		  <column name="MODEL_INVARIANT_UUID" not-null="false" length="200"/>
-		</property>
-		<property name="modelVersion" type="string" >
-		  <column name="MODEL_VERSION" not-null="true" length="20"/>
-		</property>
-        <property name="modelName" type="string" >
-          <column name="MODEL_NAME" not-null="false" length="200"/>
-        </property>
-		<property name="modelCustomizationUuid" type="string" >
-			<column name="MODEL_CUSTOMIZATION_UUID" not-null="false" length="255"/>
-		</property>
-		<map name="heatFiles" cascade="all">
-			<key column="VNF_RESOURCE_ID" foreign-key="none"/>
-			<map-key column="FILE_NAME" type="string"/>
-			<one-to-many class="HeatFiles"/>
-		</map>
-
+		<id name="modelUuid" 						type="string" 		column="MODEL_UUID" 					length="200"/>
+		<property name="modelInvariantUuid" 		type="string" 		column="MODEL_INVARIANT_UUID" 			length="200"/>
+		<property name="version" 					type="string" 		column="MODEL_VERSION" 					length="20"		not-null="true"/>
+		<property name="modelName"  				type="string" 		column="MODEL_NAME"						length="200"/>
+		<property name="toscaNodeType" 				type="string" 		column="TOSCA_NODE_TYPE" 				length="200"/>
+		<property name="description" 				type="string" 		column="DESCRIPTION" 					length="1200"/>
+		<property name="orchestrationMode" 			type="string" 		column="ORCHESTRATION_MODE" 			length="20"		not-null="true"/>
+		<property name="aicVersionMin" 				type="string" 		column="AIC_VERSION_MIN" 				length="20"/>
+		<property name="aicVersionMax" 				type="string" 		column="AIC_VERSION_MAX" 				length="20"/>
+		<property name="heatTemplateArtifactUUId" 	type="string" 		column="HEAT_TEMPLATE_ARTIFACT_UUID" 	length="200" />
+		<property name="created" 					type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+		
+		<set name="vnfResourceCustomizations" inverse="true" access="field" cascade="all">
+            <key column="VNF_RESOURCE_MODEL_UUID" not-null="true" />
+            <one-to-many class="VnfResourceCustomization" />
+        </set>
+        
+        <set name="vfModules" inverse="true" cascade="all">
+            <key column="VNF_RESOURCE_MODEL_UUID" not-null="true" />
+            <one-to-many class="VfModule" />
+        </set>
 	</class>
-
-	<class name="HeatFiles" table="HEAT_FILES">
-		<meta attribute="class-description">
-			This class describes a HEAT Template File
-		</meta>
-
-		<id name="id" type="int" column="id">
-			<generator class="native"/>
-		</id>
-		<property name="description"  type="string" >
-			<column name="DESCRIPTION" not-null="false" length="1200" default="null"/>
-		</property>
-		<properties name="uk_heat_files" unique="true">
-			<property name="fileName" type="string" >
-			     <column name="FILE_NAME" not-null="true" length="200"/>
-			</property>
-			<property name="asdcResourceName" type="string" >
-				<column name="ASDC_RESOURCE_NAME" not-null="true" length="100"/>
-			</property>
-			<property name="version" type="string" >
-				<column name="VERSION" not-null="true" length="20"/>
-			</property>
-			<property name="asdcUuid"  type="string"  >
-				<column name="ASDC_UUID" not-null="false" length="200" default="'MANUAL RECORD'"/>
-			</property>
-		</properties>
-
-		<property name="fileBody" type="text">
-		  <column name="FILE_BODY" not-null="true"/>
-		</property>
-		<property name="vnfResourceId" type="int">
-			<column name="VNF_RESOURCE_ID" not-null="false" length="11" default="null"/>
-		</property>
-		<property name="created"  type="timestamp" generated="insert" update="false" insert="false">
-		  <column name="CREATION_TIMESTAMP" not-null="true"/>
-		</property>
-		<property name="asdcLabel"  type="string"  >
-		  <column name="ASDC_LABEL" not-null="false" length="200"/>
-		</property>
-		<property name="artifactChecksum" type="string">
-			<column name="ARTIFACT_CHECKSUM" length="200" default="'MANUAL RECORD'" not-null="true"/>
-		</property>
-
-	</class>
-
 </hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/VnfResourceCustomization.hbm.xml b/mso-catalog-db/src/main/resources/VnfResourceCustomization.hbm.xml
new file mode 100644
index 0000000..a3e738b
--- /dev/null
+++ b/mso-catalog-db/src/main/resources/VnfResourceCustomization.hbm.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
+	<class name="VnfResourceCustomization" table="VNF_RESOURCE_CUSTOMIZATION">
+		<meta attribute="class-description">
+			This class describes a VNF Resource Customization
+		</meta>
+		
+        <id name="modelCustomizationUuid"  			column="MODEL_CUSTOMIZATION_UUID"		type="string"		length="200"/>
+		
+		<property name="modelInstanceName" 			column="MODEL_INSTANCE_NAME" 			type="string" 		length="200"	not-null="true"/>
+		<property name="minInstances" 				column="MIN_INSTANCES" 					type="int" 			length="11"/>
+		<property name="maxInstances" 				column="MAX_INSTANCES" 					type="int" 			length="11"/>
+		<property name="availabilityZoneMaxCount"	column="AVAILABILITY_ZONE_MAX_COUNT" 	type="int" 			length="11"/>
+		<property name="nfFunction" 				column="NF_FUNCTION" 					type="string" 		length="200"/>
+		<property name="nfType" 					column="NF_TYPE" 						type="string" 		length="200"/>
+		<property name="nfRole" 					column="NF_ROLE" 						type="string" 		length="200"/>
+		<property name="nfNamingCode" 				column="NF_NAMING_CODE" 				type="string"		length="200"/>
+		<property name="vnfResourceModelUuid" 		column="VNF_RESOURCE_MODEL_UUID" 		type="string" 		length="200"	not-null="true"  />
+		
+		<property name="created" type="timestamp" generated="insert" update="false" insert="false" column="CREATION_TIMESTAMP" not-null="true"/>
+		
+		<set name="serviceResourceCustomizations" inverse="true" cascade="all">
+            <key column="SERVICE_MODEL_UUID" not-null="true" />
+            <one-to-many class="ServiceToResourceCustomization" />
+        </set>
+	</class>
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml b/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml
index 306dfc6..dd470a5 100644
--- a/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml
+++ b/mso-catalog-db/src/main/resources/hibernate-catalog-core-mysql.cfg.xml
@@ -35,18 +35,31 @@
 		<property name="hibernate.c3p0.max_statements">50</property>
 		
 <!-- 		<property name="hibernate.hbm2ddl.auto">create</property> -->
-		
-		<mapping resource="VnfResource.hbm.xml"/>
-		<mapping resource="VnfRecipe.hbm.xml"/>
-		<mapping resource="HeatTemplate.hbm.xml"/>
-		<mapping resource="Service.hbm.xml"/>
-		<mapping resource="NetworkResource.hbm.xml"/>
-		<mapping resource="NetworkRecipe.hbm.xml"/>
+		<mapping resource="AllottedResource.hbm.xml"/>
+		<mapping resource="AllottedResourceCustomization.hbm.xml"/>
 		<mapping resource="HeatEnvironment.hbm.xml"/>
+		<mapping resource="HeatFiles.hbm.xml"/>
 		<mapping resource="HeatNestedTemplate.hbm.xml"/>
+		<mapping resource="HeatTemplate.hbm.xml"/>
+		<mapping resource="ModelRecipe.hbm.xml"/>
+		<mapping resource="NetworkRecipe.hbm.xml"/>
+		<mapping resource="NetworkResource.hbm.xml"/>
+		<mapping resource="NetworkResourceCustomization.hbm.xml"/>
+		<mapping resource="Service.hbm.xml"/>
+		<mapping resource="ServiceRecipe.hbm.xml"/>
+		<mapping resource="ServiceToAllottedResources.hbm.xml"/>
+		<mapping resource="ServiceToNetworks.hbm.xml"/>
+		<mapping resource="ServiceToResourceCustomization.hbm.xml"/>
+		<mapping resource="TempNetworkHeatTemplateLookup.hbm.xml"/>
+		<mapping resource="ToscaCsar.hbm.xml"/>
+		<mapping resource="VfModule.hbm.xml"/>
+		<mapping resource="VfModuleCustomization.hbm.xml"/>
+		<mapping resource="VfModuleToHeatFiles.hbm.xml"/>
 		<mapping resource="VnfComponent.hbm.xml"/>
 		<mapping resource="VnfComponentsRecipe.hbm.xml"/>
-		<mapping resource="VfModule.hbm.xml"/>
-		<mapping resource="VfModuleToHeatFiles.hbm.xml"/>
+		<mapping resource="VnfRecipe.hbm.xml"/>
+		<mapping resource="VnfResCustomToVfModuleCustom.hbm.xml"/>
+		<mapping resource="VnfResource.hbm.xml"/>
+		<mapping resource="VnfResourceCustomization.hbm.xml"/>
 	</session-factory>
 </hibernate-configuration>
