incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1344519 - in /incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src: main/java/org/apache/isis/extensions/ main/java/org/apache/isis/extensions/jpa/ main/java/org/apache/isis/extensions/jpa/metamodel/ main/java/org/...
Date Thu, 31 May 2012 00:40:22 GMT
Author: danhaywood
Date: Thu May 31 00:40:21 2012
New Revision: 1344519

URL: http://svn.apache.org/viewvc?rev=1344519&view=rev
Log:
ISIS-48: more on openjpa object store

Added:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/extensions/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/extensions/jpa/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/extensions/jpa/metamodel/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/IsisLifecycleListener.java
      - copied, changed from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/IsisLifecycleListener.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/AbstractJpaObjectCommand.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/AbstractJpaObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaCreateObjectCommand.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaCreateObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaDeleteObjectCommand.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaDeleteObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaUpdateObjectCommand.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaUpdateObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindAllInstancesProcessor.java
      - copied, changed from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindAllInstancesProcessor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByPatternProcessor.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByPatternProcessor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByTitleProcessor.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByTitleProcessor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindUsingApplibQueryProcessor.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindUsingApplibQueryProcessor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessor.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessorAbstract.java
      - copied, changed from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessorAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/QueryUtil.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/QueryUtil.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaIdentifierGenerator.java
      - copied, changed from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaIdentifierGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaSimplePersistAlgorithm.java
      - copied, changed from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaSimplePersistAlgorithm.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java
      - copied, changed from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/ResolveStateUtil.java
