From 90bd381e91c873af5956da9e5f0cfa2b29675633 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 11 Oct 2007 21:00:12 +0000 Subject: Support sorting of arrays. --- .../carbonado/repo/replicated/ReplicatedRepository.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo/replicated') diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java index 2c73200..b28fab5 100644 --- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java @@ -24,8 +24,6 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.cojen.util.BeanComparator; - import com.amazon.carbonado.CorruptEncodingException; import com.amazon.carbonado.Cursor; import com.amazon.carbonado.FetchException; @@ -49,6 +47,8 @@ import com.amazon.carbonado.capability.ResyncCapability; import com.amazon.carbonado.capability.ShutdownCapability; import com.amazon.carbonado.capability.StorableInfoCapability; +import com.amazon.carbonado.cursor.SortedCursor; + import com.amazon.carbonado.info.Direction; import com.amazon.carbonado.info.StorableInfo; import com.amazon.carbonado.info.StorableIntrospector; @@ -389,11 +389,7 @@ class ReplicatedRepository } } - BeanComparator bc = BeanComparator.forClass(type); - for (String order : orderBy) { - bc = bc.orderBy(order); - bc = bc.caseSensitive(); - } + Comparator comparator = SortedCursor.createComparator(type, orderBy); replicaQuery = replicaQuery.orderBy(orderBy); masterQuery = masterQuery.orderBy(orderBy); @@ -417,7 +413,7 @@ class ReplicatedRepository replicaStorage, replicaQuery, masterStorage, masterQuery, throttle, desiredSpeed, - bc, replicaTxn); + comparator, replicaTxn); replicaTxn.commit(); } finally { -- cgit v1.2.3