From eb3234656360fc3409b452c7bcb4e502b467fe35 Mon Sep 17 00:00:00 2001 From: Shadi Haidar Date: Thu, 6 Sep 2018 10:15:36 -0400 Subject: Inventory to support wild card in typeName Issue-ID: DCAEGEN2-749 Change-Id: I273f3f8e5466b170f42f3aef0ab21b0ff002be59 Signed-off-by: Shadi Haidar --- pom.xml | 2 +- .../io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e74dc68..d840ca7 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. org.onap.dcaegen2.platform inventory-api - 3.0.2 + 3.0.3 dcaegen2-platform-inventory-api diff --git a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java index 0cb108c..feafd20 100644 --- a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java +++ b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java @@ -94,9 +94,15 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService { } List whereClauses = new ArrayList<>(); - + if (typeName != null) { - whereClauses.add(":typeName = type_name"); + if (!typeName.contains("*")) { + whereClauses.add(":typeName = type_name"); + } + else { + typeName = typeName.replaceAll("\\*", "%"); + whereClauses.add("type_name LIKE :typeName"); + } } if (vnfType != null) { -- cgit 1.2.3-korg