Removed:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/IsisLifecycleListener.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/AbstractJpaObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaCreateObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaDeleteObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaUpdateObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaIdentifierGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaSimplePersistAlgorithm.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/ResolveStateUtil.java
Modified:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstaller.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstallerTest_openAndClose.java

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java?rev=1344519&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java Thu May 31 00:40:21 2012
@@ -0,0 +1,109 @@
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import com.google.common.collect.Maps;
+
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
+
+import org.apache.isis.core.commons.components.ApplicationScopedComponent;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.extensions.jpa.metamodel.facets.object.entity.JpaEntityFacet;
+import org.apache.isis.extensions.jpa.metamodel.facets.object.namedquery.JpaNamedQueryFacet;
+import org.apache.isis.extensions.jpa.metamodel.facets.object.namedquery.NamedQuery;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.IsisLifecycleListener;
+
+public class OpenJpaApplicationComponents implements ApplicationScopedComponent {
+
+    private final EntityManagerFactory entityManagerFactory;
+    private final OpenJPAEntityManagerFactorySPI entityManagerFactorySpi;
+    private final Map<String, NamedQuery> namedQueryByName;
+    private final IsisLifecycleListener lifecycleListener;
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    //
+    ///////////////////////////////////////////////////////////////////////////
+
+    public OpenJpaApplicationComponents(final Map<String, String> props, final Collection<ObjectSpecification> objectSpecs) {
+        final String typeList = entityTypeList(objectSpecs);
+        props.put("openjpa.MetaDataFactory", "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory(types=" + typeList + ")");
+        entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory(null, props);
+        
+        namedQueryByName = Collections.unmodifiableMap(catalogNamedQueries(objectSpecs));
+        
+        entityManagerFactorySpi = (OpenJPAEntityManagerFactorySPI) entityManagerFactory;
+        lifecycleListener = new IsisLifecycleListener();
+        
+        entityManagerFactorySpi.addLifecycleListener(lifecycleListener, (Class[])null);
+    }
+
+    private String entityTypeList(final Collection<ObjectSpecification> objectSpecs) {
+        final StringBuilder buf = new StringBuilder();
+        for(ObjectSpecification objSpec: objectSpecs) {
+            if(objSpec.containsFacet(JpaEntityFacet.class)) {
+                final String fqcn = objSpec.getFullIdentifier();
+                buf.append(fqcn).append(";");
+            }
+        }
+        return buf.toString();
+    }
+    
+    private Map<String, NamedQuery> catalogNamedQueries(Collection<ObjectSpecification> objectSpecs) {
+        final Map<String, NamedQuery> namedQueryByName = Maps.newHashMap();
+        for (final ObjectSpecification spec : objectSpecs) {
+            final JpaNamedQueryFacet facet = spec.getFacet(JpaNamedQueryFacet.class);
+            if (facet == null) {
+                continue;
+            }
+            for (final NamedQuery namedQuery : facet.getNamedQueries()) {
+                namedQueryByName.put(namedQuery.getName(), namedQuery);
+            }
+        }
+        return namedQueryByName;
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+    //
+    ///////////////////////////////////////////////////////////////////////////
+
+    @Override
+    public void init() {
+    }
+
+    @Override
+    public void shutdown() {
+    }
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    //
+    ///////////////////////////////////////////////////////////////////////////
+    
+    public EntityManager createEntityManager() {
+        return entityManagerFactory.createEntityManager();
+    }
+
+    public NamedQuery getNamedQuery(String queryName) {
+        return namedQueryByName.get(queryName);
+    }
+
+    
+    ///////////////////////////////////////////////////////////////////////////
+    //
+    ///////////////////////////////////////////////////////////////////////////
+
+    public void suspendListener() {
+        lifecycleListener.setSuspended(true);
+    }
+
+    public void resumeListener() {
+        lifecycleListener.setSuspended(false);
+    }
+
+}

Propchange: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaApplicationComponents.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaObjectStore.java?rev=1344519&r1=1344518&r2=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaObjectStore.java Thu May 31 00:40:21 2012
@@ -12,9 +12,9 @@ import java.util.List;
 import java.util.Map;
 
 import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
 import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
+import javax.transaction.Transaction;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -40,15 +40,15 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.extensions.jpa.metamodel.facets.object.namedquery.NamedQuery;
 import org.apache.isis.extensions.jpa.metamodel.util.JpaPropertyUtils;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands.JpaCreateObjectCommand;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands.JpaDeleteObjectCommand;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands.JpaUpdateObjectCommand;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.PersistenceQueryFindAllInstancesProcessor;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.PersistenceQueryFindByPatternProcessor;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.PersistenceQueryFindByTitleProcessor;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.PersistenceQueryFindUsingApplibQueryProcessor;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.PersistenceQueryProcessor;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries.QueryUtil;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands.JpaCreateObjectCommand;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands.JpaDeleteObjectCommand;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands.JpaUpdateObjectCommand;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.PersistenceQueryFindAllInstancesProcessor;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.PersistenceQueryFindByPatternProcessor;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.PersistenceQueryFindByTitleProcessor;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.PersistenceQueryFindUsingApplibQueryProcessor;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.PersistenceQueryProcessor;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries.QueryUtil;
 import org.apache.isis.runtimes.dflt.runtime.persistence.ObjectNotFoundException;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionHydratorAware;
 import org.apache.isis.runtimes.dflt.runtime.persistence.UnsupportedFindException;
@@ -97,8 +97,7 @@ public class OpenJpaObjectStore implemen
     private final IsisConfiguration configuration;
     private final ObjectAdapterFactory adapterFactory;
     private final AdapterManager adapterManager;
-    private final EntityManagerFactory entityManagerFactory;
-    private final Map<String, NamedQuery> namedQueryByName;
+    private final OpenJpaApplicationComponents applicationComponents;
     
     private final Map<ObjectSpecId, RootOid> registeredServices = Maps.newHashMap();
 
@@ -107,7 +106,6 @@ public class OpenJpaObjectStore implemen
 
     private final Map<Class<?>, PersistenceQueryProcessor<?>> persistenceQueryProcessorByClass = Maps.newHashMap();
     // private final LoadPostProcessor loadPostProcessor;
-    // private HibernateApplicationComponents hibernateApplicationComponents;
 
     private State state;
     private TransactionMode transactionMode;
@@ -115,12 +113,11 @@ public class OpenJpaObjectStore implemen
     private PersistenceSessionHydrator hydrator;
     private IsisTransactionManager transactionManager;
 
-    public OpenJpaObjectStore(IsisConfiguration configuration, ObjectAdapterFactory adapterFactory, AdapterManager adapterManager, EntityManagerFactory entityManagerFactory, Map<String, NamedQuery> namedQueryByName) {
+    public OpenJpaObjectStore(IsisConfiguration configuration, ObjectAdapterFactory adapterFactory, AdapterManager adapterManager, OpenJpaApplicationComponents applicationComponents) {
         ensureThatArg(configuration, is(notNullValue()));
         ensureThatArg(adapterFactory, is(notNullValue()));
         ensureThatArg(adapterManager, is(notNullValue()));
-        ensureThatArg(entityManagerFactory, is(notNullValue()));
-        ensureThatArg(namedQueryByName, is(notNullValue()));
+        ensureThatArg(applicationComponents, is(notNullValue()));
 
         this.state = State.NOT_YET_OPEN;
         this.transactionMode = TransactionMode.UNCHAINED;
@@ -128,8 +125,7 @@ public class OpenJpaObjectStore implemen
         this.configuration = configuration;
         this.adapterFactory = adapterFactory;
         this.adapterManager = adapterManager;
-        this.entityManagerFactory = entityManagerFactory;
-        this.namedQueryByName = namedQueryByName;
+        this.applicationComponents = applicationComponents;
     }
 
     @Override
@@ -179,7 +175,7 @@ public class OpenJpaObjectStore implemen
     }
 
     private EntityManager openSession() {
-        return entityManager = entityManagerFactory.createEntityManager();
+        return entityManager = applicationComponents.createEntityManager();
     }
 
     private void addPersistenceQueryProcessors(final EntityManager entityManager) {
@@ -255,7 +251,6 @@ public class OpenJpaObjectStore implemen
         if (transaction.isActive()) {
             throw new IllegalStateException("Transaction already active");
         }
-        //getSession().beginTransaction();
         transaction.begin();
     }
 
@@ -616,11 +611,31 @@ public class OpenJpaObjectStore implemen
     }
 
     // ///////////////////////////////////////////////////////////////////////
