summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-04-14 13:10:46 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-04-14 13:10:46 +0000
commitacbacf8fe5550bad7d98c7a8b4aa5b05e91f1263 (patch)
tree58fb62b7f06f13efa2b2cd4c0aa04d9d722c634c /src/main
parentb8ffe259a400c6b91c7570e7fef7fb7174245a39 (diff)
Use constants in after filter.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/StandardQuery.java22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
index 10fdf43..1ee3acb 100644
--- a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java
@@ -253,8 +253,6 @@ 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;
@@ -262,27 +260,15 @@ public abstract class StandardQuery<S extends Storable> extends AbstractQuery<S>
operator = RelOp.LT;
}
String propertyName = property.getChainedProperty().toString();
-
- values[i] = start.getPropertyValue(propertyName);
-
- orderFilter = orderFilter.or(lastSubFilter.and(propertyName, operator));
-
+ Object value = start.getPropertyValue(propertyName);
+ orderFilter = orderFilter.or(lastSubFilter.and(propertyName, operator, value));
if (++i >= orderings.size()) {
break;
}
-
- lastSubFilter = lastSubFilter.and(propertyName, RelOp.EQ);
- }
-
- 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]);
- }
+ lastSubFilter = lastSubFilter.and(propertyName, RelOp.EQ, value);
}
- return query;
+ return and(orderFilter);
}
public boolean tryDeleteOne() throws PersistException {