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

This commit is contained in:
Roland Praml
2017-09-01 20:38:13 +12:00
committed by Rob Bygrave
parent f805bec8f2
commit 7336ce81bd
@@ -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;
}
}