summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/StandardQuery.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
index 736f31f..c86a5f3 100644
--- a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
@@ -163,7 +163,9 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S>
if (getBlankParameterCount() > 0) {
throw new IllegalStateException("Blank parameters exist in query: " + this);
}
- newFilter = mFilter.and(filter);
+ // Unbind is required to ensure sub-filters with common elements
+ // don't share values.
+ newFilter = mFilter.unbind().and(filter);
newValues = newFilter.initialFilterValues();
if (mValues != null) {
newValues = newValues.withValues(mValues.getSuppliedValues());
@@ -179,7 +181,9 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S>
if (getBlankParameterCount() > 0) {
throw new IllegalStateException("Blank parameters exist in query: " + this);
}
- Filter<S> newFilter = mFilter.or(filter);
+ // Unbind is required to ensure sub-filters with common elements don't
+ // share values.
+ Filter<S> newFilter = mFilter.unbind().or(filter);
FilterValues<S> newValues = newFilter.initialFilterValues();
if (mValues != null) {
newValues = newValues.withValues(mValues.getSuppliedValues());