From 7f91dd1a3221b2efc6d705906d81297a67110248 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 25 Nov 2024 09:10:28 +0100 Subject: [PATCH] Upgrade to JPA 3.2. Closes #3673 --- pom.xml | 2 +- .../data/jpa/util/TestMetaModel.java | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 38a9a14796..c90ec22407 100755 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 7.0.0-SNAPSHOT 2.7.4

2.3.232

- 3.1.0 + 3.2.0 5.0 9.1.0 42.7.4 diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/util/TestMetaModel.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/util/TestMetaModel.java index a755ba222b..822365b65a 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/util/TestMetaModel.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/util/TestMetaModel.java @@ -43,13 +43,13 @@ public class TestMetaModel implements Metamodel { private final Set> managedTypes; private final Lazy entityManagerFactory = Lazy.of(this::init); private final Lazy metamodel = Lazy.of(() -> entityManagerFactory.get().getMetamodel()); - private Lazy enityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager()); + private final Lazy entityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager()); - TestMetaModel(Set> managedTypes) { + private TestMetaModel(Set> managedTypes) { this("dynamic-tests", managedTypes); } - TestMetaModel(String persistenceUnit, Set> managedTypes) { + private TestMetaModel(String persistenceUnit, Set> managedTypes) { this.persistenceUnit = persistenceUnit; this.managedTypes = managedTypes; } @@ -66,6 +66,11 @@ public EntityType entity(Class cls) { return metamodel.get().entity(cls); } + @Override + public EntityType entity(String s) { + return metamodel.get().entity(s); + } + public ManagedType managedType(Class cls) { return metamodel.get().managedType(cls); } @@ -87,7 +92,7 @@ public Set> getEmbeddables() { } public EntityManager entityManager() { - return enityManager.get(); + return entityManager.get(); } EntityManagerFactory init() {