summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorableGenerator.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
index be23563..0fa8708 100644
--- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
+++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
@@ -580,8 +580,12 @@ public final class StorableGenerator<S extends Storable> {
if (!property.isDerived()) {
if (property.isJoin()) {
// If generating wrapper, property access is not guarded by
- // synchronization. Mark as volatile instead.
- mClassFile.addField(Modifiers.PRIVATE.toVolatile(mGenMode == GEN_WRAPPED),
+ // synchronization. Mark as volatile instead. Also mark as
+ // transient since join properties can be reconstructed from
+ // the other fields.
+ mClassFile.addField(Modifiers.PRIVATE
+ .toVolatile(mGenMode == GEN_WRAPPED)
+ .toTransient(true),
name, type);
requireStateField = true;
} else if (mGenMode == GEN_ABSTRACT) {