Browse Source

Add missing hints for Hibernate `@TenantId`

Closes gh-32967
pull/33047/head
Sébastien Deleuze 2 years ago
parent
commit
c28a0d5627
  1. 8
      spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessor.java

8
spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessor.java

@ -219,6 +219,14 @@ class PersistenceManagedTypesBeanRegistrationAotProcessor implements BeanRegistr @@ -219,6 +219,14 @@ class PersistenceManagedTypesBeanRegistrationAotProcessor implements BeanRegistr
ReflectionUtils.doWithMethods(managedClass, method -> registerForReflection(reflection,
AnnotationUtils.findAnnotation(method, idGeneratorTypeClass), "value"));
}
Class<? extends Annotation> attributeBinderTypeClass = loadClass("org.hibernate.annotations.AttributeBinderType", classLoader);
if (attributeBinderTypeClass != null) {
ReflectionUtils.doWithFields(managedClass, field -> registerForReflection(reflection,
AnnotationUtils.findAnnotation(field, attributeBinderTypeClass), "binder"));
ReflectionUtils.doWithMethods(managedClass, method -> registerForReflection(reflection,
AnnotationUtils.findAnnotation(method, attributeBinderTypeClass), "binder"));
}
}
@Nullable

Loading…
Cancel
Save