Author: aadamchik
Date: Sat Oct 14 14:50:30 2006
New Revision: 464039

URL: http://svn.apache.org/viewvc?view=rev&rev=464039
Log:
CAY-682: Generic Cayenne POJO enhancer
(removing direct Fault API access from DataRowUtils)

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

Modified: 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataRowUtils.java
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataRowUtils.java?view=diff&rev=464039&r1=464038&r2=464039
==============================================================================
--- 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataRowUtils.java
 (original)
+++ 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataRowUtils.java
 Sat Oct 14 14:50:30 2006
@@ -121,7 +121,7 @@
             }
 
             public boolean visitSingleObjectArc(SingleObjectArcProperty 
property) {
-                property.writePropertyDirectly(object, null, 
Fault.getToOneFault());
+                property.invalidate(object);
                 return true;
             }
         });
@@ -197,26 +197,23 @@
                                 || !Util.nullSafeEquals(id, diff
                                         
.getArcSnapshotValue(relationship.getName()))) {
 
-                            Object target;
                             if (id == null) {
-                                target = null;
+                                property.writeProperty(object, null, null);
                             }
                             else {
                                 // if inheritance is involved, we can't use 
'localObject'
-                                // .. must
-                                // turn to fault instead
+                                // .. must turn to fault instead
                                 ObjEntity targetEntity = (ObjEntity) 
relationship
                                         .getTargetEntity();
                                 if 
(context.getEntityResolver().lookupInheritanceTree(
                                         targetEntity) != null) {
-                                    target = Fault.getToOneFault();
+                                    property.invalidate(object);
                                 }
                                 else {
-                                    target = context.localObject(id, null);
+                                    property.writeProperty(object, null, 
context
+                                            .localObject(id, null));
                                 }
                             }
-
-                            property.writeProperty(object, null, target);
                         }
                     }
                 }


Reply via email to