summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-04-15 16:13:37 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-04-15 16:13:37 +0000
commit80feb9546265d9c0feb9837e6cca041dbffc222d (patch)
tree5b130a2f839f726948fd8c6fd60b3a2ab3ae13c7 /src/main/java
parentd4b30d06d7bf1107860f2c98ec2db501d28306a5 (diff)
Revert to original "after" filter construction, but ensure property filters are bound.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/StandardQuery.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
index 3137d3c..71ad1e6 100644
--- a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
@@ -222,6 +222,8 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S>
Filter<S> orderFilter = Filter.getClosedFilter(storableType);
Filter<S> lastSubFilter = Filter.getOpenFilter(storableType);
+ Object[] values = new Object[orderings.size()];
+
for (int i=0;;) {
OrderedProperty<S> property = orderings.get(i);
RelOp operator = RelOp.GT;
@@ -229,15 +231,27 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S>
operator = RelOp.LT;
}
String propertyName = property.getChainedProperty().toString();
- Object value = start.getPropertyValue(propertyName);
- orderFilter = orderFilter.or(lastSubFilter.and(propertyName, operator, value));
+
+ values[i] = start.getPropertyValue(propertyName);
+
+ orderFilter = orderFilter.or(lastSubFilter.and(propertyName, operator));
+
if (++i >= orderings.size()) {
break;
}
- lastSubFilter = lastSubFilter.and(propertyName, RelOp.EQ, value);
+
+ lastSubFilter = lastSubFilter.and(propertyName, RelOp.EQ).bind();
+ }
+
+ Query<S> query = this.and(orderFilter);
+
+ for (int i=0; i<values.length; i++) {
+ for (int j=0; j<=i; j++) {
+ query = query.with(values[j]);
+ }
}
- return and(orderFilter);
+ return query;
}
public Cursor<S> fetch() throws FetchException {