summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-02-25 04:33:36 (EST)
committerEike Stepper2008-02-25 04:33:36 (EST)
commit612ae0556f6ec71dc9b219b8bbef57fd2d8c3e63 (patch)
tree5d01b1b1712e2714784b8cbd7c1134d2735912ba
parent6cb3860fbd7e656662fa1680d20eecf280abd9c8 (diff)
downloadcdo-612ae0556f6ec71dc9b219b8bbef57fd2d8c3e63.zip
cdo-612ae0556f6ec71dc9b219b8bbef57fd2d8c3e63.tar.gz
cdo-612ae0556f6ec71dc9b219b8bbef57fd2d8c3e63.tar.bz2
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java2
4 files changed, 15 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java
index 4482fa1..ab81ece 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java
@@ -20,7 +20,7 @@ import org.eclipse.net4j.util.io.ExtendedDataInput;
*/
public class CDOIDHibernateFactoryImpl implements CDOIDObjectFactory
{
- private static final Class<?>[] CLASSES = { CDOIDHibernateImpl.class, CDOIDHibernateImpl.Legacy.class };
+ private static final Class<?>[] CLASSES = CDOIDHibernateImpl.getClasses();
public CDOIDHibernateFactoryImpl()
{
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java
index f4087d8..dcf9a60 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java
@@ -113,7 +113,11 @@ public class CDOIDHibernateImpl extends AbstractCDOID implements CDOIDHibernate
// }
final byte[] content = in.readByteArray();
- System.out.println("Read CONTENT: " + HexUtil.bytesToHex(content));
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read content={0}", HexUtil.bytesToHex(content));
+ }
+
setContent(content);
}
@@ -133,7 +137,11 @@ public class CDOIDHibernateImpl extends AbstractCDOID implements CDOIDHibernate
// out.writeString(entityName);
byte[] content = getContent();
- System.out.println("Write CONTENT: " + HexUtil.bytesToHex(content));
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Writing content={0}", HexUtil.bytesToHex(content));
+ }
+
out.writeByteArray(content);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java
index ac262fd..ea0ac95 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java
@@ -47,8 +47,6 @@ public class HibernateCDOPackageHandler
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreWriter.class);
- private static final ContextTracer WARNING = new ContextTracer(OM.WARNING, HibernateStoreWriter.class);
-
private Configuration configuration;
private SessionFactory sessionFactory;
@@ -90,9 +88,10 @@ public class HibernateCDOPackageHandler
{
if (null != getCDOPackage(cdoPackage.getPackageURI()))
{
- WARNING.trace("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!");
+ OM.LOG.warn("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!");
continue;
}
+
TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI());
session.saveOrUpdate(cdoPackage);
}
@@ -115,9 +114,10 @@ public class HibernateCDOPackageHandler
{
if (null != getCDOPackage(cdoPackage.getPackageURI()))
{
- WARNING.trace("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!");
+ OM.LOG.warn("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!");
return;
}
+
final Session session = getSessionFactory().openSession();
final Transaction tx = session.beginTransaction();
boolean err = true;
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java
index 02decb2..eed970e 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java
@@ -29,8 +29,6 @@ public abstract class OM
public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
- public static final OMTracer WARNING = BUNDLE.tracer("warn"); //$NON-NLS-1$
-
public static final OMLogger LOG = BUNDLE.logger();
/**