FIX: Do not add AssocOne-generatedProperties if they should not. (#1106)

This commit is contained in:
Roland Praml authored and Rob Bygrave committed 2017-09-01 20:38:13 +12:00
1 parent f805bec8f2
commit 7336ce81bd
1 file changed
+7 -2
@@ -41,10 +41,15 @@ public class FactoryAssocOnes {
// typically generated 'who' created/modified properties
switch (mode) {
case INSERT:
list.add(new BindableAssocOneGeneratedInsert(one));
if (one.getGeneratedProperty().includeInInsert()) {
list.add(new BindableAssocOneGeneratedInsert(one));
}
break;
case UPDATE:
list.add(new BindableAssocOneGeneratedUpdate(one));
if (one.getGeneratedProperty().includeInUpdate()) {
// A 'Who Created property' is never updated
list.add(new BindableAssocOneGeneratedUpdate(one));
}
break;
}
}