summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-04-28 04:30:39 (EDT)
committerEike Stepper2008-04-28 04:30:39 (EDT)
commitc29dfcc72f72a23d4d2740e9455df1cf568f7e22 (patch)
tree6feacff4bffd470fcefe8d0a3dba6dee83b86d79
parent161729e3dfb362901a2915b9575a52dfeab09d6a (diff)
downloadcdo-c29dfcc72f72a23d4d2740e9455df1cf568f7e22.zip
cdo-c29dfcc72f72a23d4d2740e9455df1cf568f7e22.tar.gz
cdo-c29dfcc72f72a23d4d2740e9455df1cf568f7e22.tar.bz2
Lexical cleanup and conditional tracing
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateFileMappingProvider.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java125
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java44
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOInterceptor.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticIdPropertyHandler.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticVersionPropertyHandler.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java6
27 files changed, 321 insertions, 204 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java
index cf897fa..2b1ec7d 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java
@@ -19,7 +19,6 @@ import org.hibernate.cfg.Configuration;
*/
public interface IHibernateMappingProvider
{
-
/** Adds a mapping to a configuration object */
public void addMapping(Configuration configuration);
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateFileMappingProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateFileMappingProvider.java
index 1076bc3..cf62c6e 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateFileMappingProvider.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateFileMappingProvider.java
@@ -29,7 +29,6 @@ import java.io.InputStream;
*/
public class HibernateFileMappingProvider implements IHibernateMappingProvider
{
-
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateFileMappingProvider.class);
private IHibernateStore hibernateStore;
@@ -46,12 +45,30 @@ public class HibernateFileMappingProvider implements IHibernateMappingProvider
mappingFileLocations = locations;
}
+ public IHibernateStore getHibernateStore()
+ {
+ return hibernateStore;
+ }
+
+ public void setHibernateStore(IHibernateStore hibernateStore)
+ {
+ this.hibernateStore = hibernateStore;
+ }
+
public void addMapping(Configuration configuration)
{
- TRACER.trace("Adding hibernate mapping from location(s):");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Adding hibernate mapping from location(s):");
+ }
+
for (String location : mappingFileLocations)
{
- TRACER.trace(location);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace(location);
+ }
+
InputStream is = null;
try
{
@@ -74,14 +91,4 @@ public class HibernateFileMappingProvider implements IHibernateMappingProvider
}
}
}
-
- public IHibernateStore getHibernateStore()
- {
- return hibernateStore;
- }
-
- public void setHibernateStore(IHibernateStore hibernateStore)
- {
- this.hibernateStore = hibernateStore;
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
index cef9321..8f04bac 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
@@ -72,41 +72,52 @@ public class HibernatePackageHandler
public List<CDOPackage> getCDOPackages()
{
- final List<CDOPackage> cdoPackages = new ArrayList<CDOPackage>();
+ List<CDOPackage> cdoPackages = new ArrayList<CDOPackage>();
if (HibernateThreadContext.isCommitContextSet())
{
- final CommitContext cc = HibernateThreadContext.getCommitContext();
+ CommitContext cc = HibernateThreadContext.getCommitContext();
if (cc instanceof org.eclipse.emf.cdo.internal.server.Transaction)
{
- final org.eclipse.emf.cdo.internal.server.Transaction tx = (org.eclipse.emf.cdo.internal.server.Transaction)cc;
+ org.eclipse.emf.cdo.internal.server.Transaction tx = (org.eclipse.emf.cdo.internal.server.Transaction)cc;
for (CDOPackage cdoPackage : tx.getNewPackages())
{
cdoPackages.add(cdoPackage);
}
}
}
+
for (CDOPackage cdoPackage : hibernateStore.getRepository().getPackageManager().getPackages())
{
cdoPackages.add(cdoPackage);
}
+
for (CDOPackage cdoPackage : cdoPackages)
{
// force resolve
if (cdoPackage.getClassCount() == 0)
{
- TRACER.trace("Returning " + cdoPackage.getPackageURI());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Returning " + cdoPackage.getPackageURI());
+ }
}
}
+
return cdoPackages;
}
public void writePackages(CDOPackage... cdoPackages)
{
- TRACER.trace("Persisting new CDOPackages");
- final Session session = getSessionFactory().openSession();
- final Transaction tx = session.beginTransaction();
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Persisting new CDOPackages");
+ }
+
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
boolean err = true;
boolean updated = false;
+
try
{
for (CDOPackage cdoPackage : cdoPackages)
@@ -117,10 +128,15 @@ public class HibernatePackageHandler
continue;
}
- TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI());
+ }
+
session.saveOrUpdate(cdoPackage);
updated = true;
}
+
tx.commit();
err = false;
}
@@ -130,8 +146,10 @@ public class HibernatePackageHandler
{
tx.rollback();
}
+
session.close();
}
+
if (updated)
{
reset();
@@ -141,7 +159,7 @@ public class HibernatePackageHandler
protected boolean cdoPackageExistsAndIsUnchanged(CDOPackage newCDOPackage)
{
- final CDOPackage[] cdoPackages = hibernateStore.getRepository().getPackageManager().getPackages();
+ CDOPackage[] cdoPackages = hibernateStore.getRepository().getPackageManager().getPackages();
for (CDOPackage cdoPackage : cdoPackages)
{
if (cdoPackage.getClassCount() > 0 && cdoPackage.getPackageURI().compareTo(newCDOPackage.getPackageURI()) == 0)
@@ -161,12 +179,16 @@ public class HibernatePackageHandler
return;
}
- final Session session = getSessionFactory().openSession();
- final Transaction tx = session.beginTransaction();
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
boolean err = true;
try
{
- TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI());
+ }
+
session.saveOrUpdate(cdoPackage);
tx.commit();
err = false;
@@ -177,8 +199,10 @@ public class HibernatePackageHandler
{
tx.rollback();
}
+
session.close();
}
+
reset();
hibernateStore.reInitialize();
}
@@ -196,8 +220,13 @@ public class HibernatePackageHandler
return;
}
- TRACER.trace("Reading CDOPackage with uri " + cdoPackage.getPackageURI() + " from db");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Reading CDOPackage with uri " + cdoPackage.getPackageURI() + " from db");
+ }
+
Session session = getSessionFactory().openSession();
+
try
{
Criteria criteria = session.createCriteria(CDOPackage.class);
@@ -208,10 +237,18 @@ public class HibernatePackageHandler
throw new IllegalArgumentException("CDOPackage with uri " + cdoPackage.getPackageURI()
+ " not present in the db");
}
- TRACER.trace("Found " + list.size() + " CDOPackages in DB");
- final CDOPackage dbPackage = (CDOPackage)list.get(0);
- TRACER.trace("Read CDOPackage: " + cdoPackage.getName());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Found " + list.size() + " CDOPackages in DB");
+ }
+
+ CDOPackage dbPackage = (CDOPackage)list.get(0);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Read CDOPackage: " + cdoPackage.getName());
+ }
+
((InternalCDOPackage)cdoPackage).setServerInfo(dbPackage.getServerInfo());
((InternalCDOPackage)cdoPackage).setName(dbPackage.getName());
((InternalCDOPackage)cdoPackage).setEcore(dbPackage.getEcore());
@@ -226,36 +263,54 @@ public class HibernatePackageHandler
((InternalCDOFeature)cdoFeature).setContainingClass(cdoClass);
}
}
+
((CDOPackageImpl)cdoPackage).setClasses(cdoClasses);
}
finally
{
session.close();
}
- TRACER.trace("Finished reading CDOPackages");
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Finished reading CDOPackages");
+ }
}
protected void readPackageInfos()
{
if (cdoPackageInfos == null || cdoPackageInfos.size() == 0)
{
- TRACER.trace("Reading CDOPackages from db");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Reading CDOPackages from db");
+ }
+
Collection<CDOPackageInfo> result = new ArrayList<CDOPackageInfo>();
Session session = getSessionFactory().openSession();
+
try
{
Criteria criteria = session.createCriteria(CDOPackage.class);
List<?> list = criteria.list();
- TRACER.trace("Found " + list.size() + " CDOPackages in DB");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Found " + list.size() + " CDOPackages in DB");
+ }
+
for (Object object : list)
{
CDOPackage cdoPackage = (CDOPackage)object;
- TRACER.trace("Read CDOPackage: " + cdoPackage.getName());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Read CDOPackage: " + cdoPackage.getName());
+ }
+
result.add(new CDOPackageInfo(cdoPackage.getPackageURI(), cdoPackage.isDynamic(),
cdoPackage.getMetaIDRange(), cdoPackage.getParentURI()));
((InternalCDOPackage)cdoPackage).setPackageManager(hibernateStore.getRepository().getPackageManager());
-
}
+
cdoPackageInfos = result;
}
finally
@@ -263,7 +318,11 @@ public class HibernatePackageHandler
session.close();
}
}
- TRACER.trace("Finished reading CDOPackages");
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Finished reading CDOPackages");
+ }
}
public synchronized SessionFactory getSessionFactory()
@@ -301,7 +360,10 @@ public class HibernatePackageHandler
protected void doActivate()
{
- TRACER.trace("Activating CDOPackageHandler");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Activating CDOPackageHandler");
+ }
initConfiguration();
initSchema();
@@ -309,7 +371,10 @@ public class HibernatePackageHandler
protected void doDeactivate() throws Exception
{
- TRACER.trace("De-Activating CDOPackageHandler");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Deactivating CDOPackageHandler");
+ }
if (sessionFactory != null)
{
@@ -320,7 +385,11 @@ public class HibernatePackageHandler
protected void initConfiguration()
{
- TRACER.trace("Initializing datastore for CDO metadata");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Initializing datastore for CDO metadata");
+ }
+
InputStream in = null;
try
@@ -342,7 +411,11 @@ public class HibernatePackageHandler
protected void initSchema()
{
- TRACER.trace("Updating db schema for Hibernate PackageHandler");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Updating db schema for Hibernate PackageHandler");
+ }
+
new SchemaUpdate(configuration).execute(true, true);
}
}
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 725014f..ccbb078 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
@@ -94,7 +94,6 @@ public class HibernateStore extends Store implements IHibernateStore
try
{
initConfiguration();
-
hibernateSessionFactory = hibernateConfiguration.buildSessionFactory();
}
finally
@@ -208,10 +207,18 @@ public class HibernateStore extends Store implements IHibernateStore
@Override
protected void doDeactivate() throws Exception
{
- TRACER.trace("De-Activating HibernateStore");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("De-Activating HibernateStore");
+ }
+
if (hibernateSessionFactory != null)
{
- TRACER.trace("Closing SessionFactory");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Closing SessionFactory");
+ }
+
hibernateSessionFactory.close();
hibernateSessionFactory = null;
}
@@ -227,14 +234,23 @@ public class HibernateStore extends Store implements IHibernateStore
// TODO: assumes that packageHandler has been reset
protected void reInitialize()
{
- TRACER.trace("Re-Initializing HibernateStore");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Re-Initializing HibernateStore");
+ }
+
if (hibernateSessionFactory != null)
{
if (!hibernateSessionFactory.isClosed())
{
- TRACER.trace("Closing SessionFactory");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Closing SessionFactory");
+ }
+
hibernateSessionFactory.close();
}
+
hibernateSessionFactory = null;
}
}
@@ -265,9 +281,7 @@ public class HibernateStore extends Store implements IHibernateStore
in = OM.BUNDLE.getInputStream("mappings/resource.hbm.xml");
hibernateConfiguration.addInputStream(in);
-
hibernateConfiguration.setInterceptor(new CDOInterceptor());
-
hibernateConfiguration.setProperties(HibernateUtil.getInstance().getPropertiesFromStore(this));
}
catch (Exception ex)
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
index 16def07..3c258d0 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
@@ -57,8 +57,8 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
TRACER.trace("Creating hibernate session and setting it in threadlocal HibernateThreadContext");
}
- final SessionFactory sessionFactory = getStore().getHibernateSessionFactory();
- final Session session = sessionFactory.openSession();
+ SessionFactory sessionFactory = getStore().getHibernateSessionFactory();
+ Session session = sessionFactory.openSession();
HibernateThreadContext.setSession(session);
return session;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java
index aa3c212..100a0da 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java
@@ -37,14 +37,14 @@ public class HibernateStoreChunkReader extends StoreChunkReader implements IHibe
@Override
public void addSimpleChunk(int index)
{
- super.addSimpleChunk(index);
+ // super.addSimpleChunk(index);
throw new UnsupportedOperationException(); // TODO Implement me
}
@Override
public void addRangedChunk(int fromIndex, int toIndex)
{
- super.addRangedChunk(fromIndex, toIndex);
+ // super.addRangedChunk(fromIndex, toIndex);
throw new UnsupportedOperationException(); // TODO Implement me
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java
index 24e3f75..5c2d080 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java
@@ -73,7 +73,7 @@ public class HibernateStoreReader extends HibernateStoreAccessor implements IHib
public CDOClassRef readObjectType(CDOID id)
{
- final CDORevision cdoRevision = readRevision(id, -1);
+ CDORevision cdoRevision = readRevision(id, -1);
return cdoRevision.getCDOClass().createClassRef();
}
@@ -94,10 +94,10 @@ public class HibernateStoreReader extends HibernateStoreAccessor implements IHib
TRACER.trace("Finding resourceid using path " + path);
}
- final Session session = getHibernateSession();
- final Criteria criteria = session.createCriteria(CDOResourceClass.NAME);
+ Session session = getHibernateSession();
+ Criteria criteria = session.createCriteria(CDOResourceClass.NAME);
criteria.add(Expression.eq("path", path));
- final List<?> result = criteria.list();
+ List<?> result = criteria.list();
if (result.size() == 0)
{
if (TRACER.isEnabled())
@@ -110,7 +110,7 @@ public class HibernateStoreReader extends HibernateStoreAccessor implements IHib
}
// TODO: throw exception if list.size() > 1?
- final CDORevision cdoRevision = (CDORevision)result.get(0);
+ CDORevision cdoRevision = (CDORevision)result.get(0);
return cdoRevision.getID();
}
@@ -131,9 +131,9 @@ public class HibernateStoreReader extends HibernateStoreAccessor implements IHib
TRACER.trace("Finding resource using id " + id);
}
- final Session session = getHibernateSession();
- final Query qry = session.createQuery("select path from " + CDOResourceClass.NAME + " where id=:id");
- final CDOIDHibernate idHibernate = (CDOIDHibernate)id;
+ Session session = getHibernateSession();
+ Query qry = session.createQuery("select path from " + CDOResourceClass.NAME + " where id=:id");
+ CDOIDHibernate idHibernate = (CDOIDHibernate)id;
qry.setParameter("id", idHibernate.getId());
final List<?> result = qry.list();
if (result.size() == 0)
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java
index e9406e0..2757de3 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java
@@ -38,7 +38,10 @@ public class HibernateStoreWriter extends HibernateStoreReader implements IHiber
public HibernateStoreWriter(HibernateStore store, IView view)
{
super(store, view);
- TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName());
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName());
+ }
}
@Override
@@ -48,19 +51,19 @@ public class HibernateStoreWriter extends HibernateStoreReader implements IHiber
{
TRACER.trace("Committing transaction");
}
- HibernateThreadContext.setCommitContext(context);
+ HibernateThreadContext.setCommitContext(context);
writePackages(context.getNewPackages());
try
{
// start with fresh hibernate session
- final Session session = getHibernateSession();
+ Session session = getHibernateSession();
session.setFlushMode(FlushMode.COMMIT);
session.beginTransaction();
for (Object o : context.getNewObjects())
{
- final CDORevision cdoRevision = (CDORevision)o;
+ CDORevision cdoRevision = (CDORevision)o;
session.save(HibernateUtil.getInstance().getEntityName(cdoRevision), o);
if (TRACER.isEnabled())
{
@@ -73,11 +76,12 @@ public class HibernateStoreWriter extends HibernateStoreReader implements IHiber
{
try
{
- final CDORevision cdoRevision = (CDORevision)o;
+ CDORevision cdoRevision = (CDORevision)o;
if (cdoRevision instanceof CDORevisionImpl)
{
((CDORevisionImpl)cdoRevision).setVersion(cdoRevision.getVersion() - 1);
}
+
session.update(HibernateUtil.getInstance().getEntityName(cdoRevision), o);
if (TRACER.isEnabled())
{
@@ -86,7 +90,7 @@ public class HibernateStoreWriter extends HibernateStoreReader implements IHiber
}
catch (Exception e)
{
- e.printStackTrace(System.err);
+ OM.LOG.error(e);
throw WrappedException.wrap(e);
}
}
@@ -112,6 +116,7 @@ public class HibernateStoreWriter extends HibernateStoreReader implements IHiber
{
TRACER.trace("Applying id mappings");
}
+
context.applyIDMappings();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
index 8cf8a07..49dd5cc 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
@@ -52,12 +52,13 @@ public class HibernateUtil
/** Converts from a Map<String, String> to a Properties */
public Properties getPropertiesFromStore(IStore store)
{
- final Properties props = new Properties();
- final Map<String, String> storeProps = store.getRepository().getProperties();
+ Properties props = new Properties();
+ Map<String, String> storeProps = store.getRepository().getProperties();
for (String key : storeProps.keySet())
{
props.setProperty(key, storeProps.get(key));
}
+
return props;
}
@@ -73,33 +74,33 @@ public class HibernateUtil
*/
public CDOIDHibernate getCDOIDHibernate(CDOID cdoID)
{
- final CDORevision cdoRevision = getCDORevision(cdoID);
+ CDORevision cdoRevision = getCDORevision(cdoID);
if (cdoRevision.getID() instanceof CDOIDHibernate)
{
return (CDOIDHibernate)cdoRevision.getID();
}
- final Session session = HibernateThreadContext.getSession();
+
+ Session session = HibernateThreadContext.getSession();
session.saveOrUpdate(cdoRevision);
if (!(cdoRevision.getID() instanceof CDOIDHibernate))
{
throw new IllegalStateException("CDORevision " + cdoRevision.getCDOClass().getName() + " " + cdoRevision.getID()
+ " does not have a hibernate cdoid after saving/updating it");
}
+
return (CDOIDHibernate)cdoRevision.getID();
}
public InternalCDORevision getCDORevision(Object target)
{
- final InternalCDORevision revision;
if (target instanceof CDOObject)
{
- revision = (InternalCDORevision)((CDOObject)target).cdoRevision();
+ return (InternalCDORevision)((CDOObject)target).cdoRevision();
}
else
{
- revision = (InternalCDORevision)target;
+ return (InternalCDORevision)target;
}
- return revision;
}
/**
@@ -113,7 +114,7 @@ public class HibernateUtil
return null;
}
- final CommitContext commitContext = HibernateThreadContext.getCommitContext();
+ CommitContext commitContext = HibernateThreadContext.getCommitContext();
for (CDORevision revision : commitContext.getNewObjects())
{
if (revision.getID().equals(id))
@@ -121,6 +122,7 @@ public class HibernateUtil
return revision;
}
}
+
for (CDORevision revision : commitContext.getDirtyObjects())
{
if (revision.getID().equals(id))
@@ -132,7 +134,7 @@ public class HibernateUtil
// maybe the temp was already translated
if (id instanceof CDOIDTemp)
{
- final CDOID newID = commitContext.getIDMappings().get(id);
+ CDOID newID = commitContext.getIDMappings().get(id);
if (newID != null)
{
return getCDORevision(newID);
@@ -144,8 +146,9 @@ public class HibernateUtil
throw new IllegalArgumentException("Passed cdoid is not an instance of CDOIDHibernate but a "
+ id.getClass().getName() + ": " + id);
}
- final CDOIDHibernate cdoIDHibernate = (CDOIDHibernate)id;
- final Session session = HibernateThreadContext.getSession();
+
+ CDOIDHibernate cdoIDHibernate = (CDOIDHibernate)id;
+ Session session = HibernateThreadContext.getSession();
return (CDORevision)session.get(cdoIDHibernate.getEntityName(), cdoIDHibernate.getId());
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java
index cddd3aa..fa6b7ee 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: CDOFeatureReferenceTypePropertyHandler.java,v 1.1 2008-04-24 11:47:07 mtaal Exp $
+ * $Id: CDOFeatureReferenceTypePropertyHandler.java,v 1.2 2008-04-28 08:30:39 estepper Exp $
*/
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
@@ -36,30 +36,25 @@ import java.util.Map;
* Is only used for synthetic id's.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
@SuppressWarnings("unchecked")
public class CDOFeatureReferenceTypePropertyHandler implements Getter, Setter, PropertyAccessor
{
- private static final long serialVersionUID = 4707601844087591747L;
+ private static final long serialVersionUID = 1L;
- public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException
+ public CDOFeatureReferenceTypePropertyHandler()
{
- return this;
- }
-
- public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException
- {
- return this;
}
public Object get(Object owner) throws HibernateException
{
- final CDOFeature cdoFeature = (CDOFeature)owner;
+ CDOFeature cdoFeature = (CDOFeature)owner;
if (cdoFeature.getType() != CDOType.OBJECT)
{
return null;
}
+
return cdoFeature.getReferenceType();
}
@@ -68,6 +63,27 @@ public class CDOFeatureReferenceTypePropertyHandler implements Getter, Setter, P
return get(arg0);
}
+ public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException
+ {
+ CDOFeatureImpl cdoFeature = (CDOFeatureImpl)target;
+ if (cdoFeature.getType() != CDOType.OBJECT)
+ {
+ return;
+ }
+
+ cdoFeature.setReferenceType((CDOClass)value);
+ }
+
+ public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException
+ {
+ return this;
+ }
+
+ public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException
+ {
+ return this;
+ }
+
public Method getMethod()
{
return null;
@@ -82,14 +98,4 @@ public class CDOFeatureReferenceTypePropertyHandler implements Getter, Setter, P
{
return null;
}
-
- public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException
- {
- final CDOFeatureImpl cdoFeature = (CDOFeatureImpl)target;
- if (cdoFeature.getType() != CDOType.OBJECT)
- {
- return;
- }
- cdoFeature.setReferenceType((CDOClass)value);
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java
index 1ab47d1..4e71156 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java
@@ -56,40 +56,27 @@ public class CDOIDMetaRangeUserType implements UserType
{
return null;
}
- final CDOIDMetaRange cdoRange = (CDOIDMetaRange)value;
- final CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(((CDOIDMetaImpl)cdoRange.getLowerBound()).getLongValue());
- return new CDOIDMetaRangeImpl(newCdoIDMeta, cdoRange.size());
- }
- public boolean equals(Object x, Object y)
- {
- if (x == y)
- {
- return true;
- }
-
- if (x == null || y == null)
- {
- return false;
- }
-
- return x.equals(y);
+ CDOIDMetaRange cdoRange = (CDOIDMetaRange)value;
+ CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(((CDOIDMetaImpl)cdoRange.getLowerBound()).getLongValue());
+ return new CDOIDMetaRangeImpl(newCdoIDMeta, cdoRange.size());
}
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException
{
- final Integer start = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]);
+ Integer start = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]);
if (rs.wasNull())
{
return null;
}
- final Integer size = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[1]);
+
+ Integer size = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[1]);
if (rs.wasNull())
{
return null;
}
- final CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(start);
+ CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(start);
return new CDOIDMetaRangeImpl(newCdoIDMeta, size);
}
@@ -97,7 +84,7 @@ public class CDOIDMetaRangeUserType implements UserType
{
if (value != null)
{
- final CDOIDMetaRange cdoRange = (CDOIDMetaRange)value;
+ CDOIDMetaRange cdoRange = (CDOIDMetaRange)value;
statement.setLong(index, ((CDOIDMeta)cdoRange.getLowerBound()).getLongValue());
statement.setInt(index + 1, cdoRange.size());
}
@@ -123,6 +110,21 @@ public class CDOIDMetaRangeUserType implements UserType
return original;
}
+ public boolean equals(Object x, Object y)
+ {
+ if (x == y)
+ {
+ return true;
+ }
+
+ if (x == null || y == null)
+ {
+ return false;
+ }
+
+ return x.equals(y);
+ }
+
public int hashCode(Object x)
{
return x.hashCode();
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java
index 37af54f..334b822 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java
@@ -30,20 +30,20 @@ public class CDOIDPropertyGetter extends CDOPropertyGetter
@Override
public Object get(Object target) throws HibernateException
{
- final InternalCDORevision revision = (InternalCDORevision)target;
+ InternalCDORevision revision = (InternalCDORevision)target;
if (!(revision.getID() instanceof CDOIDHibernate))
{
return null;
}
- final CDOIDHibernate cdoID = (CDOIDHibernate)revision.getID();
+ CDOIDHibernate cdoID = (CDOIDHibernate)revision.getID();
if (isVirtualProperty())
{
return cdoID.getId();
}
else
{
- final Object id = super.get(target);
+ Object id = super.get(target);
// TODO: does this make sense?
// if (cdoID.getId() == null)
// {
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java
index 33d5e29..b07da2e 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java
@@ -43,29 +43,30 @@ public class CDOIDPropertySetter extends CDOPropertySetter
return;
}
- final InternalCDORevision revision = (InternalCDORevision)target;
- final CDOID cdoID = revision.getID();
+ InternalCDORevision revision = (InternalCDORevision)target;
+ CDOID cdoID = revision.getID();
if (cdoID == null)
{
- final CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
+ CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
revision.getCDOClass().getName());
revision.setID(newCDOID);
}
else if (cdoID instanceof CDOIDTemp)
{
- final CommitContext commitContext = HibernateThreadContext.getCommitContext();
- final CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
+ CommitContext commitContext = HibernateThreadContext.getCommitContext();
+ CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
revision.getCDOClass().getName());
revision.setID(newCDOID);
commitContext.addIDMapping((CDOIDTemp)cdoID, newCDOID);
}
else
{
- final CDOIDHibernate hbCDOID = (CDOIDHibernate)revision.getID();
+ CDOIDHibernate hbCDOID = (CDOIDHibernate)revision.getID();
if (!hbCDOID.getId().equals(value))
{
throw new IllegalStateException("Current id and new id are different " + value + "/" + hbCDOID.getId());
}
+
}
if (!isVirtualProperty())
{
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java
index 1ba56a6..786c5d6 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java
@@ -84,22 +84,25 @@ public class CDOIDUserType implements UserType
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException
{
- final String entityName = (String)Hibernate.STRING.nullSafeGet(rs, names[0]);
+ String entityName = (String)Hibernate.STRING.nullSafeGet(rs, names[0]);
if (rs.wasNull())
{
return null;
}
- final String idStr = (String)Hibernate.STRING.nullSafeGet(rs, names[1]);
+
+ String idStr = (String)Hibernate.STRING.nullSafeGet(rs, names[1]);
if (rs.wasNull())
{
return null;
}
- final String idClassName = (String)Hibernate.STRING.nullSafeGet(rs, names[2]);
+
+ String idClassName = (String)Hibernate.STRING.nullSafeGet(rs, names[2]);
if (rs.wasNull())
{
return null;
}
- final Serializable id = getId(idStr, idClassName);
+
+ Serializable id = getId(idStr, idClassName);
return CDOIDHibernateFactoryImpl.getInstance().createCDOID(id, entityName);
}
@@ -114,7 +117,7 @@ public class CDOIDUserType implements UserType
if (value != null)
{
- final CDOIDHibernate cdoID;
+ CDOIDHibernate cdoID;
if (value instanceof CDOIDTemp)
{
cdoID = HibernateUtil.getInstance().getCDOIDHibernate((CDOID)value);
@@ -162,10 +165,11 @@ public class CDOIDUserType implements UserType
Constructor<?> constructor = constructors.get(idType);
if (constructor == null)
{
- final Class<?> idClass = this.getClass().getClassLoader().loadClass(idType);
+ Class<?> idClass = this.getClass().getClassLoader().loadClass(idType);
constructor = idClass.getConstructor(new Class[] { String.class });
constructors.put(idType, constructor);
}
+
return (Serializable)constructor.newInstance(new Object[] { idStr });
}
catch (Exception e)
@@ -173,5 +177,4 @@ public class CDOIDUserType implements UserType
throw WrappedException.wrap(e);
}
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOInterceptor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOInterceptor.java
index 1ed448c..563ca6b 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOInterceptor.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOInterceptor.java
@@ -23,9 +23,12 @@ import org.hibernate.EmptyInterceptor;
*/
public class CDOInterceptor extends EmptyInterceptor
{
-
private static final long serialVersionUID = 1L;
+ public CDOInterceptor()
+ {
+ }
+
@Override
public String getEntityName(Object object)
{
@@ -33,7 +36,8 @@ public class CDOInterceptor extends EmptyInterceptor
{
return ((CDOObject)object).cdoClass().getName();
}
- final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(object);
+
+ InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(object);
return revision.getCDOClass().getName();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java
index 4647fd2..64e218a 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.net4j.internal.util.collection.MoveableArrayList;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.hibernate.HibernateException;
import org.hibernate.collection.PersistentCollection;
@@ -20,7 +21,6 @@ import org.hibernate.collection.PersistentCollection;
/**
* @author Martin Taal
*/
-
// Howto handle hibernate lists:
// - a new owner: the owner is persisted and its lists are replaced with hibernate
// persistentlist, the hibernate persitentlist will have a delegate (internally) which is the list which was previously
@@ -49,7 +49,7 @@ public class CDOManyReferenceGetter extends CDOPropertyGetter
public Object get(Object target) throws HibernateException
{
// Check if there is already a persistentcollection
- final PersistentCollection collection = PersistableListHolder.getInstance().getListMapping(target, getCDOFeature());
+ PersistentCollection collection = PersistableListHolder.getInstance().getListMapping(target, getCDOFeature());
if (collection != null)
{
return collection;
@@ -57,17 +57,17 @@ public class CDOManyReferenceGetter extends CDOPropertyGetter
// Not yet, get the moveablearraylist
@SuppressWarnings("unchecked")
- MoveableArrayList<Object> list = (MoveableArrayList<Object>)super.get(target);
+ MoveableList<Object> list = (MoveableList<Object>)super.get(target);
if (list == null)
{
// TODO: what initial size?
list = new MoveableArrayList<Object>(10);
- final InternalCDORevision revision = (InternalCDORevision)target;
+ InternalCDORevision revision = (InternalCDORevision)target;
revision.setValue(getCDOFeature(), list);
}
// Wrap the moveablearraylist
- final HibernateMoveableListWrapper wrapper = new HibernateMoveableListWrapper();
+ HibernateMoveableListWrapper wrapper = new HibernateMoveableListWrapper();
wrapper.setDelegate(list);
// And return it
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java
index 1a24e61..ab50e50 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java
@@ -32,15 +32,22 @@ public abstract class CDOPropertyHandler
{
this.tuplizer = tuplizer;
cdoFeature = tuplizer.getCDOClass().lookupFeature(propertyName);
- getTracer().trace(
- "Created " + this.getClass().getName() + " for cdoClass/feature: " + tuplizer.getCDOClass().getName() + "."
- + propertyName);
+ if (getTracer().isEnabled())
+ {
+ getTracer().trace(
+ "Created " + this.getClass().getName() + " for cdoClass/feature: " + tuplizer.getCDOClass().getName() + "."
+ + propertyName);
+ }
+
if (cdoFeature == null)
{
if (isVirtualPropertyAllowed())
{
virtualProperty = true;
- getTracer().trace("This is a virtualproperty");
+ if (getTracer().isEnabled())
+ {
+ getTracer().trace("This is a virtual property");
+ }
}
else
{
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java
index 56cc28c..4d2173b 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java
@@ -36,7 +36,7 @@ public class CDOReferenceSetter extends CDOPropertySetter
}
else
{
- final CDORevision cdoValue = (CDORevision)value;
+ CDORevision cdoValue = (CDORevision)value;
super.set(target, cdoValue.getID(), factory);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
index b5e7f9c..2dae125 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
@@ -37,7 +37,7 @@ public class CDORevisionInstantiator implements Instantiator
public CDORevisionInstantiator(CDORevisionTuplizer tuplizer, PersistentClass mappingInfo)
{
cdoClass = tuplizer.getCDOClass();
- final HibernateStore hbStore = HibernateStore.getCurrentHibernateStore();
+ HibernateStore hbStore = HibernateStore.getCurrentHibernateStore();
IRepository repository = hbStore.getRepository();
revisionManager = repository.getRevisionManager();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java
index 6c8832c..fb71650 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java
@@ -59,13 +59,13 @@ public class CDORevisionTuplizer extends AbstractEntityTuplizer
return;
}
- final HibernateStore hbStore = HibernateStore.getCurrentHibernateStore();
+ HibernateStore hbStore = HibernateStore.getCurrentHibernateStore();
// find the CDOClass/Package
// TODO: error handling if meta attribute not present
// TODO: error handling if entityname not set
- final String entityName = mappingInfo.getEntityName();
- final String ePackageURI = mappingInfo.getMetaAttribute("epackage").getValue();
+ String entityName = mappingInfo.getEntityName();
+ String ePackageURI = mappingInfo.getMetaAttribute("epackage").getValue();
if (TRACER.isEnabled())
{
@@ -202,7 +202,7 @@ public class CDORevisionTuplizer extends AbstractEntityTuplizer
return new CDOVersionPropertyGetter(this, mappedProperty.getName());
}
- final CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName());
+ CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName());
if (cdoFeature.isReference() && cdoFeature.isMany())
{
return new CDOManyReferenceGetter(this, mappedProperty.getName());
@@ -237,7 +237,7 @@ public class CDORevisionTuplizer extends AbstractEntityTuplizer
return new CDOVersionPropertySetter(this, mappedProperty.getName());
}
- final CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName());
+ CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName());
if (cdoFeature.isReference() && cdoFeature.isMany())
{
return new CDOManyReferenceSetter(this, mappedProperty.getName());
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticIdPropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticIdPropertyHandler.java
index 432e3da..d6afdd8 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticIdPropertyHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticIdPropertyHandler.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: CDOSyntheticIdPropertyHandler.java,v 1.1 2008-04-24 11:47:07 mtaal Exp $
+ * $Id: CDOSyntheticIdPropertyHandler.java,v 1.2 2008-04-28 08:30:39 estepper Exp $
*/
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
@@ -41,12 +41,12 @@ import java.util.Map;
* Is only used for synthetic id's.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
@SuppressWarnings("unchecked")
public class CDOSyntheticIdPropertyHandler implements Getter, Setter, PropertyAccessor
{
- private static final long serialVersionUID = 4707601844087591747L;
+ private static final long serialVersionUID = 1L;
public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException
{
@@ -60,17 +60,18 @@ public class CDOSyntheticIdPropertyHandler implements Getter, Setter, PropertyAc
public Object get(Object owner) throws HibernateException
{
- final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(owner);
+ InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(owner);
if (revision == null)
{
return null;
}
+
if (!(revision.getID() instanceof CDOIDHibernate))
{
return null;
}
- final CDOIDHibernate cdoID = (CDOIDHibernate)revision.getID();
+ CDOIDHibernate cdoID = (CDOIDHibernate)revision.getID();
return cdoID.getId();
}
@@ -101,25 +102,25 @@ public class CDOSyntheticIdPropertyHandler implements Getter, Setter, PropertyAc
return;
}
- final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(target);
- final CDOID cdoID = revision.getID();
+ InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(target);
+ CDOID cdoID = revision.getID();
if (cdoID == null)
{
- final CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
+ CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
revision.getCDOClass().getName());
revision.setID(newCDOID);
}
else if (cdoID instanceof CDOIDTemp)
{
- final CommitContext commitContext = HibernateThreadContext.getCommitContext();
- final CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
+ CommitContext commitContext = HibernateThreadContext.getCommitContext();
+ CDOIDHibernate newCDOID = CDOIDHibernateFactoryImpl.getInstance().createCDOID((Serializable)value,
revision.getCDOClass().getName());
revision.setID(newCDOID);
commitContext.addIDMapping((CDOIDTemp)cdoID, newCDOID);
}
else
{
- final CDOIDHibernate hbCDOID = (CDOIDHibernate)revision.getID();
+ CDOIDHibernate hbCDOID = (CDOIDHibernate)revision.getID();
if (!hbCDOID.getId().equals(value))
{
throw new IllegalStateException("Current id and new id are different " + value + "/" + hbCDOID.getId());
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticVersionPropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticVersionPropertyHandler.java
index 81339e3..9cc01cd 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticVersionPropertyHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOSyntheticVersionPropertyHandler.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: CDOSyntheticVersionPropertyHandler.java,v 1.1 2008-04-24 11:47:07 mtaal Exp $
+ * $Id: CDOSyntheticVersionPropertyHandler.java,v 1.2 2008-04-28 08:30:39 estepper Exp $
*/
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
@@ -34,15 +34,16 @@ import java.util.Map;
* Reads the version from the internal version cache.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
@SuppressWarnings("unchecked")
public class CDOSyntheticVersionPropertyHandler implements Getter, Setter, PropertyAccessor
{
- /**
- * Generated Serial Version ID
- */
- private static final long serialVersionUID = -7004553329654520847L;
+ private static final long serialVersionUID = 1L;
+
+ public CDOSyntheticVersionPropertyHandler()
+ {
+ }
public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException
{
@@ -56,11 +57,12 @@ public class CDOSyntheticVersionPropertyHandler implements Getter, Setter, Prope
public Object get(Object owner) throws HibernateException
{
- final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(owner);
+ InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(owner);
if (revision == null)
{
return null;
}
+
return revision.getVersion();
}
@@ -72,21 +74,11 @@ public class CDOSyntheticVersionPropertyHandler implements Getter, Setter, Prope
return get(owner);
}
- /*
- * (non-Javadoc)
- *
- * @see org.hibernate.property.Getter#getMethod()
- */
public Method getMethod()
{
return null;
}
- /*
- * (non-Javadoc)
- *
- * @see org.hibernate.property.Getter#getMethodName()
- */
public String getMethodName()
{
return null;
@@ -101,7 +93,7 @@ public class CDOSyntheticVersionPropertyHandler implements Getter, Setter, Prope
/** Sets the version in the internal version cache */
public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException
{
- final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(target);
+ InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(target);
revision.setVersion(((Number)value).intValue());
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java
index f1092d6..1d85a5f 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java
@@ -29,6 +29,10 @@ public class CDOTypeUserType implements UserType
{
private static final int[] SQL_TYPES = { Types.INTEGER };
+ public CDOTypeUserType()
+ {
+ }
+
public int[] sqlTypes()
{
return SQL_TYPES;
@@ -44,10 +48,6 @@ public class CDOTypeUserType implements UserType
return false;
}
- public CDOTypeUserType()
- {
- }
-
public Object deepCopy(Object value)
{
return value;
@@ -70,7 +70,7 @@ public class CDOTypeUserType implements UserType
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException
{
- final Integer value = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]);
+ Integer value = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]);
if (rs.wasNull())
{
return null;
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java
index f766090..b25edad 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java
@@ -29,13 +29,13 @@ public class CDOVersionPropertyGetter extends CDOPropertyGetter
@Override
public Object get(Object target) throws HibernateException
{
- final InternalCDORevision revision = (InternalCDORevision)target;
+ InternalCDORevision revision = (InternalCDORevision)target;
if (isVirtualProperty())
{
return revision.getVersion();
}
- final Object version = super.get(target);
+ Object version = super.get(target);
// TODO: does this make sense?
// revision.setVersion(((Number)value).intValue());
return version;
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java
index 4aa93a2..337e104 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java
@@ -30,7 +30,7 @@ public class CDOVersionPropertySetter extends CDOPropertySetter
@Override
public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException
{
- final InternalCDORevision revision = (InternalCDORevision)target;
+ InternalCDORevision revision = (InternalCDORevision)target;
revision.setVersion(((Number)value).intValue());
if (!isVirtualProperty())
{
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java
index 75037e8..6d34618 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil;
-import org.eclipse.net4j.internal.util.collection.MoveableArrayList;
+import org.eclipse.net4j.util.collection.MoveableList;
import java.util.ArrayList;
import java.util.Collection;
@@ -29,7 +29,7 @@ import java.util.ListIterator;
*/
public class HibernateMoveableListWrapper implements List<Object>
{
- private MoveableArrayList<Object> delegate;
+ private MoveableList<Object> delegate;
public HibernateMoveableListWrapper()
{
@@ -38,7 +38,7 @@ public class HibernateMoveableListWrapper implements List<Object>
/**
* @return the delegate
*/
- public MoveableArrayList<Object> getDelegate()
+ public MoveableList<Object> getDelegate()
{
return delegate;
}
@@ -47,7 +47,7 @@ public class HibernateMoveableListWrapper implements List<Object>
* @param delegate
* the delegate to set
*/
- public void setDelegate(MoveableArrayList<Object> delegate)
+ public void setDelegate(MoveableList<Object> delegate)
{
this.delegate = delegate;
}
@@ -70,7 +70,7 @@ public class HibernateMoveableListWrapper implements List<Object>
protected List<Object> getObjects(List<?> cdoIDs)
{
- final List<Object> result = new ArrayList<Object>();
+ List<Object> result = new ArrayList<Object>();
for (Object o : cdoIDs)
{
result.add(getObject(o));
@@ -81,13 +81,13 @@ public class HibernateMoveableListWrapper implements List<Object>
protected CDOID getCDOID(Object o)
{
- final CDORevision cdoRevision = (CDORevision)o;
+ CDORevision cdoRevision = (CDORevision)o;
return cdoRevision.getID();
}
protected List<CDOID> getCDOIDs(Collection<?> c)
{
- final List<CDOID> newC = new ArrayList<CDOID>();
+ List<CDOID> newC = new ArrayList<CDOID>();
for (Object o : c)
{
newC.add(getCDOID(o));
@@ -203,7 +203,7 @@ public class HibernateMoveableListWrapper implements List<Object>
public Object[] toArray()
{
- final Object[] result = new Object[size()];
+ Object[] result = new Object[size()];
int i = 0;
for (Object o : this)
{
@@ -241,7 +241,7 @@ public class HibernateMoveableListWrapper implements List<Object>
public Object next()
{
- final Object o = delegate.next();
+ Object o = delegate.next();
if (o instanceof CDOID)
{
return HibernateUtil.getInstance().getCDORevision((CDOID)o);
@@ -282,7 +282,7 @@ public class HibernateMoveableListWrapper implements List<Object>
public Object next()
{
- final Object o = delegate.next();
+ Object o = delegate.next();
if (o instanceof CDOID)
{
return HibernateUtil.getInstance().getCDORevision((CDOID)delegate.next());
@@ -298,7 +298,7 @@ public class HibernateMoveableListWrapper implements List<Object>
public Object previous()
{
- final Object o = delegate.previous();
+ Object o = delegate.previous();
if (o instanceof CDOID)
{
return HibernateUtil.getInstance().getCDORevision((CDOID)delegate.next());
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java
index aa904cd..c5afdc6 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java
@@ -41,7 +41,7 @@ public class PersistableListHolder
public void putListMapping(Object target, CDOFeature cdoFeature, PersistentCollection collection)
{
- final Key key = new Key(target, cdoFeature);
+ Key key = new Key(target, cdoFeature);
getListMapping().put(key, collection);
if (TRACER.isEnabled())
{
@@ -52,7 +52,7 @@ public class PersistableListHolder
public PersistentCollection getListMapping(Object target, CDOFeature cdoFeature)
{
- final Key key = new Key(target, cdoFeature);
+ Key key = new Key(target, cdoFeature);
return getListMapping().get(key);
}
@@ -96,7 +96,7 @@ public class PersistableListHolder
return false;
}
- final Key otherKey = (Key)obj;
+ Key otherKey = (Key)obj;
// the owner is uniquely present in mem, the same applies for the cdoFeature
// therefore == is allowed
return owner == otherKey.owner && cdoFeature == otherKey.cdoFeature;