diff options
author | Eike Stepper | 2010-05-31 09:45:47 +0000 |
---|---|---|
committer | Eike Stepper | 2010-05-31 09:45:47 +0000 |
commit | 0e371c1e12b369c0d5d74ff17c966a3354becb74 (patch) | |
tree | d219a0c63f1b0127041cce8bf2c1fad1a07dea86 /plugins/org.eclipse.emf.cdo.tests.hibernate | |
parent | b4b7a35313a6ec5980c190f2f04da3e960477d96 (diff) | |
download | cdo-0e371c1e12b369c0d5d74ff17c966a3354becb74.tar.gz cdo-0e371c1e12b369c0d5d74ff17c966a3354becb74.tar.xz cdo-0e371c1e12b369c0d5d74ff17c966a3354becb74.zip |
DBBrowser for HibernateStore
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.hibernate')
3 files changed, 30 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF index c3007ae3c8..c33456e989 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF @@ -14,6 +14,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", org.eclipse.emf.cdo;bundle-version="[3.0.0,4.0.0)", org.eclipse.emf.cdo.server;bundle-version="[3.0.0,4.0.0)", org.eclipse.emf.cdo.server.hibernate;bundle-version="[3.0.0,4.0.0)", + org.eclipse.emf.cdo.server.db;bundle-version="[3.0.0,4.0.0)", org.eclipse.emf.cdo.tests;bundle-version="[3.0.0,4.0.0)", org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)", org.hsqldb;bundle-version="[1.8.0,2.0.0)", diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties index 5a6c7d2c38..27dd2993c4 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties @@ -5,6 +5,11 @@ hibernate.connection.pool_size=10 # ----------------------------------------------------------- # DEFAULT SETTINGS FOR IN MEMORY HSQLDB DATABASE. # + +#hibernate.dialect=org.hibernate.dialect.H2Dialect +#hibernate.connection.driver_class=org.h2.Driver +#hibernate.connection.url=jdbc:h2:_database/repo1 + hibernate.dialect=org.hibernate.dialect.HSQLDialect hibernate.connection.driver_class=org.hsqldb.jdbcDriver hibernate.connection.url=jdbc:hsqldb:mem:cdohibernate @@ -15,11 +20,11 @@ hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider #-------------------------------------------------------------- # EXAMPLE SETTING FOR MYSQL DATABASE. UNCOMMENT AND EDIT TO USE. -# +# #hibernate.connection.driver_class=com.mysql.jdbc.Driver #hibernate.connection.url=jdbc:mysql://localhost:3306/cdohibernate #hibernate.connection.username=root #hibernate.connection.password=root #hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect -teneo.mapping.cascade_policy_on_non_containment = PERSIST,MERGE +teneo.mapping.cascade_policy_on_non_containment=PERSIST,MERGE diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java index 3073238e47..2b48ea7953 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java @@ -10,8 +10,9 @@ */ package org.eclipse.emf.cdo.tests.hibernate; -import org.eclipse.emf.cdo.server.IStore; import org.eclipse.emf.cdo.server.IRepository.Props; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.db.CDODBBrowser; import org.eclipse.emf.cdo.server.hibernate.CDOHibernateUtil; import org.eclipse.emf.cdo.server.hibernate.IHibernateMappingProvider; import org.eclipse.emf.cdo.server.hibernate.teneo.TeneoUtil; @@ -36,6 +37,8 @@ public class HibernateConfig extends RepositoryConfig private Map<String, String> additionalProperties = new HashMap<String, String>(); + private transient CDODBBrowser dbBrowser; + public HibernateConfig() { super("Hibernate"); @@ -46,11 +49,13 @@ public class HibernateConfig extends RepositoryConfig { super.initRepositoryProperties(props); props.put(Props.SUPPORTING_AUDITS, "false"); + props.put(Props.SUPPORTING_BRANCHES, "false"); try { final Properties teneoProperties = new Properties(); - teneoProperties.putAll(getAdditionalProperties()); + Map<String, String> additionalProperties = getAdditionalProperties(); + teneoProperties.putAll(additionalProperties); teneoProperties.load(getClass().getResourceAsStream("/app.properties")); for (Object key : teneoProperties.keySet()) { @@ -75,4 +80,19 @@ public class HibernateConfig extends RepositoryConfig { return additionalProperties; } + + @Override + public void setUp() throws Exception + { + super.setUp(); + dbBrowser = new CDODBBrowser(repositories); + dbBrowser.activate(); + } + + @Override + public void tearDown() throws Exception + { + dbBrowser.deactivate(); + super.tearDown(); + } } |