fix[proxy]: the annotations of the bean of the parent class cannot be scanned

This commit is contained in:
sun
2023-01-16 19:11:19 +08:00
parent e2522ac333
commit 06f716feb9
5 changed files with 6 additions and 28 deletions
@@ -421,7 +421,7 @@ public class OrmManager implements IOrmManager {
ReflectionUtils.makeAccessible(idField);
ReflectionUtils.setField(idField, entityInstance, idFiledValue);
var idMethodOptional = Arrays.stream(ReflectionUtils.getMethodsByNameInPOJOClass(clazz, "id"))
var idMethodOptional = Arrays.stream(ReflectionUtils.getAllMethods(clazz)).filter(it -> it.getName().equalsIgnoreCase("id"))
.filter(it -> it.getParameterCount() <= 0)
.findFirst();
AssertionUtils.isTrue(idMethodOptional.isPresent(), "实体类Entity[{}]必须重写id()方法", clazz.getSimpleName());