mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-09 08:40:39 +00:00
Add missing Hibernate reflection hints
This commit adds the missing reflection hints for Hibernate 8 support: `PersistenceUnitInfoDescriptor` and `StatelessSession`. Fixes gh-37247 Fixes gh-37249
This commit is contained in:
+9
@@ -19,6 +19,8 @@ package org.springframework.orm.jpa;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.StatelessSession;
|
||||
import org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -55,6 +57,7 @@ class EntityManagerRuntimeHintsTests {
|
||||
void entityManagerProxyHasHibernateHints() {
|
||||
assertThat(RuntimeHintsPredicates.proxies().forInterfaces(Session.class, EntityManagerProxy.class))
|
||||
.accepts(this.hints);
|
||||
assertThat(RuntimeHintsPredicates.proxies().forInterfaces(StatelessSession.class)).accepts(this.hints);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -63,4 +66,10 @@ class EntityManagerRuntimeHintsTests {
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(EntityManagerFactory.class, "getMetamodel")).accepts(this.hints);
|
||||
}
|
||||
|
||||
@Test
|
||||
void persistenceUnitInfoDescriptorHasReflectionHints() {
|
||||
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(PersistenceUnitInfoDescriptor.class, "getName"))
|
||||
.accepts(this.hints);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user