diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2009-02-06 21:51:27 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2009-02-06 21:51:27 +0000 |
commit | 7b9a86384107ac127b0007fd767131633f8ce786 (patch) | |
tree | ebe288d59770a8330e46c63b0127f05cac4e9294 /src/main/java/com/amazon/carbonado/repo | |
parent | 0040cf72f1a878d5e19253036ae38b09a6a48567 (diff) |
Fix index updates when derived index against joined storable is deleted.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java b/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java index 2cc3d8f..9176e92 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java @@ -88,7 +88,13 @@ class DerivedIndexesTrigger<S extends Storable, D extends Storable> extends Trig @Override
public void afterDelete(S storable, Object state) throws PersistException {
- updateValues(storable, state);
+ if (state != null) {
+ List<Storable> oldIndexEntries = (List<Storable>) state;
+ int size = oldIndexEntries.size();
+ for (int i=0; i<size; i++) {
+ oldIndexEntries.get(i).delete();
+ }
+ }
}
@Override
|