diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-10-11 21:00:12 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-10-11 21:00:12 +0000 |
commit | 90bd381e91c873af5956da9e5f0cfa2b29675633 (patch) | |
tree | cce0002e09cf9315af243fcdc5b54f654e1780eb /src/main/java/com/amazon/carbonado/repo | |
parent | 9950a28e33755e95eb2d40dbe3b78108400ce029 (diff) |
Support sorting of arrays.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java | 2 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java index 73469db..2d7f983 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java @@ -287,7 +287,7 @@ class ManagedIndex<S extends Storable> implements IndexEntryAccessor<S> { buffer.close();
throw new UniqueConstraintException
("Cannot build unique index because duplicates exist: "
- + this);
+ + this + ", " + last + " == " + obj);
}
}
last = obj;
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 {
|