From f12b9657cbd868c106b49d90067a108d98bf94b5 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 14 May 2008 07:36:46 +0000 Subject: Fix reverse range filter. --- src/main/java/com/amazon/carbonado/repo/map/MapStorage.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java index 1457fae..a15796c 100644 --- a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java @@ -728,8 +728,14 @@ class MapStorage filter = filter.and(index.getProperty(i).getName(), RelOp.EQ); } - filter = filter.and(index.getProperty(i).getName(), - rangeEndBoundary == BoundaryType.INCLUSIVE ? RelOp.LE : RelOp.LT); + RelOp rangeOp; + if (reverseRange) { + rangeOp = rangeEndBoundary == BoundaryType.INCLUSIVE ? RelOp.GE : RelOp.GT; + } else { + rangeOp = rangeEndBoundary == BoundaryType.INCLUSIVE ? RelOp.LE : RelOp.LT; + } + + filter = filter.and(index.getProperty(i).getName(), rangeOp); filterValues = filter.initialFilterValues(); -- cgit v1.2.3