(no commit message)
[utils] / support / general / src / main / java / org / wamblee / persistence / JpaMergeSupport.java
index be188e2dceccb5444c514abea4755e135208afd0..df1ce81d52aab52ee41d135f38220b1ad481f27d 100644 (file)
@@ -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 {