You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/12/17 11:18:14 UTC

[isis] branch master updated: ISIS-2294: fixes JPA attached/detached detection logic

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e4d4a4  ISIS-2294: fixes JPA attached/detached detection logic
4e4d4a4 is described below

commit 4e4d4a4693cb6dc98451b0ae602e9ebf265bb75c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Dec 17 12:17:59 2020 +0100

    ISIS-2294: fixes JPA attached/detached detection logic
---
 .../isis/persistence/jpa/metamodel/JpaEntityFacetFactory.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/persistence/jpa/model/src/main/java/org/apache/isis/persistence/jpa/metamodel/JpaEntityFacetFactory.java b/persistence/jpa/model/src/main/java/org/apache/isis/persistence/jpa/metamodel/JpaEntityFacetFactory.java
index 44cf794..efa00e6 100644
--- a/persistence/jpa/model/src/main/java/org/apache/isis/persistence/jpa/metamodel/JpaEntityFacetFactory.java
+++ b/persistence/jpa/model/src/main/java/org/apache/isis/persistence/jpa/metamodel/JpaEntityFacetFactory.java
@@ -237,12 +237,12 @@ public class JpaEntityFacetFactory extends FacetFactoryAbstract {
             }
             
             val entityManager = getEntityManager();
-            val persistenceUnitUtil = getPersistenceUnitUtil(entityManager);
             
-            if(persistenceUnitUtil.isLoaded(pojo)) {
+            if(entityManager.contains(pojo)) {
                 return EntityState.PERSISTABLE_ATTACHED;
             }
-            //TODO how to determine whether deleted? (even relevant?)
+
+            //TODO[2033] how to determine whether deleted? (even relevant?)
 //            if(isDeleted) {
 //                return EntityState.PERSISTABLE_DESTROYED;
 //            }