Add missing EntityManagerFactory hints for SharedEntityManagerCreator

Closes gh-30523
This commit is contained in:
Sébastien Deleuze
2023-05-23 11:13:57 +02:00
parent e92c9c5619
commit 424daede2f
2 changed files with 24 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.springframework.orm.jpa;
import jakarta.persistence.EntityManagerFactory;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.junit.jupiter.api.BeforeEach;
@@ -56,4 +57,10 @@ class EntityManagerRuntimeHintsTests {
assertThat(RuntimeHintsPredicates.proxies().forInterfaces(Session.class, EntityManagerProxy.class))
.accepts(this.hints);
}
@Test
void entityManagerFactoryHasReflectionHints() {
assertThat(RuntimeHintsPredicates.reflection().onMethod(EntityManagerFactory.class, "getCriteriaBuilder")).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onMethod(EntityManagerFactory.class, "getMetamodel")).accepts(this.hints);
}
}