From 49f38ff32c2323f5460e18ee300eff015bbd8772 Mon Sep 17 00:00:00 2001 From: eyalholz Date: Thu, 27 Jul 2017 20:37:54 +0300 Subject: fixed for defect SO-70 - recipe lookup mechanism doesn't allow to define default recipe mapping for any 'source' at level of 'service' and 'network' resources. Change-Id: I42dafa343e2e65c6e892c21de5f3f1131890b24e Signed-off-by: eyalholz --- .../java/org/openecomp/mso/db/catalog/CatalogDatabase.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mso-catalog-db') 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 fcdaff7395..7ddaedcd30 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 @@ -514,6 +514,19 @@ public class CatalogDatabase implements Closeable { 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 getServiceRecipes (int serviceId) { StringBuilder hql = null; -- cgit 1.2.3-korg