From: Praneta Paithankar Date: Mon, 11 Jun 2018 09:34:40 +0000 (-0700) Subject: Define constant instead of literal "template_name" X-Git-Tag: v1.3.0~70^2~1 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F51143%2F1;p=so.git Define constant instead of literal "template_name" Constant TEMPLATE_NAME is defined and used instaed of literal "template_name". Issue-ID: SO-666 Change-Id: I8a8ab9fd8efc64003648601ee60eed0fef48b684 Signed-off-by: Praneta Paithankar --- 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 91c19dd97f..98f5329687 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 @@ -95,6 +95,7 @@ public class CatalogDatabase implements Closeable { private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUuid"; private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUId"; private static final String NETWORK_SERVICE = "network service"; + private static final String TEMPLATE_NAME = "template_name"; protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); @@ -198,7 +199,7 @@ public class CatalogDatabase implements Closeable { String hql = "FROM HeatTemplate WHERE templateName = :template_name"; Query query = getSession().createQuery (hql); - query.setParameter("template_name", templateName); + query.setParameter(TEMPLATE_NAME, templateName); @SuppressWarnings("unchecked") List resultList = query.list(); @@ -231,7 +232,7 @@ 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(TEMPLATE_NAME,templateName); query.setParameter("version", version); @SuppressWarnings("unchecked") @@ -3490,7 +3491,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 (TEMPLATE_NAME, templateName); query.setParameter ("version", version); query.setParameter ("asdcResourceName", asdcResourceName);