-    // non-API: named queries
+    // non-API
     // ///////////////////////////////////////////////////////////////////////
 
     public NamedQuery getNamedQuery(String queryName) {
-        return namedQueryByName.get(queryName);
+        return applicationComponents.getNamedQuery(queryName);
+    }
+
+    /**
+     * For testing purposes, to allow fixtures to use JPA to initialize the
+     * database without triggering the objectstore.
+     * 
+     * @see #resumeListener()
+     */
+    public void suspendListener() {
+        applicationComponents.suspendListener();
+    }
+
+    /**
+     * For testing purposes, to allow fixtures to use JPA to initialize the
+     * database without triggering the objectstore.
+     * 
+     * @see #suspendListener()
+     */
+    public void resumeListener() {
+        applicationComponents.resumeListener();
     }
 
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstaller.java?rev=1344519&r1=1344518&r2=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstaller.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstaller.java Thu May 31 00:40:21 2012
@@ -1,27 +1,14 @@
 package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.Map;
 
-import javax.persistence.EntityManagerFactory;
-
-import com.google.common.collect.Maps;
-
-import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
-
 import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLookup;
-import org.apache.isis.extensions.jpa.metamodel.facets.object.entity.JpaEntityFacet;
-import org.apache.isis.extensions.jpa.metamodel.facets.object.namedquery.JpaNamedQueryFacet;
-import org.apache.isis.extensions.jpa.metamodel.facets.object.namedquery.NamedQuery;
 import org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.spi.OpenJpaIdentifierGenerator;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.spi.OpenJpaSimplePersistAlgorithm;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi.OpenJpaIdentifierGenerator;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi.OpenJpaSimplePersistAlgorithm;
 import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.PersistenceMechanismInstallerAbstract;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
@@ -54,78 +41,35 @@ public class OpenJpaPersistenceMechanism
 
     public static final String NAME = "openjpa";
 
