summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2009-04-16 17:57:25 +0000
committerBrian S. O'Neill <bronee@gmail.com>2009-04-16 17:57:25 +0000
commit423b9acc47e05b6574e46665633352d8b42fea9a (patch)
treebc95aaf7a174c3d404cf1e43a05b1421a73fa1d2 /src
parentd5b5dc9e2082692b2d87553e4501ef2e5c8f2a64 (diff)
Combining queries which contain sub-filters should not share values among sub-elements.
Diffstat (limited to 'src')
-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());