From 80feb9546265d9c0feb9837e6cca041dbffc222d Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 15 Apr 2008 16:13:37 +0000 Subject: Revert to original "after" filter construction, but ensure property filters are bound. --- .../com/amazon/carbonado/qe/StandardQuery.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/amazon') 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 extends AbstractQuery Filter orderFilter = Filter.getClosedFilter(storableType); Filter lastSubFilter = Filter.getOpenFilter(storableType); + Object[] values = new Object[orderings.size()]; + for (int i=0;;) { OrderedProperty property = orderings.get(i); RelOp operator = RelOp.GT; @@ -229,15 +231,27 @@ public abstract class StandardQuery extends AbstractQuery 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 query = this.and(orderFilter); + + for (int i=0; i fetch() throws FetchException { -- cgit v1.2.3