cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r476338 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/ObjectId.java test/java/org/apache/cayenne/ObjectIdTst.java
Date Fri, 17 Nov 2006 22:06:08 GMT
Author: aadamchik
Date: Fri Nov 17 14:06:07 2006
New Revision: 476338

URL: http://svn.apache.org/viewvc?view=rev&rev=476338
Log:
CAY-707 SelectQuery automatic cache key build mechanism produces wrong results when DO's are
used in qualifier
(oops - sometimes it helps to test the changes before commit - fixing toString algorithm in
ObjectId)

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/ObjectId.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/ObjectIdTst.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/ObjectId.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/ObjectId.java?view=diff&rev=476338&r1=476337&r2=476338
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/ObjectId.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/ObjectId.java
Fri Nov 17 14:06:07 2006
@@ -357,7 +357,7 @@
             // ensure consistent order of the keys, so that toString could be used as a
             // unique key, just like id itself
             
-            List keys = new ArrayList(objectIdKeys.entrySet());
+            List keys = new ArrayList(objectIdKeys.keySet());
             Collections.sort(keys);
             Iterator it = keys.iterator();
             while (it.hasNext()) {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/ObjectIdTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/ObjectIdTst.java?view=diff&rev=476338&r1=476337&r2=476338
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/ObjectIdTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/ObjectIdTst.java
Fri Nov 17 14:06:07 2006
@@ -308,4 +308,20 @@
         assertTrue(ref.equals(oid));
         assertEquals(ref.hashCode(), oid.hashCode());
     }
+
+    public void testToString() {
+        Map m1 = new HashMap();
+        m1.put("a", "1");
+        m1.put("b", "2");
+        ObjectId i1 = new ObjectId("e1", m1);
+
+        Map m2 = new HashMap();
+        m2.put("b", "2");
+        m2.put("a", "1");
+
+        ObjectId i2 = new ObjectId("e1", m2);
+
+        assertEquals(i1, i2);
+        assertEquals(i1.toString(), i2.toString());
+    }
 }



Mime
View raw message