cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r448436 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java
Date Thu, 21 Sep 2006 02:29:31 GMT
Author: aadamchik
Date: Wed Sep 20 19:29:30 2006
New Revision: 448436

URL: http://svn.apache.org/viewvc?view=rev&rev=448436
Log:
changing the signature of an Entity by Object lookup to take Object instead of Persistent

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java?view=diff&rev=448436&r1=448435&r2=448436
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityResolver.java
Wed Sep 20 19:29:30 2006
@@ -454,9 +454,14 @@
      * 
      * @return the required ObjEntity, or null if none matches the specifier
      */
-    public synchronized ObjEntity lookupObjEntity(Persistent dataObject) {
-        ObjectId id = dataObject.getObjectId();
-        Object key = id != null ? (Object) id.getEntityName() : dataObject.getClass();
+    public synchronized ObjEntity lookupObjEntity(Object object) {
+        ObjectId id = null;
+
+        if (object instanceof Persistent) {
+            id = ((Persistent) object).getObjectId();
+        }
+
+        Object key = id != null ? (Object) id.getEntityName() : object.getClass();
         return this._lookupObjEntity(key);
     }
 



Mime
View raw message