[#7953] Discover JPA annotations also from overridden super class methods
This commit is contained in:
parent
64526434ac
commit
c128561d45
@ -225,12 +225,10 @@ public class DefaultRecordUnmapper<E, R extends Record> implements RecordUnmappe
|
||||
}
|
||||
|
||||
// Use only the first applicable method or member
|
||||
if (method != null) {
|
||||
if (method != null)
|
||||
Tools.setValue(record, field, method.invoke(source));
|
||||
}
|
||||
else if (members.size() > 0) {
|
||||
else if (members.size() > 0)
|
||||
setValue(record, source, members.get(0), field);
|
||||
}
|
||||
}
|
||||
|
||||
return (R) record;
|
||||
|
||||
@ -3223,7 +3223,7 @@ final class Tools {
|
||||
|
||||
if (suffix != null) {
|
||||
try {
|
||||
Method setter = type.getMethod("set" + suffix, method.getReturnType());
|
||||
Method setter = type.getDeclaredMethod("set" + suffix, method.getReturnType());
|
||||
|
||||
// Setter annotation is more relevant
|
||||
if (setter.getAnnotation(Column.class) == null)
|
||||
@ -3369,6 +3369,15 @@ final class Tools {
|
||||
if ((method.getModifiers() & Modifier.STATIC) == 0)
|
||||
result.add(method);
|
||||
|
||||
do {
|
||||
for (Method method : type.getDeclaredMethods())
|
||||
if ((method.getModifiers() & Modifier.STATIC) == 0)
|
||||
result.add(method);
|
||||
|
||||
type = type.getSuperclass();
|
||||
}
|
||||
while (type != null);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user