-    private EntityManagerFactory entityManagerFactory = null;
-    private Map<String, NamedQuery> namedQueryByName = null;
-
-    private OpenJpaIdentifierGenerator identifierGenerator;
-
+    private OpenJpaApplicationComponents applicationComponents = null;
+    
     public OpenJpaPersistenceMechanismInstaller() {
         super(NAME);
     }
 
     @Override
     protected ObjectStore createObjectStore(IsisConfiguration configuration, ObjectAdapterFactory adapterFactory, AdapterManager adapterManager) {
-        createEntityManagerFactoryIfRequired(configuration);
-        final OpenJpaObjectStore objectStore = new OpenJpaObjectStore(configuration, adapterFactory, adapterManager, entityManagerFactory, namedQueryByName);
-        return objectStore;
+        createOpenJpaApplicationComponentsIfRequired(configuration);
+        return new OpenJpaObjectStore(configuration, adapterFactory, adapterManager, applicationComponents);
     }
 
-    private void createEntityManagerFactoryIfRequired(IsisConfiguration configuration) {
-        if(entityManagerFactory != null) {
+    private void createOpenJpaApplicationComponentsIfRequired(IsisConfiguration configuration) {
+        if(applicationComponents != null) {
             return;
         }
         
         final IsisConfiguration openJpaConfig = configuration.createSubset("isis.persistor.openjpa.impl");
         final Map<String, String> props = openJpaConfig.asMap();
         
-        final String typeList = entityTypeList();
-        props.put("openjpa.MetaDataFactory", "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory(types=" + typeList + ")");
-        
-        entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory(null, props);
-        
-        OpenJPAEntityManagerFactorySPI emfSpi = (OpenJPAEntityManagerFactorySPI) entityManagerFactory;
-        emfSpi.addLifecycleListener(new IsisLifecycleListener(), (Class[])null);
-        
-        namedQueryByName = Collections.unmodifiableMap(catalogNamedQueries());
+        applicationComponents = new OpenJpaApplicationComponents(props, getSpecificationLoader().allSpecifications());
     }
 
     @Override
     protected IdentifierGenerator createIdentifierGenerator(IsisConfiguration configuration) {
-        identifierGenerator = new OpenJpaIdentifierGenerator();
-        return identifierGenerator;
-    }
-    
-    /**
-     * "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory(types=org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.fixtures.JpaPrimitiveValuedEntity;)"
-     */
-    private String entityTypeList() {
-        final StringBuilder buf = new StringBuilder();
-        final Collection<ObjectSpecification> allSpecifications = getSpecificationLoader().allSpecifications();
-        for(ObjectSpecification objSpec: allSpecifications) {
-            if(objSpec.containsFacet(JpaEntityFacet.class)) {
-                final String fqcn = objSpec.getFullIdentifier();
-                buf.append(fqcn).append(";");
-            }
-        }
-        final String typeList = buf.toString();
-        return typeList;
-    }
-    
-    private Map<String, NamedQuery> catalogNamedQueries() {
-        final HashMap<String, NamedQuery> namedQueryByName = Maps.newHashMap();
-        for (final ObjectSpecification spec : getSpecificationLoader().allSpecifications()) {
-            final JpaNamedQueryFacet facet = spec.getFacet(JpaNamedQueryFacet.class);
-            if (facet == null) {
-                continue;
-            }
-            for (final NamedQuery namedQuery : facet.getNamedQueries()) {
-                namedQueryByName.put(namedQuery.getName(), namedQuery);
-            }
-        }
-        return namedQueryByName;
+        return new OpenJpaIdentifierGenerator();
     }
 
-    
+
     @Override
     protected PersistAlgorithm createPersistAlgorithm(IsisConfiguration configuration) {
         return new OpenJpaSimplePersistAlgorithm();

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/IsisLifecycleListener.java (from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/IsisLifecycleListener.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/IsisLifecycleListener.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/IsisLifecycleListener.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/IsisLifecycleListener.java&r1=1344132&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/IsisLifecycleListener.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/IsisLifecycleListener.java Thu May 31 00:40:21 2012
@@ -1,51 +1,180 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence;
 
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnitUtil;
+import java.text.MessageFormat;
+import java.util.Map;
 
+import com.google.common.collect.Maps;
+
+import org.apache.log4j.Logger;
 import org.apache.openjpa.event.AbstractLifecycleListener;
 import org.apache.openjpa.event.LifecycleEvent;
 
+import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackUtils;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
+import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi.ResolveStateUtil;
 import org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager.AdapterManagerExtended;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionHydrator;
 
-public class IsisLifecycleListener extends AbstractLifecycleListener {
+public class IsisLifecycleListener extends AbstractLifecycleListener implements SuspendableListener {
+
+    private static final Logger LOG = Logger.getLogger(IsisLifecycleListener.class);
+
+    private boolean suspended;
 
     @Override
-    public void afterPersist(LifecycleEvent event) {
-        final Object pojo = event.getSource();
-        
-        
-        // TODO: see NakedInsertPostEventListener, since there is much more to be done here..
+    public void beforePersist(LifecycleEvent event) {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(logString(event));
+        }
+        if (isSuspended()) {
+            LOG.debug(" [currently suspended - ignoring]");
+            return;
+        }
+
         
-        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo);
+        final Object pojo = event.getSource();
+        final ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
+        final Oid oid = adapter.getOid();
         
-        CallbackUtils.callCallback(adapter, PersistedCallbackFacet.class);
+        // make sure the adapter is transient
+        if (!adapter.getResolveState().isTransient()) {
+            throw new IsisException(MessageFormat.format("adapter is in invalid state; should be {0} but is {1}", ResolveState.TRANSIENT, adapter.getResolveState()));
+        }
+
+        // make sure the oid is transient
+        if (!oid.isTransient()) {
+            throw new IsisException(MessageFormat.format("Not transient: oid={0}, for {1}", oid, pojo));
+        }
+
+        // make sure the entity is a root
+        // TODO: will probably need to handle aggregated entities at some point...
+        if (!(oid instanceof RootOid)) {
+            throw new IsisException(MessageFormat.format("Not a RootOid: oid={0}, for {1}", oid, pojo));
+        }
     }
 
-    protected AdapterManagerExtended getAdapterManager() {
-        return getPersistenceSession().getAdapterManager();
+
+    @Override
+    public void afterPersist(LifecycleEvent event) {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(logString(event));
+        }
+        if (isSuspended()) {
+            LOG.debug(" [currently suspended - ignoring]");
+            return;
+        }
+
+        final Object pojo = event.getSource();
+
+        final ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
+        final RootOid transientOid = (RootOid) adapter.getOid();
+
+        final RootOid persistentOid = getOidGenerator().createPersistent(pojo, transientOid);
+
+        // most of the magic is here...
+        getAdapterManager().remapAsPersistent(adapter, persistentOid);
+
+        clearDirtyFor(adapter);
+        CallbackUtils.callCallback(adapter, PersistedCallbackFacet.class);
     }
-    
+
     @Override
     public void afterLoad(LifecycleEvent event) {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(logString(event));
+        }
+        if (isSuspended()) {
+            LOG.debug(" [currently suspended - ignoring]");
+            return;
+        }
+
         final Object pojo = event.getSource();
-        
+
         final OidGenerator oidGenerator = getOidGenerator();
         final RootOid oid = oidGenerator.createPersistent(pojo, null);
-        
+
         PersistenceSessionHydrator hydrator = getPersistenceSession();
         hydrator.recreateAdapter(oid, pojo);
     }
 
+    // /////////////////////////////////////////////////////////
+    // SuspendListener
+    // /////////////////////////////////////////////////////////
+
+    @Override
+    public boolean isSuspended() {
+        return suspended;
+    }
+
+    @Override
+    public void setSuspended(boolean suspended) {
+        this.suspended = suspended;
+    }
+
+    // /////////////////////////////////////////////////////////
+    // Helpers
+    // /////////////////////////////////////////////////////////
+
+    private static Map<Integer, LifecycleEventType> events = Maps.newHashMap();
+    private enum LifecycleEventType {
+        BEFORE_PERSIST(0),
+        AFTER_PERSIST(1),
+        AFTER_PERSIST_PERFORMED(18),
+        AFTER_LOAD(2),
+        BEFORE_STORE(3),
+        AFTER_STORE(4),
+        BEFORE_CLEAR(5),
+        AFTER_CLEAR(6),
+        BEFORE_DELETE(7),
+        AFTER_DELETE(8),
+        AFTER_DELETE_PERFORMED(19),
+        BEFORE_DIRTY(9),
+        AFTER_DIRTY(10),
+        BEFORE_DIRTY_FLUSHED(11),
+        AFTER_DIRTY_FLUSHED(12),
+        BEFORE_DETACH(13),
+        AFTER_DETACH(14),
+        BEFORE_ATTACH(15),
+        AFTER_ATTACH(16),
+        AFTER_REFRESH(17),
+        BEFORE_UPDATE(20),
+        AFTER_UPDATE_PERFORMED(21);
+
+        private LifecycleEventType(int code) {
+            events.put(code, this);
+        }
+        
+        public static LifecycleEventType lookup(int code) {
+            return events.get(code);
+        }
+    }
+
+
+    private static String logString(LifecycleEvent event) {
+        return LifecycleEventType.lookup(event.getType()) + ": pojo " + event.getSource();
+    }
+
+
+    private static void clearDirtyFor(final ObjectAdapter adapter) {
+        adapter.getSpecification().clearDirty(adapter);
+    }
+
+    // /////////////////////////////////////////////////////////
+    // Dependencies (from context)
+    // /////////////////////////////////////////////////////////
+
+    protected AdapterManagerExtended getAdapterManager() {
+        return getPersistenceSession().getAdapterManager();
+    }
+
     protected OidGenerator getOidGenerator() {
         return getPersistenceSession().getOidGenerator();
     }
@@ -53,4 +182,5 @@ public class IsisLifecycleListener exten
     protected PersistenceSession getPersistenceSession() {
         return IsisContext.getPersistenceSession();
     }
+
 }

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java?rev=1344519&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java Thu May 31 00:40:21 2012
@@ -0,0 +1,9 @@
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence;
+
+public interface SuspendableListener {
+
+    boolean isSuspended();
+
+    void setSuspended(boolean suspend);
+
+}

Propchange: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/SuspendableListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/AbstractJpaObjectCommand.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/AbstractJpaObjectCommand.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/AbstractJpaObjectCommand.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/AbstractJpaObjectCommand.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/AbstractJpaObjectCommand.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/AbstractJpaObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/AbstractJpaObjectCommand.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands;
 
 import javax.persistence.EntityManager;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaCreateObjectCommand.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaCreateObjectCommand.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaCreateObjectCommand.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaCreateObjectCommand.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaCreateObjectCommand.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaCreateObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaCreateObjectCommand.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands;
 
 import javax.persistence.EntityManager;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaDeleteObjectCommand.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaDeleteObjectCommand.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaDeleteObjectCommand.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaDeleteObjectCommand.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaDeleteObjectCommand.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaDeleteObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaDeleteObjectCommand.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands;
 
 import javax.persistence.EntityManager;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaUpdateObjectCommand.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaUpdateObjectCommand.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaUpdateObjectCommand.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaUpdateObjectCommand.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaUpdateObjectCommand.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/commands/JpaUpdateObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/commands/JpaUpdateObjectCommand.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.commands;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.commands;
 
 import javax.persistence.EntityManager;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindAllInstancesProcessor.java (from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindAllInstancesProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindAllInstancesProcessor.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindAllInstancesProcessor.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindAllInstancesProcessor.java&r1=1344132&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindAllInstancesProcessor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindAllInstancesProcessor.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.List;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByPatternProcessor.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByPatternProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByPatternProcessor.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByPatternProcessor.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByPatternProcessor.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByPatternProcessor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByPatternProcessor.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.List;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByTitleProcessor.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByTitleProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByTitleProcessor.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByTitleProcessor.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByTitleProcessor.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindByTitleProcessor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindByTitleProcessor.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.List;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindUsingApplibQueryProcessor.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindUsingApplibQueryProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindUsingApplibQueryProcessor.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindUsingApplibQueryProcessor.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindUsingApplibQueryProcessor.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryFindUsingApplibQueryProcessor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryFindUsingApplibQueryProcessor.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.Arrays;
 import java.util.Collections;

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessor.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessor.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessor.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessor.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessor.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.List;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessorAbstract.java (from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessorAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessorAbstract.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessorAbstract.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessorAbstract.java&r1=1344132&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/PersistenceQueryProcessorAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/PersistenceQueryProcessorAbstract.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import java.util.List;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/QueryUtil.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/QueryUtil.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/QueryUtil.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/QueryUtil.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/QueryUtil.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/queries/QueryUtil.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/queries/QueryUtil.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.queries;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.queries;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaIdentifierGenerator.java (from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaIdentifierGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaIdentifierGenerator.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaIdentifierGenerator.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaIdentifierGenerator.java&r1=1344132&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaIdentifierGenerator.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaIdentifierGenerator.java Thu May 31 00:40:21 2012
@@ -1,8 +1,7 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.spi;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi;
 
 import java.util.UUID;
 
-import javax.persistence.EntityManagerFactory;
 import javax.persistence.PersistenceUnitUtil;
 
 import org.apache.log4j.Logger;
@@ -12,17 +11,10 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
 import org.apache.isis.core.metamodel.adapter.map.AdapterMapAware;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
-import org.apache.isis.core.metamodel.facets.accessor.PropertyOrCollectionAccessorFacet;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLookup;
 import org.apache.isis.core.metamodel.spec.SpecificationLookupAware;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.extensions.jpa.metamodel.util.JpaPropertyUtils;
 import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.OpenJpaObjectStore;
-import org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.OpenJpaPersistenceMechanismInstaller;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStorePersistence;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaSimplePersistAlgorithm.java (from r1344132, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaSimplePersistAlgorithm.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaSimplePersistAlgorithm.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaSimplePersistAlgorithm.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaSimplePersistAlgorithm.java&r1=1344132&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/OpenJpaSimplePersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/OpenJpaSimplePersistAlgorithm.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.spi;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi;
 
 import org.apache.log4j.Logger;
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java (from r1343914, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/ResolveStateUtil.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/ResolveStateUtil.java&r1=1343914&r2=1344519&rev=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/spi/ResolveStateUtil.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java Thu May 31 00:40:21 2012
@@ -1,4 +1,4 @@
-package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.spi;
+package org.apache.isis.runtimes.dflt.objectstores.jpa.openjpa.persistence.spi;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
@@ -89,7 +89,7 @@ public final class ResolveStateUtil {
     }
 
 
-    static void markAsUpdating(final ObjectAdapter adapter) {
+    public static void markAsUpdating(final ObjectAdapter adapter) {
 
         if (adapter.getResolveState() == ResolveState.TRANSIENT) {
             adapter.changeState(ResolveState.RESOLVED);

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstallerTest_openAndClose.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstallerTest_openAndClose.java?rev=1344519&r1=1344518&r2=1344519&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstallerTest_openAndClose.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/OpenJpaPersistenceMechanismInstallerTest_openAndClose.java Thu May 31 00:40:21 2012
@@ -18,6 +18,7 @@ import org.junit.Test;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
@@ -79,19 +80,46 @@ public class OpenJpaPersistenceMechanism
         entity = repo.newEntity();
         entity.setId(2);
         iswf.commitTran();
+
+        // don't bounce
+        iswf.beginTran();
+        List<PrimitiveValuedEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+
+        // do bounce
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistAdapters() throws Exception {
+        iswf.beginTran();
+        PrimitiveValuedEntity entity = repo.newEntity();
+        ObjectAdapter adapter = iswf.adapterFor(entity);
+        
+        assertThat(adapter.isTransient(), is(true));
+        assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
+        assertThat(adapter.getOid().isTransient(), is(true));
+        
+        entity.setId(1);
+        iswf.commitTran();
         
         iswf.bounceSystem();
         
         iswf.beginTran();
         final List<PrimitiveValuedEntity> list = repo.list();
-        assertThat(list.size(), is(2));
+        assertThat(list.size(), is(1));
         
-        ObjectAdapter adapter = iswf.adapterFor(list.get(0));
+        adapter = iswf.adapterFor(list.get(0));
+        assertThat(adapter.getResolveState(), is(ResolveState.GHOST));
+        assertThat(adapter.isTransient(), is(false));
         assertThat(adapter.getOid().enString(), is("PRMV:1"));
 
-        adapter = iswf.adapterFor(list.get(1));
-        assertThat(adapter.getOid().enString(), is("PRMV:2"));
-
         iswf.commitTran();
     }
 



Mime
View raw message