cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torehal...@apache.org
Subject svn commit: r464291 - in /incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne: ./ CocoaCayenne.xcodeproj/
Date Sun, 15 Oct 2006 21:02:36 GMT
Author: torehalset
Date: Sun Oct 15 14:02:34 2006
New Revision: 464291

URL: http://svn.apache.org/viewvc?view=rev&rev=464291
Log:
refactoring. renamed CAYClientObjRelationship to CAYObjRelationship.

Added:
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.h
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.m
Removed:
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYClientObjRelationship.h
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYClientObjRelationship.m
Modified:
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYCocoaCayenne.m
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYDataMapIO.m
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjectContext.m
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYPersistentObject.m
    incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CocoaCayenne.xcodeproj/project.pbxproj

Modified: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYCocoaCayenne.m
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYCocoaCayenne.m?view=diff&rev=464291&r1=464290&r2=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYCocoaCayenne.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYCocoaCayenne.m Sun Oct 15 14:02:34
2006
@@ -34,7 +34,7 @@
     [classMapping setObject:@"CAYObjectId" forKey:@"org.apache.cayenne.ObjectId"];
     [classMapping setObject:@"CAYObjEntity" forKey:@"org.apache.cayenne.map.ObjEntity"];
     [classMapping setObject:@"CAYObjAttribute" forKey:@"org.apache.cayenne.map.ClientObjAttribute"];
-    [classMapping setObject:@"CAYClientObjRelationship" forKey:@"org.apache.cayenne.map.ClientObjRelationship"];
+    [classMapping setObject:@"CAYObjRelationship" forKey:@"org.apache.cayenne.map.ClientObjRelationship"];
     [classMapping setObject:@"CAYEntityResolver" forKey:@"org.apache.cayenne.map.ClientEntityResolver"];
     [classMapping setObject:@"CAYDataMap" forKey:@"org.apache.cayenne.map.DataMap"];
     [classMapping setObject:@"CAYCayenneRuntimeException" forKey:@"org.apache.cayenne.CayenneRuntimeException"];
@@ -58,9 +58,6 @@
     [classMapping setObject:@"CAYValidationException" forKey:@"org.apache.cayenne.validation.ValidationException"];
     [classMapping setObject:@"CAYBeanValidationFailure" forKey:@"org.apache.cayenne.validation.BeanValidationFailure"];
     [classMapping setObject:@"CAYValidationResult" forKey:@"org.apache.cayenne.validation.ValidationResult"];
-
-    // java
-    //[classMapping setObject:@"CAYBigDecimal" forKey:@"java.math.BigDecimal"];
 
     return classMapping;
 }

Modified: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYDataMapIO.m
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYDataMapIO.m?view=diff&rev=464291&r1=464290&r2=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYDataMapIO.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYDataMapIO.m Sun Oct 15 14:02:34
2006
@@ -21,7 +21,7 @@
 
 #import "CAYObjEntity.h"
 #import "CAYObjAttribute.h"
-#import "CAYClientObjRelationship.h"
+#import "CAYObjRelationship.h"
 
 @implementation CAYDataMapIO
 
