From 017b1aee4eb9a460a484aa58f9f17200d43cec15 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 23 Nov 2006 00:30:42 +0000 Subject: Fixed bug when passing constants with 'and' or 'or' query ops. --- src/main/java/com/amazon/carbonado/qe/StandardQuery.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') 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 extends AbstractQuery 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 extends AbstractQuery 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 newValues = mValues.getFilter().or(filter) - .initialFilterValues().withValues(mValues.getValues()); + .initialFilterValues().withValues(mValues.getSuppliedValues()); return createQuery(newValues, mOrdering); } -- cgit v1.2.3