Author: torehalset
Date: Tue Aug 22 13:06:16 2006
New Revision: 433735

URL: http://svn.apache.org/viewvc?rev=433735&view=rev
Log:
got rid of warning. set objectContext on persistent objects

Modified:
    incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.h
    incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.m
    incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.h
    incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.m

Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.h
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.h?rev=433735&r1=433734&r2=433735&view=diff
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.h 
(original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.h Tue Aug 
22 13:06:16 2006
@@ -19,6 +19,5 @@
 
 -(void)setConnection:(CAYClientConnection *)c;
 -(CAYClientConnection *)connection;
--(void)prepareForAccessForObject:(CAYPersistentObject *)o 
andProperty:(NSString *)prop;
 
 @end

Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.m
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.m?rev=433735&r1=433734&r2=433735&view=diff
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.m 
(original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectContext.m Tue Aug 
22 13:06:16 2006
@@ -10,6 +10,7 @@
 #import "CAYQueryMessage.h"
 #import "CAYQuery.h"
 #import "CAYPersistentObject.h"
+#import "CAYClientConnection.h"
 
 @implementation CAYObjectContext
 
@@ -20,18 +21,26 @@
        id result = [[self connection] sendMessage:queryMessage];
        [queryMessage release];
        
+    
        NSArray *results = [result results];
        
        NSArray *rows = [results objectAtIndex:0];
-       
-       NSLog(@"result2c %@", rows);
-       return rows;
-}
 
--(void)prepareForAccessForObject:(CAYPersistentObject *)o 
andProperty:(NSString *)prop
-{
-       // TODO: implement
-       // TODO: use the model to determine if the given property is a 
relation. issue a RelationshipQuery if needed
+    // connect objects to the context
+    int n = [rows count];
+    int i;
+    for(i = 0; i < n; i++)
+    {
+        id row = [rows objectAtIndex:i];
+        if([row isMemberOfClass:[CAYPersistentObject class]])
+        {
+            [row setObjectContext:self];
+            // TODO: set initial persistant state
+        }
+    }
+    
+       NSLog(@"query rows: %@", rows);
+       return rows;
 }
 
 -(void)setConnection:(CAYClientConnection *)c

Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.h
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.h?rev=433735&r1=433734&r2=433735&view=diff
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.h (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.h Tue Aug 22 
13:06:16 2006
@@ -25,8 +25,8 @@
 -(NSDictionary *)objectIdKeys;
 -(void)setSingleKey:(NSString *)sk;
 -(NSString *)singleKey;
--(void)setSingleValue:(NSData *)sv;
--(NSData *)singleValue;
+-(void)setSingleValue:(NSObject *)sv;
+-(NSObject *)singleValue;
 -(void)setTempKey:(NSData *)k;
 -(NSData *)tempKey;
 //-(void)setReplacementIdMap:(NSDictionary *)rm;

Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.m
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.m?rev=433735&r1=433734&r2=433735&view=diff
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/CAYObjectId.m Tue Aug 22 
13:06:16 2006
@@ -79,14 +79,14 @@
        return singleKey;
 }
 
--(void)setSingleValue:(NSData *)sv
+-(void)setSingleValue:(NSObject *)sv
 {
        [sv retain];
        [singleValue release];
        singleValue = sv;
 }
 
--(NSData *)singleValue
+-(NSObject *)singleValue
 {
        return singleValue;
 }


Reply via email to