diff options
author | mtaal | 2006-10-15 07:36:54 +0000 |
---|---|---|
committer | mtaal | 2006-10-15 07:36:54 +0000 |
commit | 382a5adbc27584a8932537ae99f8af919b73f1de (patch) | |
tree | 74f7e1fc684413669f7bb64165ec26d5c0dfee09 | |
parent | b32e78cfffcf3e396f8fe4b27714f82a294256cc (diff) | |
download | org.eclipse.emf.teneo-382a5adbc27584a8932537ae99f8af919b73f1de.tar.gz org.eclipse.emf.teneo-382a5adbc27584a8932537ae99f8af919b73f1de.tar.xz org.eclipse.emf.teneo-382a5adbc27584a8932537ae99f8af919b73f1de.zip |
identifiercache now works without equals call, did not work for primitive type values like FeatureMapEntry. Idenfitier/version cache only works for object equality which is
good enough because these cache solutions are only used for cases in which there is no identifier property (which is unlikely)
-rw-r--r-- | plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/identifier/IdentifierCacheHandler.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/identifier/IdentifierCacheHandler.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/identifier/IdentifierCacheHandler.java index 8a0268dd8..194186f14 100644 --- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/identifier/IdentifierCacheHandler.java +++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/identifier/IdentifierCacheHandler.java @@ -11,7 +11,7 @@ * Martin Taal * </copyright> * - * $Id: IdentifierCacheHandler.java,v 1.2 2006/10/05 14:32:04 mtaal Exp $ + * $Id: IdentifierCacheHandler.java,v 1.3 2006/10/15 07:36:54 mtaal Exp $ */ package org.eclipse.emf.teneo.hibernate.mapping.identifier; @@ -34,7 +34,7 @@ import org.eclipse.emf.ecore.xmi.XMLResource; * actions to clean the maps. * * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class IdentifierCacheHandler { @@ -190,7 +190,15 @@ public class IdentifierCacheHandler { } // still present compare on values - return obj0 == obj1 || obj0.equals(obj1); + // equals call should maybe also be done but goes wrong for featuremap entries + // which are equal if their values and featuremap are equal + // identifier and version caching are only usefull in case of object equality + // because it uses weak references and the first level cache of hb should + // ensure that only one instance of a certain object is present. + // There should always be one instance anyway in one session otherwise + // references between objects can be set wrong (or at least there is a great + // change that they go wrong). + return obj0 == obj1; } /** The hashcode of the enclosed object is returned */ |