#1747 - Refactor BeanPropertyAssocOne.diff() next prefix

This commit is contained in:
rob bygrave committed 2019-07-02 21:25:42 +12:00
1 parent 68db6723d0
commit 8743148238
1 file changed
+4 -4
@@ -390,10 +390,11 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
return;
}
String nextPrefix = (prefix == null) ? name : prefix + "." + name;
if (embedded) {
prefix = (prefix == null) ? name : prefix + "." + name;
BeanDescriptor<T> targetDescriptor = getTargetDescriptor();
targetDescriptor.diff(prefix, map, (EntityBean) newEmb, (EntityBean) oldEmb);
targetDescriptor.diff(nextPrefix, map, (EntityBean) newEmb, (EntityBean) oldEmb);
} else {
// we are only interested in the Id value
@@ -406,8 +407,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
Object newId = (newBean == null) ? null : idProperty.getValue(newBean);
Object oldId = (oldBean == null) ? null : idProperty.getValue(oldBean);
if (newId != null || oldId != null) {
prefix = (prefix == null) ? name : prefix + "." + name;
idProperty.diffVal(prefix, map, newId, oldId);
idProperty.diffVal(nextPrefix, map, newId, oldId);
}
}
}