From 87431482383425974c7a5a6c8955f6c11ef44972 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Tue, 2 Jul 2019 21:25:42 +1200 Subject: [PATCH] #1747 - Refactor BeanPropertyAssocOne.diff() next prefix --- .../ebeaninternal/server/deploy/BeanPropertyAssocOne.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/ebeaninternal/server/deploy/BeanPropertyAssocOne.java b/src/main/java/io/ebeaninternal/server/deploy/BeanPropertyAssocOne.java index bd6b3ed55..718a2d23b 100644 --- a/src/main/java/io/ebeaninternal/server/deploy/BeanPropertyAssocOne.java +++ b/src/main/java/io/ebeaninternal/server/deploy/BeanPropertyAssocOne.java @@ -390,10 +390,11 @@ public class BeanPropertyAssocOne extends BeanPropertyAssoc implements STr return; } + String nextPrefix = (prefix == null) ? name : prefix + "." + name; + if (embedded) { - prefix = (prefix == null) ? name : prefix + "." + name; BeanDescriptor 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 extends BeanPropertyAssoc 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); } } }