aboutsummaryrefslogtreecommitdiffstats
path: root/models-dao/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'models-dao/src/main/java/org')
-rw-r--r--models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java3
-rw-r--r--models-dao/src/main/java/org/onap/policy/models/dao/impl/PfNonTimestampKeyFilter.java2
-rw-r--r--models-dao/src/main/java/org/onap/policy/models/dao/impl/PfReferenceTimestampKeyFilter.java2
-rw-r--r--models-dao/src/main/java/org/onap/policy/models/dao/impl/PfTimestampKeyFilter.java2
4 files changed, 8 insertions, 1 deletions
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java b/models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java
index ef9d4f939..fbe81b3ff 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java
@@ -38,6 +38,7 @@ public abstract class PfFilter {
private String timeStampEndFilter;
private String timeStampFilter;
private String nameParameter;
+ private String keyPrefix;
/**
* Generates filter string.
@@ -59,7 +60,7 @@ public abstract class PfFilter {
StringBuilder filterQueryString = new StringBuilder(inputFilterString);
if (filterMap != null) {
for (String key : filterMap.keySet()) {
- filterQueryString.append("c." + key + "= :" + key + AND);
+ filterQueryString.append(getKeyPrefix() + key + "= :" + key + AND);
}
}
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfNonTimestampKeyFilter.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfNonTimestampKeyFilter.java
index 9c9a3e844..ac3224022 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfNonTimestampKeyFilter.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfNonTimestampKeyFilter.java
@@ -32,6 +32,7 @@ public class PfNonTimestampKeyFilter extends PfFilter {
private static final String TIMESTAMP_END_FILTER = "c.timeStamp <= :endTime";
private static final String TIMESTAMP_FILTER = " c.timeStamp ";
private static final String NAME_PARAMETER = "name";
+ private static final String KEY_PREFIX = "c.";
/**
* The default constructor injects query strings.
@@ -42,5 +43,6 @@ public class PfNonTimestampKeyFilter extends PfFilter {
setTimeStampEndFilter(TIMESTAMP_END_FILTER);
setTimeStampFilter(TIMESTAMP_FILTER);
setNameParameter(NAME_PARAMETER);
+ setKeyPrefix(KEY_PREFIX);
}
}
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfReferenceTimestampKeyFilter.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfReferenceTimestampKeyFilter.java
index 53802f306..42b05c19b 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfReferenceTimestampKeyFilter.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfReferenceTimestampKeyFilter.java
@@ -32,6 +32,7 @@ public class PfReferenceTimestampKeyFilter extends PfFilter {
private static final String TIMESTAMP_END_FILTER = "c.key.timeStamp <= :endTime";
private static final String TIMESTAMP_FILTER = " c.key.timeStamp ";
private static final String NAME_PARAMETER = "parentKeyName";
+ private static final String KEY_PREFIX = "c.key.referenceKey.";
/**
* The default constructor injects query strings.
@@ -42,5 +43,6 @@ public class PfReferenceTimestampKeyFilter extends PfFilter {
setTimeStampEndFilter(TIMESTAMP_END_FILTER);
setTimeStampFilter(TIMESTAMP_FILTER);
setNameParameter(NAME_PARAMETER);
+ setKeyPrefix(KEY_PREFIX);
}
}
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfTimestampKeyFilter.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfTimestampKeyFilter.java
index f01f80498..f8d4fa833 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfTimestampKeyFilter.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/PfTimestampKeyFilter.java
@@ -32,6 +32,7 @@ public class PfTimestampKeyFilter extends PfFilter {
private static final String TIMESTAMP_END_FILTER = "c.key.timeStamp <= :endTime";
private static final String TIMESTAMP_FILTER = " c.key.timeStamp ";
private static final String NAME_PARAMETER = "name";
+ private static final String KEY_PREFIX = "c.";
/**
* The default constructor injects query strings.
@@ -42,5 +43,6 @@ public class PfTimestampKeyFilter extends PfFilter {
setTimeStampEndFilter(TIMESTAMP_END_FILTER);
setTimeStampFilter(TIMESTAMP_FILTER);
setNameParameter(NAME_PARAMETER);
+ setKeyPrefix(KEY_PREFIX);
}
}