You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/03/03 21:23:05 UTC
[13/20] isis git commit: Corrected StoreManager access for DN4
Corrected StoreManager access for DN4
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a5fb8ee2
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a5fb8ee2
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a5fb8ee2
Branch: refs/heads/ISIS-789
Commit: a5fb8ee21c9ace5fd884dae1fd8ca32fdf05694a
Parents: 6f4a9be
Author: jdb6853 <jd...@hotmail.com>
Authored: Fri Jan 2 02:56:24 2015 -0600
Committer: jdb6853 <jd...@hotmail.com>
Committed: Fri Jan 2 02:56:24 2015 -0600
----------------------------------------------------------------------
.../datanucleus/DataNucleusApplicationComponents.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/a5fb8ee2/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusApplicationComponents.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusApplicationComponents.java
index 762409e..cbcf222 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusApplicationComponents.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusApplicationComponents.java
@@ -33,6 +33,7 @@ import com.google.common.collect.Maps;
import org.datanucleus.NucleusContext;
import org.datanucleus.NucleusContextHelper;
import org.datanucleus.PropertyNames;
+import org.datanucleus.StoreNucleusContext;
import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
import org.datanucleus.metadata.MetaDataManager;
import org.datanucleus.store.StoreManager;
@@ -128,13 +129,12 @@ public class DataNucleusApplicationComponents implements ApplicationScopedCompon
final JDOPersistenceManagerFactory jdopmf = (JDOPersistenceManagerFactory)persistenceManagerFactory;
final NucleusContext nucleusContext = jdopmf.getNucleusContext();
- final StoreManager storeManager = NucleusContextHelper.createStoreManagerForProperties(
- new HashMap<String, Object>(props),
- jdopmf.getPersistenceProperties(),
- nucleusContext.getClassLoaderResolver(ClassLoader.getSystemClassLoader()), nucleusContext);
- if (storeManager instanceof SchemaAwareStoreManager) {
- ((SchemaAwareStoreManager)storeManager).createSchemaForClasses(classesToBePersisted, asProperties(props));
- }
+ if (nucleusContext instanceof StoreNucleusContext) {
+ final StoreManager storeManager = ((StoreNucleusContext)nucleusContext).getStoreManager();
+ if (storeManager instanceof SchemaAwareStoreManager) {
+ ((SchemaAwareStoreManager)storeManager).createSchemaForClasses(classesToBePersisted, asProperties(props));
+ }
+ }
}