@@ -79,7 +79,7 @@
         NSString *relName = nil;
         while(relName = [relEnumerator nextObject])
         {
-            CAYClientObjRelationship *cayRelationship = [[cayEntity relationships] valueForKey:relName];
+            CAYObjRelationship *cayRelationship = [[cayEntity relationships] valueForKey:relName];
             NSRelationshipDescription *cdRelationship = [[NSRelationshipDescription alloc]
init];
             [cdRelationship setName:relName];
             NSEntityDescription *destEntity = [cdEntityByEntityName valueForKey:[cayRelationship
targetEntityName]];
@@ -116,7 +116,7 @@
         NSString *relName = nil;
         while(relName = [relEnumerator nextObject])
         {
-            CAYClientObjRelationship *cayRelationship = [[cayEntity relationships] valueForKey:relName];
+            CAYObjRelationship *cayRelationship = [[cayEntity relationships] valueForKey:relName];
             NSRelationshipDescription *cdRelationship = [cdRelationshipsByRelationName objectForKey:[cayRelationship
name]];
             if(!cdRelationship)
             {

Added: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.h
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.h?view=auto&rev=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.h (added)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.h Sun Oct 15 14:02:34
2006
@@ -0,0 +1,40 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface CAYObjRelationship : NSObject <NSCoding> {
+
+	BOOL toMany;
+	NSString *name;
+	NSString *targetEntityName;
+    NSString *reverseRelationshipName;
+	
+}
+
+-(void)setName:(NSString *)n;
+-(NSString *)name;
+-(void)setReverseRelationshipName:(NSString *)n;
+-(NSString *)reverseRelationshipName;
+-(void)setTargetEntityName:(NSString *)n;
+-(NSString *)targetEntityName;
+-(BOOL)isToMany;
+
+@end

Added: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.m
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.m?view=auto&rev=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.m (added)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjRelationship.m Sun Oct 15 14:02:34
2006
@@ -0,0 +1,103 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+#import "CAYObjRelationship.h"
+
+
+@implementation CAYObjRelationship
+
+-(id)initWithCoder:(NSCoder*)coder
+{
+	[super init];
+	// TODO: correct with clientToMany instead of toMany?
+	toMany = [coder decodeBoolForKey:@"clientToMany"];
+	[self setName:[coder decodeObjectForKey:@"name"]];
+	[self setTargetEntityName:[coder decodeObjectForKey:@"targetEntityName"]];
+	[self setReverseRelationshipName:[coder decodeObjectForKey:@"reverseRelationshipName"]];
+	return self;
+}
+
+-(void)encodeWithCoder:(NSCoder*)coder
+{
+	// TODO: correct with clientToMany
+	[coder encodeBool:toMany forKey:@"clientToMany"];
+	[coder encodeObject:name forKey:@"name"];
+	[coder encodeObject:targetEntityName forKey:@"targetEntityName"];
+	[coder encodeObject:reverseRelationshipName forKey:@"reverseRelationshipName"];
+}
+
+-(void)setName:(NSString *)n
+{
+	[n retain];
+	[name release];
+	name = n;
+}
+
+-(NSString *)name
+{
+	return name;
+}
+
+-(void)setReverseRelationshipName:(NSString *)n
+{
+    [n retain];
+    [reverseRelationshipName release];
+    reverseRelationshipName = n;
+}
+
+-(NSString *)reverseRelationshipName
+{
+    return reverseRelationshipName;
+}
+
+-(void)setTargetEntityName:(NSString *)n
+{
+	[n retain];
+	[targetEntityName release];
+	targetEntityName = n;
+}
+
+-(NSString *)targetEntityName
+{
+	return targetEntityName;
+}
+
+-(BOOL)isToMany
+{
+    return toMany;
+}
+
+-(NSString *)description
+{
+    NSString *result;
+    result = [[NSString alloc] initWithFormat:@"%@ {toMany = %i; name = %@; targetEntityName
= %@; reverseRelationshipName = %@}", [self class], [self isToMany], [self name], [self targetEntityName],
[self reverseRelationshipName]];
+    [result autorelease];
+    return result;
+}
+
+-(void)dealloc
+{
+    [self setName:nil];
+    [self setTargetEntityName:nil];
+    [self setReverseRelationshipName:nil];
+	[super dealloc];
+}
+
+
+@end

Modified: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjectContext.m
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjectContext.m?view=diff&rev=464291&r1=464290&r2=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjectContext.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYObjectContext.m Sun Oct 15 14:02:34
2006
@@ -26,7 +26,7 @@
 #import "CAYCompoundDiff.h"
 #import "CAYSyncMessage.h"
 #import "CAYObjEntity.h"
-#import "CAYClientObjRelationship.h"
+#import "CAYObjRelationship.h"
 #import "CAYNodeCreateOperation.h"
 #import "CAYNodeDeleteOperation.h"
 #import "CAYCocoaCayenne.h"

Modified: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYPersistentObject.m
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYPersistentObject.m?view=diff&rev=464291&r1=464290&r2=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYPersistentObject.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CAYPersistentObject.m Sun Oct 15 14:02:34
2006
@@ -22,7 +22,7 @@
 #import "CAYObjectContext.h"
 #import "CAYFault.h"
 #import "CAYObjEntity.h"
-#import "CAYClientObjRelationship.h"
+#import "CAYObjRelationship.h"
 #import "CAYCocoaCayenne.h"
 #import "CAYFault.h"
 #import "CAYToManyFault.h"
@@ -109,7 +109,7 @@
     NSString *relname;
     while(relname = [enumerator nextObject])
     {
-        CAYClientObjRelationship *rel = (CAYClientObjRelationship *)[relations objectForKey:relname];
+        CAYObjRelationship *rel = (CAYObjRelationship *)[relations objectForKey:relname];
         NSLog(@"DEBUG: create fault for relation %@.%@: %@", [objEntity name], relname, rel);
         CAYFault *fault = nil;
         if([rel isToMany])
@@ -131,7 +131,7 @@
     
     // see if the key is a relationship
     CAYObjEntity *objEntity = [[[self objectContext] entityResolver] lookupObjEntity:self];
-    CAYClientObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
+    CAYObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
 	
     if (relationship)
     {
@@ -394,11 +394,11 @@
 	
 	// find relationship
     CAYObjEntity *objEntity = [[[self objectContext] entityResolver] lookupObjEntity:self];
-    CAYClientObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
+    CAYObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
 	
 	// find reverse relationship. could be nil.
 	CAYObjEntity *revObjEntity = [[[self objectContext] entityResolver] lookupObjEntity:value];
-	CAYClientObjRelationship *revRelationship = [[revObjEntity relationships] valueForKey:[relationship
reverseRelationshipName]];
+	CAYObjRelationship *revRelationship = [[revObjEntity relationships] valueForKey:[relationship
reverseRelationshipName]];
 	
 	if(revRelationship)
 	{
@@ -419,11 +419,11 @@
 	
 	// find relationship
     CAYObjEntity *objEntity = [[[self objectContext] entityResolver] lookupObjEntity:self];
-    CAYClientObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
+    CAYObjRelationship *relationship = [[objEntity relationships] valueForKey:key];
 	
 	// find reverse relationship. could be nil.
 	CAYObjEntity *revObjEntity = [[[self objectContext] entityResolver] lookupObjEntity:value];
-	CAYClientObjRelationship *revRelationship = [[revObjEntity relationships] valueForKey:[relationship
reverseRelationshipName]];
+	CAYObjRelationship *revRelationship = [[revObjEntity relationships] valueForKey:[relationship
reverseRelationshipName]];
 	
 	if(revRelationship)
 	{

Modified: incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CocoaCayenne.xcodeproj/project.pbxproj
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CocoaCayenne.xcodeproj/project.pbxproj?view=diff&rev=464291&r1=464290&r2=464291
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CocoaCayenne.xcodeproj/project.pbxproj
(original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CocoaCayenne/CocoaCayenne.xcodeproj/project.pbxproj
Sun Oct 15 14:02:34 2006
@@ -19,8 +19,8 @@
 		44463D9E0AA37577006BAA58 /* CAYClientConnection.m in Sources */ = {isa = PBXBuildFile;
fileRef = 44463D6E0AA37577006BAA58 /* CAYClientConnection.m */; };
 		44463D9F0AA37577006BAA58 /* CAYClientMessage.h in Headers */ = {isa = PBXBuildFile; fileRef
= 44463D6F0AA37577006BAA58 /* CAYClientMessage.h */; settings = {ATTRIBUTES = (Public, );
}; };
 		44463DA00AA37577006BAA58 /* CAYClientMessage.m in Sources */ = {isa = PBXBuildFile; fileRef
= 44463D700AA37577006BAA58 /* CAYClientMessage.m */; };
-		44463DA10AA37577006BAA58 /* CAYClientObjRelationship.h in Headers */ = {isa = PBXBuildFile;
fileRef = 44463D710AA37577006BAA58 /* CAYClientObjRelationship.h */; settings = {ATTRIBUTES
= (Public, ); }; };
-		44463DA20AA37577006BAA58 /* CAYClientObjRelationship.m in Sources */ = {isa = PBXBuildFile;
fileRef = 44463D720AA37577006BAA58 /* CAYClientObjRelationship.m */; };
+		44463DA10AA37577006BAA58 /* CAYObjRelationship.h in Headers */ = {isa = PBXBuildFile; fileRef
= 44463D710AA37577006BAA58 /* CAYObjRelationship.h */; settings = {ATTRIBUTES = (Public, );
}; };
+		44463DA20AA37577006BAA58 /* CAYObjRelationship.m in Sources */ = {isa = PBXBuildFile; fileRef
= 44463D720AA37577006BAA58 /* CAYObjRelationship.m */; };
 		44463DA30AA37577006BAA58 /* CAYCompoundDiff.h in Headers */ = {isa = PBXBuildFile; fileRef
= 44463D730AA37577006BAA58 /* CAYCompoundDiff.h */; settings = {ATTRIBUTES = (Public, ); };
};
 		44463DA40AA37577006BAA58 /* CAYCompoundDiff.m in Sources */ = {isa = PBXBuildFile; fileRef
= 44463D740AA37577006BAA58 /* CAYCompoundDiff.m */; };
 		44463DA50AA37577006BAA58 /* CAYDataMap.h in Headers */ = {isa = PBXBuildFile; fileRef =
44463D750AA37577006BAA58 /* CAYDataMap.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -106,8 +106,8 @@
 		44463D6E0AA37577006BAA58 /* CAYClientConnection.m */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.objc; path = CAYClientConnection.m; sourceTree = "<group>";
};
 		44463D6F0AA37577006BAA58 /* CAYClientMessage.h */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.h; path = CAYClientMessage.h; sourceTree = "<group>";
};
 		44463D700AA37577006BAA58 /* CAYClientMessage.m */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.objc; path = CAYClientMessage.m; sourceTree = "<group>";
};
-		44463D710AA37577006BAA58 /* CAYClientObjRelationship.h */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.h; path = CAYClientObjRelationship.h; sourceTree =
"<group>"; };
-		44463D720AA37577006BAA58 /* CAYClientObjRelationship.m */ = {isa = PBXFileReference; fileEncoding
= 30; languageSpecificationIdentifier = c.objc; lastKnownFileType = sourcecode.c.objc; path
= CAYClientObjRelationship.m; sourceTree = "<group>"; wrapsLines = 0; };
+		44463D710AA37577006BAA58 /* CAYObjRelationship.h */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.h; path = CAYObjRelationship.h; sourceTree = "<group>";
};
+		44463D720AA37577006BAA58 /* CAYObjRelationship.m */ = {isa = PBXFileReference; fileEncoding
= 30; languageSpecificationIdentifier = c.objc; lastKnownFileType = sourcecode.c.objc; path
= CAYObjRelationship.m; sourceTree = "<group>"; wrapsLines = 0; };
 		44463D730AA37577006BAA58 /* CAYCompoundDiff.h */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.h; path = CAYCompoundDiff.h; sourceTree = "<group>";
};
 		44463D740AA37577006BAA58 /* CAYCompoundDiff.m */ = {isa = PBXFileReference; fileEncoding
= 30; lastKnownFileType = sourcecode.c.objc; path = CAYCompoundDiff.m; sourceTree = "<group>";
};
 		44463D750AA37577006BAA58 /* CAYDataMap.h */ = {isa = PBXFileReference; fileEncoding = 30;
lastKnownFileType = sourcecode.c.h; path = CAYDataMap.h; sourceTree = "<group>"; };
@@ -293,8 +293,8 @@
 				44463D760AA37577006BAA58 /* CAYDataMap.m */,
 				44463D890AA37577006BAA58 /* CAYObjEntity.h */,
 				44463D8A0AA37577006BAA58 /* CAYObjEntity.m */,
-				44463D710AA37577006BAA58 /* CAYClientObjRelationship.h */,
-				44463D720AA37577006BAA58 /* CAYClientObjRelationship.m */,
+				44463D710AA37577006BAA58 /* CAYObjRelationship.h */,
+				44463D720AA37577006BAA58 /* CAYObjRelationship.m */,
 				4407C1300ABAD50D0065409F /* CAYObjAttribute.h */,
 				4407C1310ABAD50D0065409F /* CAYObjAttribute.m */,
 				44BD0F9B0ABF08320005EE1E /* CAYDataMapIO.h */,
@@ -403,7 +403,7 @@
 				44463D9B0AA37577006BAA58 /* CAYBootstrapMessage.h in Headers */,
 				44463D9D0AA37577006BAA58 /* CAYClientConnection.h in Headers */,
 				44463D9F0AA37577006BAA58 /* CAYClientMessage.h in Headers */,
-				44463DA10AA37577006BAA58 /* CAYClientObjRelationship.h in Headers */,
+				44463DA10AA37577006BAA58 /* CAYObjRelationship.h in Headers */,
 				44463DA30AA37577006BAA58 /* CAYCompoundDiff.h in Headers */,
 				44463DA50AA37577006BAA58 /* CAYDataMap.h in Headers */,
 				44463DA70AA37577006BAA58 /* CAYEntityResolver.h in Headers */,
@@ -498,7 +498,7 @@
 				44463D9C0AA37577006BAA58 /* CAYBootstrapMessage.m in Sources */,
 				44463D9E0AA37577006BAA58 /* CAYClientConnection.m in Sources */,
 				44463DA00AA37577006BAA58 /* CAYClientMessage.m in Sources */,
-				44463DA20AA37577006BAA58 /* CAYClientObjRelationship.m in Sources */,
+				44463DA20AA37577006BAA58 /* CAYObjRelationship.m in Sources */,
 				44463DA40AA37577006BAA58 /* CAYCompoundDiff.m in Sources */,
 				44463DA60AA37577006BAA58 /* CAYDataMap.m in Sources */,
 				44463DA80AA37577006BAA58 /* CAYEntityResolver.m in Sources */,



Mime
View raw message