summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-10-24 02:56:16 (EDT)
committer Martin Taal2012-10-24 02:56:16 (EDT)
commit49f6c3db77d0c683d963f3786ebd85a13ecaab98 (patch)
tree7837ecdff302605592ec14959b543560f5b42b1a
parent5c12882424bf79296829c8850dd764a797263f6c (diff)
downloadcdo-49f6c3db77d0c683d963f3786ebd85a13ecaab98.zip
cdo-49f6c3db77d0c683d963f3786ebd85a13ecaab98.tar.gz
cdo-49f6c3db77d0c683d963f3786ebd85a13ecaab98.tar.bz2
Fixes issue [392714] - [Hibernate] Hibernate export does not make use of store properties
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/internal/teneo/bundle/HibernateCommandProvider.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java5
2 files changed, 8 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/internal/teneo/bundle/HibernateCommandProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/internal/teneo/bundle/HibernateCommandProvider.java
index 7111ae5..0444661 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/internal/teneo/bundle/HibernateCommandProvider.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/internal/teneo/bundle/HibernateCommandProvider.java
@@ -10,15 +10,13 @@
*/
package org.eclipse.emf.cdo.server.hibernate.internal.teneo.bundle;
-import org.eclipse.emf.cdo.server.hibernate.teneo.CDOMappingGenerator;
+import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.spi.server.RepositoryFactory;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.io.IOUtil;
-import org.eclipse.emf.ecore.EPackage;
-
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
@@ -26,7 +24,6 @@ import org.osgi.framework.BundleContext;
import java.io.FileOutputStream;
import java.io.OutputStream;
-import java.util.Properties;
/**
* Provides a command to export the hbm file directly from the osgi prompt.
@@ -89,17 +86,13 @@ public class HibernateCommandProvider implements CommandProvider
String syntax = "Syntax: hibernate mapping <repository-name> <export-file>";
InternalRepository repository = getRepository(interpreter, syntax);
String exportFile = nextArgument(interpreter, syntax);
+ final HibernateStore store = (HibernateStore)repository.getStore();
OutputStream out = null;
try
{
+ final String mapping = store.getMappingXml();
out = new FileOutputStream(exportFile);
- Properties props = new Properties();
- props.putAll(repository.getProperties());
- final EPackage[] ePackages = repository.getPackageRegistry().values().toArray(new EPackage[0]);
-
- final CDOMappingGenerator mappingGenerator = new CDOMappingGenerator();
- final String mapping = mappingGenerator.generateMapping(ePackages, props);
out.write(mapping.getBytes());
interpreter.println("Hibernate mapping exported");
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
index d52939a..b1c37b3 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
@@ -581,4 +581,9 @@ public class HibernateStore extends Store implements IHibernateStore
return systemInformation;
}
+
+ public String getMappingXml()
+ {
+ return mappingXml;
+ }
}