aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db-repositories/src/main
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-23 12:02:27 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-23 13:15:17 -0400
commit5aaf7f76c6632dcd4bea56b227648482ddde3a50 (patch)
treed96f2aa72c7774d7d87b6d2027cd46f1b44288fa /mso-api-handlers/mso-requests-db-repositories/src/main
parentad99d2f0c59ce54e7283c210418d1f234191718b (diff)
Bug fixes October 23rd
fixed the db status not being updated on delete SI added a default sequence flow to isAsync_Gateway Removed @Before and organized imports Added check to prevent db query with only requestStatus correct AAIObjectPlurals enum value name Correct rollbackData setting and protect against null Change-Id: Ic7c47dc968a29987c3d576da9aa50c7ddc8f28ee Issue-ID: SO-1162 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db-repositories/src/main')
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
index d66e378146..951f02e5d8 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
@@ -172,6 +172,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
final CriteriaBuilder cb = entityManager.getCriteriaBuilder();
final CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
final Root<InfraActiveRequests> tableRoot = crit.from(InfraActiveRequests.class);
+ InfraActiveRequests infraActiveRequests = null;
if (instanceName != null && !instanceName.equals("")) {
@@ -229,18 +230,17 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
}
}
}
-
- predicates.add(tableRoot.get(REQUEST_STATUS)
+ if(!predicates.isEmpty()){
+ predicates.add(tableRoot.get(REQUEST_STATUS)
.in(Arrays.asList("PENDING", "IN_PROGRESS", "TIMEOUT", "PENDING_MANUAL_TASK")));
- final Order order = cb.desc(tableRoot.get(START_TIME));
-
- final List<InfraActiveRequests> dupList = executeInfraQuery(crit, predicates, order);
-
- InfraActiveRequests infraActiveRequests = null;
-
- if (dupList != null && !dupList.isEmpty()) {
- infraActiveRequests = dupList.get(0);
+ final Order order = cb.desc(tableRoot.get(START_TIME));
+
+ final List<InfraActiveRequests> dupList = executeInfraQuery(crit, predicates, order);
+
+ if (dupList != null && !dupList.isEmpty()) {
+ infraActiveRequests = dupList.get(0);
+ }
}
return infraActiveRequests;