summaryrefslogtreecommitdiffstats
path: root/models-dao
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-02-12 19:27:42 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-12 19:27:42 +0000
commitad1cd2013f45da5764fc9610db1f679d3c3762cb (patch)
tree08be2a65176032ccd8865dffaab0362449331e5c /models-dao
parent35867f2e63c26d47417bfefc9a0912f17c4a873a (diff)
parent88bcb550c2efd5e43ad3d256fe075a6bf7e90538 (diff)
Merge "Implement validation and hierarchical get"
Diffstat (limited to 'models-dao')
-rw-r--r--models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
index b3d72a3fd..6707e70a2 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
@@ -26,11 +26,13 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
+
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.TypedQuery;
import javax.ws.rs.core.Response;
+
import org.onap.policy.models.base.PfConcept;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
@@ -411,6 +413,9 @@ public class DefaultPfDao implements PfDao {
final EntityManager mg = getEntityManager();
try {
final T t = mg.find(someClass, key);
+ if (t != null) {
+ mg.refresh(t);
+ }
return checkAndReturn(someClass, t);
} finally {
mg.close();
@@ -425,6 +430,9 @@ public class DefaultPfDao implements PfDao {
final EntityManager mg = getEntityManager();
try {
final T t = mg.find(someClass, key);
+ if (t != null) {
+ mg.refresh(t);
+ }
return checkAndReturn(someClass, t);
} finally {
mg.close();
@@ -439,6 +447,9 @@ public class DefaultPfDao implements PfDao {
final EntityManager mg = getEntityManager();
try {
final T t = mg.find(someClass, key);
+ if (t != null) {
+ mg.refresh(t);
+ }
return checkAndReturn(someClass, t);
} finally {
mg.close();