summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Williams <marcus.williams@intel.com>2018-06-14 22:48:57 +0000
committerGerrit Code Review <gerrit@onap.org>2018-06-14 22:48:57 +0000
commit4eba53c129235c72cd024d83e1994d16e570ad08 (patch)
treed6a4aaa8614649ebd43a9be4c5082477cc0fb53b
parentfe55f86139ab66f8615d95bc6a1ca68e836eadbe (diff)
parent9fc4e5d1d60396c23ccd0915a99d046d82665cc6 (diff)
Merge "Define constant instead of literal "template_name""
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java7
1 files changed, 4 insertions, 3 deletions
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 <HeatTemplate> 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);