From f5618da7e8d8398d5f85fe950fd5c88e84481f83 Mon Sep 17 00:00:00 2001 From: Mariah Jacobs Date: Tue, 12 Jun 2018 09:39:54 -0700 Subject: Use already-defined constant MODEL_VERSION Replace literal 'version' with already-defined constant MODEL_VERSION. Issue-ID: SO-666 Change-Id: I74d1c74d62b8beaceb1cb43e67ce3764c31ee9f0 Signed-off-by: Mariah Jacobs --- .../org/openecomp/mso/db/catalog/CatalogDatabase.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mso-catalog-db/src/main') 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 1ef1313158..af0ea101f4 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 @@ -234,8 +234,8 @@ public class CatalogDatabase implements Closeable { String hql = "FROM HeatTemplate WHERE templateName = :template_name AND version = :version"; Query query = getSession().createQuery(hql); - query.setParameter(TEMPLATE_NAME,templateName); - query.setParameter("version", version); + query.setParameter(TEMPLATE_NAME, templateName); + query.setParameter(MODEL_VERSION, version); @SuppressWarnings("unchecked") List resultList = query.list(); @@ -1345,7 +1345,7 @@ public class CatalogDatabase implements Closeable { String hql = "FROM VfModule WHERE type = :type and version = :version"; Query query = getSession().createQuery(hql); query.setParameter ("type", type); - query.setParameter ("version", version); + query.setParameter (MODEL_VERSION, version); VfModule module = null; try { module = (VfModule) query.uniqueResult (); @@ -2870,7 +2870,7 @@ public class CatalogDatabase implements Closeable { query = getSession ().createQuery (hql.toString ()); query.setParameter ("modelCustomizationUuid", modelCustomizationUuid); - query.setParameter ("version", asdcServiceModelVersion); + query.setParameter (MODEL_VERSION, asdcServiceModelVersion); }else{ hql = new StringBuilder ("FROM VfModule WHERE type = :type AND version = :version AND modelVersion = :modelVersion"); @@ -2878,7 +2878,7 @@ public class CatalogDatabase implements Closeable { query = getSession ().createQuery (hql.toString ()); query.setParameter (TYPE, vfModuleType); - query.setParameter ("version", asdcServiceModelVersion); + query.setParameter (MODEL_VERSION, asdcServiceModelVersion); query.setParameter ("modelVersion", modelVersion); } @@ -3494,7 +3494,7 @@ public class CatalogDatabase implements Closeable { String hql = "FROM HeatTemplate WHERE templateName = :template_name AND version = :version AND asdcResourceName = :asdcResourceName"; Query query = getSession ().createQuery (hql); query.setParameter (TEMPLATE_NAME, templateName); - query.setParameter ("version", version); + query.setParameter (MODEL_VERSION, version); query.setParameter ("asdcResourceName", asdcResourceName); @SuppressWarnings("unchecked") @@ -3606,7 +3606,7 @@ public class CatalogDatabase implements Closeable { String hql = "FROM HeatEnvironment WHERE name=:name AND version=:version AND asdcResourceName=:asdcResourceName"; Query query = getSession ().createQuery (hql); query.setParameter ("name", name); - query.setParameter ("version", version); + query.setParameter (MODEL_VERSION, version); query.setParameter ("asdcResourceName", asdcResourceName); HeatEnvironment env = null; try { @@ -3648,7 +3648,7 @@ public class CatalogDatabase implements Closeable { String hql = "FROM HeatEnvironment WHERE artifactUuid=:artifactUuid AND version=:version"; Query query = getSession ().createQuery (hql); query.setParameter ("artifactUuid", artifactUuid); - query.setParameter ("version", version); + query.setParameter (MODEL_VERSION, version); HeatEnvironment env = null; try { env = (HeatEnvironment) query.uniqueResult (); @@ -4286,7 +4286,7 @@ public class CatalogDatabase implements Closeable { query.setParameter ("fileName", fileName); query.setParameter ("vnfResourceId", vnfResourceId); query.setParameter ("asdcResourceName", asdcResourceName); - query.setParameter ("version", version); + query.setParameter (MODEL_VERSION, version); @SuppressWarnings("unchecked") -- cgit 1.2.3-korg