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 00531e63da ISIS-2651: simplify: actually we have to assume, that if we 
instantiate a DN PMF, the PersistanceStack in use is JDO and not JPA
00531e63da is described below

commit 00531e63dad07516b7c81f1abd1ef55a8024cfdd
Author: Andi Huber <[email protected]>
AuthorDate: Fri May 20 16:04:57 2022 +0200

    ISIS-2651: simplify: actually we have to assume, that if we instantiate
    a DN PMF, the PersistanceStack in use is JDO and not JPA
    
    - the IsisBeanTypeClassifier yet is not smart enough to categorize
    entities by stack (JDO/JPA) - hope is, we don't need that anyway
---
 .../org/apache/isis/core/config/beans/IsisBeanTypeRegistry.java   | 6 ------
 .../jdo/datanucleus/IsisModulePersistenceJdoDatanucleus.java      | 8 ++++----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git 
a/core/config/src/main/java/org/apache/isis/core/config/beans/IsisBeanTypeRegistry.java
 
b/core/config/src/main/java/org/apache/isis/core/config/beans/IsisBeanTypeRegistry.java
index bb8f9f0557..575827c26d 100644
--- 
a/core/config/src/main/java/org/apache/isis/core/config/beans/IsisBeanTypeRegistry.java
+++ 
b/core/config/src/main/java/org/apache/isis/core/config/beans/IsisBeanTypeRegistry.java
@@ -55,12 +55,6 @@ public interface IsisBeanTypeRegistry {
                 .map(IsisBeanMetaData::getBeanName);
     }
 
-    default Set<Class<?>> getEntityTypes(final PersistenceStack 
persistenceStack) {
-        return determineCurrentPersistenceStack().equals(persistenceStack)
-                ? getEntityTypes()
-                : Set.of();
-    }
-
     /**
      * Returns either 'JDO' or 'JPA' based on what {@link 
IsisBeanTypeClassifier} we find
      * registered with <i>Spring</i>.
diff --git 
a/persistence/jdo/datanucleus/src/main/java/org/apache/isis/persistence/jdo/datanucleus/IsisModulePersistenceJdoDatanucleus.java
 
b/persistence/jdo/datanucleus/src/main/java/org/apache/isis/persistence/jdo/datanucleus/IsisModulePersistenceJdoDatanucleus.java
index e2cf1e8e17..1d175f5c6a 100644
--- 
a/persistence/jdo/datanucleus/src/main/java/org/apache/isis/persistence/jdo/datanucleus/IsisModulePersistenceJdoDatanucleus.java
+++ 
b/persistence/jdo/datanucleus/src/main/java/org/apache/isis/persistence/jdo/datanucleus/IsisModulePersistenceJdoDatanucleus.java
@@ -42,7 +42,6 @@ import org.apache.isis.commons.internal.assertions._Assert;
 import org.apache.isis.commons.internal.base._NullSafe;
 import org.apache.isis.core.config.IsisConfiguration;
 import org.apache.isis.core.config.beans.IsisBeanTypeRegistry;
-import org.apache.isis.core.config.beans.PersistenceStack;
 import 
org.apache.isis.core.config.beans.aoppatch.TransactionInterceptorFactory;
 import org.apache.isis.core.metamodel.context.MetaModelContext;
 import org.apache.isis.core.transaction.changetracking.EntityChangeTracker;
@@ -218,14 +217,15 @@ public class IsisModulePersistenceJdoDatanucleus {
         if(_NullSafe.isEmpty(jdoEntityDiscoveryListeners)) {
             return;
         }
-        val jdoEntityTypes = 
beanTypeRegistry.getEntityTypes(PersistenceStack.JDO);
+        // assuming, as we instantiate a DN PMF, all entities discovered are 
JDO entities
+        val jdoEntityTypes = beanTypeRegistry.getEntityTypes();
         if(_NullSafe.isEmpty(jdoEntityTypes)) {
             return;
         }
         val jdoEntityTypesView = Collections.unmodifiableSet(jdoEntityTypes);
         val dnProps = 
Collections.unmodifiableMap(dnSettings.getAsProperties());
-        _NullSafe.stream(jdoEntityDiscoveryListeners)
-                .forEach(listener->
+        jdoEntityDiscoveryListeners
+            .forEach(listener->
                     listener.onEntitiesDiscovered(pmf, jdoEntityTypesView, 
dnProps));
     }
 

Reply via email to