diff options
Diffstat (limited to 'models-dao')
-rw-r--r-- | models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java | 11 |
1 files changed, 8 insertions, 3 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 ef86c177b..bdbc04e22 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 @@ -367,7 +367,7 @@ public class DefaultPfDao implements PfDao { try { if (filterMap != null) { - filterQueryString = buildFilter(filterMap, filterQueryString); + filterQueryString = buildFilter(filterMap, filterQueryString, isRefTimestampKey(someClass)); } filterQueryString = addKeyFilterString(filterQueryString, name, startTime, endTime, isRefTimestampKey(someClass)); @@ -425,10 +425,15 @@ public class DefaultPfDao implements PfDao { } } - private String buildFilter(final Map<String, Object> filterMap, String filterQueryString) { + private String buildFilter(final Map<String, Object> filterMap, String filterQueryString, + boolean isRefTimestampKey) { StringBuilder bld = new StringBuilder(filterQueryString); for (String key : filterMap.keySet()) { - bld.append("c." + key + "= :" + key + AND); + if (isRefTimestampKey) { + bld.append("c.key.referenceKey." + key + "= :" + key + AND); + } else { + bld.append("c." + key + "= :" + key + AND); + } } return bld.toString(); } |