Skip to content

Commit

Permalink
Upgrade to JPA 3.2.
Browse files Browse the repository at this point in the history
Closes #3673
  • Loading branch information
mp911de committed Nov 29, 2024
1 parent c155be9 commit 7f91dd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<hibernate-70-snapshots>7.0.0-SNAPSHOT</hibernate-70-snapshots>
<hsqldb>2.7.4</hsqldb>
<h2>2.3.232</h2>
<jakarta-persistence-api>3.1.0</jakarta-persistence-api>
<jakarta-persistence-api>3.2.0</jakarta-persistence-api>
<jsqlparser>5.0</jsqlparser>
<mysql-connector-java>9.1.0</mysql-connector-java>
<postgresql>42.7.4</postgresql>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public class TestMetaModel implements Metamodel {
private final Set<Class<?>> managedTypes;
private final Lazy<EntityManagerFactory> entityManagerFactory = Lazy.of(this::init);
private final Lazy<Metamodel> metamodel = Lazy.of(() -> entityManagerFactory.get().getMetamodel());
private Lazy<EntityManager> enityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager());
private final Lazy<EntityManager> entityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager());

TestMetaModel(Set<Class<?>> managedTypes) {
private TestMetaModel(Set<Class<?>> managedTypes) {
this("dynamic-tests", managedTypes);
}

TestMetaModel(String persistenceUnit, Set<Class<?>> managedTypes) {
private TestMetaModel(String persistenceUnit, Set<Class<?>> managedTypes) {
this.persistenceUnit = persistenceUnit;
this.managedTypes = managedTypes;
}
Expand All @@ -66,6 +66,11 @@ public <X> EntityType<X> entity(Class<X> cls) {
return metamodel.get().entity(cls);
}

@Override
public EntityType<?> entity(String s) {
return metamodel.get().entity(s);
}

public <X> ManagedType<X> managedType(Class<X> cls) {
return metamodel.get().managedType(cls);
}
Expand All @@ -87,7 +92,7 @@ public Set<EmbeddableType<?>> getEmbeddables() {
}

public EntityManager entityManager() {
return enityManager.get();
return entityManager.get();
}

EntityManagerFactory init() {
Expand Down

0 comments on commit 7f91dd1

Please sign in to comment.