#463 - ENH: Add @DraftReset support - property that is set to null on the draft been when it is published (@Draftable feature)

This commit is contained in:
Robin Bygrave committed 2015-11-25 11:06:14 +13:00
1 parent 5f194f066a
commit 4f51a3b130
7 files changed
+132 -22

No files matched your search

@@ -227,6 +227,8 @@ public class BeanProperty implements ElPropertyValue {
final boolean draftDirty;
final boolean draftReset;
final boolean indexed;
final String indexName;
@@ -255,6 +257,7 @@ public class BeanProperty implements ElPropertyValue {
this.excludedFromHistory = deploy.isExcludedFromHistory();
this.draftDirty = deploy.isDraftDirty();
this.draftOnly = deploy.isDraftOnly();
this.draftReset = deploy.isDraftReset();
this.secondaryTable = deploy.isSecondaryTable();
if (secondaryTable) {
@@ -341,6 +344,7 @@ public class BeanProperty implements ElPropertyValue {
this.excludedFromHistory = source.excludedFromHistory;
this.draftDirty = source.draftDirty;
this.draftOnly = source.draftOnly;
this.draftReset = source.draftReset;
this.fetchEager = source.fetchEager;
this.unidirectionalShadow = source.unidirectionalShadow;
this.discriminator = source.discriminator;
@@ -1045,6 +1049,13 @@ public class BeanProperty implements ElPropertyValue {
return draftDirty;
}
/**
* Return true if this property is reset/cleared on publish (on the draft bean).
*/
public boolean isDraftReset() {
return draftReset;
}
/**
* Return true if this property should be included in an Insert.
*/