diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2006-11-23 00:30:42 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2006-11-23 00:30:42 +0000 |
commit | 017b1aee4eb9a460a484aa58f9f17200d43cec15 (patch) | |
tree | b74506384aa260c326ee9646ef14430659be46da /src/main/java/com | |
parent | 579aa77f7ead94863d1f0c56d450b3bd2800f8db (diff) |
Fixed bug when passing constants with 'and' or 'or' query ops.
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/amazon/carbonado/qe/StandardQuery.java | 10 |
1 files changed, 8 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 c1038c7..ec9bf4e 100644 --- a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java +++ b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java @@ -143,8 +143,11 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S> if (mValues == null) {
newValues = filter.initialFilterValues();
} else {
+ if (getBlankParameterCount() > 0) {
+ throw new IllegalStateException("Blank parameters exist in query: " + this);
+ }
newValues = mValues.getFilter().and(filter)
- .initialFilterValues().withValues(mValues.getValues());
+ .initialFilterValues().withValues(mValues.getSuppliedValues());
}
return createQuery(newValues, mOrdering);
}
@@ -153,8 +156,11 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S> if (mValues == null) {
throw new IllegalStateException("Query is already guaranteed to fetch everything");
}
+ if (getBlankParameterCount() > 0) {
+ throw new IllegalStateException("Blank parameters exist in query: " + this);
+ }
FilterValues<S> newValues = mValues.getFilter().or(filter)
- .initialFilterValues().withValues(mValues.getValues());
+ .initialFilterValues().withValues(mValues.getSuppliedValues());
return createQuery(newValues, mOrdering);
}
|