summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-10-22 16:53:26 (EDT)
committerMartin Taal2012-10-22 16:53:26 (EDT)
commita65d08e000e88a26482e925623eec4c968c8a07c (patch)
treef9a30be53088ceb4265b1ec57a67e1a15c46f1f6
parent45a4279f1cf4f77f4bdd29a576c8d79dc37d54dd (diff)
downloadcdo-a65d08e000e88a26482e925623eec4c968c8a07c.zip
cdo-a65d08e000e88a26482e925623eec4c968c8a07c.tar.gz
cdo-a65d08e000e88a26482e925623eec4c968c8a07c.tar.bz2
Fixes issue [392609] - [Hibernate] Hibernate export does not make use of store propertiesdrops/I20121026-0410
-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..007a6b0 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
{
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);
+ final String mapping = store.getMappingXml();
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 0682d37..82daebf 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
@@ -582,4 +582,9 @@ public class HibernateStore extends Store implements IHibernateStore
return systemInformation;
}
+
+ public String getMappingXml()
+ {
+ return mappingXml;
+ }
}