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 7b2c324573 ISIS-3208: minor cleanup
7b2c324573 is described below

commit 7b2c32457320cac019e51a446c45a2486ccaf59a
Author: Andi Huber <[email protected]>
AuthorDate: Wed Sep 14 13:51:17 2022 +0200

    ISIS-3208: minor cleanup
---
 .../isis/persistence/jpa/integration/entity/JpaEntityFacet.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/entity/JpaEntityFacet.java
 
b/persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/entity/JpaEntityFacet.java
index 0aa82be96b..b8821af9a0 100644
--- 
a/persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/entity/JpaEntityFacet.java
+++ 
b/persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/entity/JpaEntityFacet.java
@@ -253,9 +253,10 @@ public class JpaEntityFacet
         }
 
         val entityManager = getEntityManager();
+        val persistenceUnitUtil = getPersistenceUnitUtil(entityManager);
 
         if (entityManager.contains(pojo)) {
-            val primaryKey = 
getPersistenceUnitUtil(entityManager).getIdentifier(pojo);
+            val primaryKey = persistenceUnitUtil.getIdentifier(pojo);
             if (primaryKey == null) {
                 return EntityState.PERSISTABLE_ATTACHED_NO_OID;
             }
@@ -263,7 +264,7 @@ public class JpaEntityFacet
         }
 
         try {
-            val primaryKey = 
getPersistenceUnitUtil(entityManager).getIdentifier(pojo);
+            val primaryKey = persistenceUnitUtil.getIdentifier(pojo);
             if (primaryKey == null) {
                 return EntityState.PERSISTABLE_DETACHED;
             } else {
@@ -274,7 +275,8 @@ public class JpaEntityFacet
                     : EntityState.PERSISTABLE_DETACHED;
             }
         } catch (PersistenceException ex) {
-            // horrible hack, but encountered NPEs if using a composite key 
(eg CommandLogEntry) (this was without any weaving)
+            /* horrible hack, but encountered NPEs if using a composite key 
(eg CommandLogEntry)
+                (this was without any weaving) */
             Throwable cause = ex.getCause();
             if (cause instanceof DescriptorException) {
                 DescriptorException descriptorException = 
(DescriptorException) cause;

Reply via email to