Register reflection hints for JPA persistence callbacks
Closes gh-29348
This commit is contained in:
@@ -20,6 +20,7 @@ import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.IdClass;
|
||||
import jakarta.persistence.PreRemove;
|
||||
|
||||
@Entity
|
||||
@IdClass(EmployeeId.class)
|
||||
@@ -59,4 +60,8 @@ public class Employee {
|
||||
public void setLocation(EmployeeLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@PreRemove
|
||||
public void preRemove() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ class PersistenceManagedTypesBeanRegistrationAotProcessorTests {
|
||||
.accepts(hints);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(Employee.class)
|
||||
.withMemberCategories(MemberCategory.DECLARED_FIELDS)).accepts(hints);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethod(Employee.class, "preRemove"))
|
||||
.accepts(hints);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(EmployeeId.class)
|
||||
.withMemberCategories(MemberCategory.DECLARED_FIELDS)).accepts(hints);
|
||||
assertThat(RuntimeHintsPredicates.reflection().onType(EmployeeLocationConverter.class)
|
||||
|
||||
Reference in New Issue
Block a user