summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorableGenerator.java3
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/DerivedIndexesTrigger.java8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
index 5e1d1fc..87dede1 100644
--- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
+++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
@@ -826,6 +826,9 @@ public final class StorableGenerator<S extends Storable> {
int count = property.getJoinElementCount();
for (int i=0; i<count; i++) {
StorableProperty internal = property.getInternalJoinElement(i);
+ if (internal.getWriteMethod() == null) {
+ continue;
+ }
StorableProperty external = property.getExternalJoinElement(i);
b.loadLocal(b.getParameter(0));
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