X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fpersistence%2FJpaMergeSupport.java;h=df1ce81d52aab52ee41d135f38220b1ad481f27d;hb=a222299a510f0a922dfa0a555ea06e1024cc4d64;hp=be188e2dceccb5444c514abea4755e135208afd0;hpb=820c55dae3f92efe95ff8a3f4a9b5ea474f7d8d0;p=utils diff --git a/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java b/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java index be188e2d..df1ce81d 100644 --- a/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java +++ b/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java @@ -81,7 +81,7 @@ public class JpaMergeSupport { /** * Copies primary keys and version from the result of the merged to the * object that was passed to the merge operation. It does this by traversing - * the properties of the object. It copies the primary key and version for + * the public properties of the object. It copies the primary key and version for * objects that implement {@link Persistent} and applies the same rules to * objects in maps and sets as well (i.e. recursively). * @@ -152,7 +152,11 @@ public class JpaMergeSupport { for (Method getter : methods) { if ((getter.getName().startsWith("get") || getter.getName() .startsWith("is")) && - !Modifier.isStatic(getter.getModifiers())) { + !Modifier.isStatic(getter.getModifiers()) && + Modifier.isPublic(getter.getModifiers()) && + getter.getParameterTypes().length == 0 && + getter.getReturnType() != Void.class + ) { Class returnType = getter.getReturnType(); try {