From 7e7b07f996cd66996aa1c23f8a33fa1574eb7174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Tue, 22 Mar 2022 12:31:00 +0100 Subject: [PATCH] Panache EntityBase should document that it uses the right entity manager Fixes #24394 --- .../hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt | 3 +-- .../quarkus/hibernate/orm/panache/PanacheRepositoryBase.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt index 17720af46af8c..5f8b8cc156801 100644 --- a/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt +++ b/extensions/panache/hibernate-orm-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/orm/panache/kotlin/PanacheRepositoryBase.kt @@ -1,6 +1,5 @@ package io.quarkus.hibernate.orm.panache.kotlin -import io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations import io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.implementationInjectionMissing import io.quarkus.hibernate.orm.panache.kotlin.runtime.KotlinJpaOperations.Companion.INSTANCE import io.quarkus.panache.common.Parameters @@ -86,7 +85,7 @@ interface PanacheRepositoryBase { fun isPersistent(entity: Entity): Boolean = INSTANCE.isPersistent(entity) /** - * Flushes all pending changes to the database using the default EntityManager. + * Flushes all pending changes to the database using the EntityManager for the entity class. */ fun flush() { getEntityManager().flush() diff --git a/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/PanacheRepositoryBase.java b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/PanacheRepositoryBase.java index b286375f3c239..f2d68f285bd9e 100644 --- a/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/PanacheRepositoryBase.java +++ b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/PanacheRepositoryBase.java @@ -109,10 +109,10 @@ default boolean isPersistent(Entity entity) { } /** - * FFlushes all pending changes to the database using the default EntityManager. + * Flushes all pending changes to the database using the EntityManager for the entity class. */ default void flush() { - INSTANCE.getEntityManager().flush(); + getEntityManager().flush(); } // Queries