CdmStore : no longer need to set configuration in hibernate classes here
authorCherian Mathew <c.mathew@bgbm.org>
Wed, 9 Apr 2014 14:23:23 +0000 (14:23 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Wed, 9 Apr 2014 14:23:23 +0000 (14:23 +0000)
CdmStoreConnector : new method to retrieve configuration based on cdm source type

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java

index bb77b58be3ae1680f97860491635212857a2596a..d849c488c97928f65c4b89f0d140a92e1a9ffad6 100644 (file)
@@ -196,9 +196,7 @@ public class CdmStore {
 
        private CdmStore(ICdmApplicationConfiguration applicationController,
                        ICdmSource cdmSource) {
-               this.applicationConfiguration = applicationController;
-               AbstractLazyInitializer.setConfiguration(applicationController);
-               AbstractPersistentCollection.setConfiguration(applicationController);
+               this.applicationConfiguration = applicationController;          
                this.cdmSource = cdmSource;
                isConnected = true;
        }
index d1665cb8e78c7ab60bad5ad033153f43895d95f0..7fe9a0d279b3ff0e27da18534e14e83668093510 100644 (file)
@@ -18,6 +18,8 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
+import org.hibernate.collection.internal.AbstractPersistentCollection;
+import org.hibernate.proxy.AbstractLazyInitializer;
 import org.springframework.core.io.Resource;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
@@ -149,16 +151,16 @@ class CdmStoreConnector extends Job {
        private ICdmApplicationConfiguration getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
                if(cdmSource instanceof ICdmDataSource) {
                        return  CdmApplicationController.NewInstance(applicationContextBean, 
-                                               (ICdmDataSource)cdmSource, 
-                                               dbSchemaValidation,
-                                               false, 
-                                               subprogressMonitor);
+                                       (ICdmDataSource)cdmSource, 
+                                       dbSchemaValidation,
+                                       false, 
+                                       subprogressMonitor);
                } else if(cdmSource instanceof ICdmRemoteSource) {
                        return CdmApplicationRemoteController.NewInstance(applicationContextBean, 
-                                       (ICdmRemoteSource)cdmSource,                                    
-                                       false, 
-                                       subprogressMonitor,
-                                       null);
+                                                       (ICdmRemoteSource)cdmSource,                                    
+                                                       false, 
+                                                       subprogressMonitor,
+                                                       null);
                } else {
                        throw new UnsupportedOperationException("Cannot create application controller for " + cdmSource.getName());
                }