cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r570498 - /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Date Tue, 28 Aug 2007 17:45:23 GMT
Author: aadamchik
Date: Tue Aug 28 10:45:22 2007
New Revision: 570498

URL: http://svn.apache.org/viewvc?rev=570498&view=rev
Log:
CAY-855 Add DataContext.objectFromDataRow variety for generic classes

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=570498&r1=570497&r2=570498&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Tue Aug 28 10:45:22 2007
@@ -685,6 +685,27 @@
                 true);
         return (DataObject) list.get(0);
     }
+    
+    /**
+     * Creates a DataObject from DataRow. This variety of the 'objectFromDataRow' method
is normally used for generic classes.
+     * 
+     * @see DataRow
+     * @since 3.0
+     */
+    public DataObject objectFromDataRow(
+            String entityName,
+            DataRow dataRow,
+            boolean refresh) {
+
+        ObjEntity entity = getEntityResolver().getObjEntity(entityName);
+
+        List list = objectsFromDataRows(
+                entity,
+                Collections.singletonList(dataRow),
+                refresh,
+                true);
+        return (DataObject) list.get(0);
+    }
 
     /**
      * @deprecated since 3.0, use {@link #newObject(String)} instead.



Mime
View raw message