/**
* 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).
*
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 {