diff --git a/ChangeLog b/ChangeLog
index fe321b1..c9ea78d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2007-01-01 David Ayers
+
+ * EOAccess/EOAccessFault.h/m: Minor cleanups for autogsdoc.
+ * EOAccess/EOAdaptor.m: Ditto.
+ * EOAccess/EOAdaptorChannel.h/m: Ditto.
+ * EOAccess/EOAdaptorContext.h: Ditto.
+ * EOAccess/EODatabase.h/m: Ditto.
+ * EOAccess/EODatabaseChannel.m: Ditto.
+ * EOAccess/EODatabaseContext.h/m: Ditto.
+ * EOAccess/EODatabaseDataSource.h: Ditto.
+ * EOAccess/EODatabaseOperation.h: Ditto.
+ * EOAccess/EOEntity.h/m: Ditto.
+ * EOAccess/EOModel.h/m: Ditto.
+ * EOAccess/EORelationship.h: Ditto.
+ * EOAccess/EOSchemaGeneration.h: Ditto.
+ * EOAccess/EOUtilities.h/m: Ditto.
+
+ * EOAccess/EOSQLExpression.h/m: Minor cleanups for autogsdoc.
+ (EOSchemaGeneration): Move implementation from here to ...
+ * EOAccess/EOSchemaGeneration.m: ... new file for autogsdoc.
+ * EOAccess/GNUmakefile: Add EOSchemaGeneration.m.
+
+ * EOAccess/EOUtilities.m (EOObjectStoreCoordinator EOModelGroup):
+ Move implementation from here to ...
+ * EOAccess/EOModelGroup.m: ... to here for autogsdoc.
+
+ * common.make: (GDL2_AGSDOC_FLAGS): Add extern declarations.
+
2006-12-31 David Ayers
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLValues.h/m:
diff --git a/EOAccess/EOAccessFault.h b/EOAccess/EOAccessFault.h
index 5ae2d85..1359f95 100644
--- a/EOAccess/EOAccessFault.h
+++ b/EOAccess/EOAccessFault.h
@@ -87,12 +87,12 @@
}
+ (EOAccessArrayFaultHandler *)accessArrayFaultHandlerWithSourceGlobalID: (EOKeyGlobalID *)sourceGID
- relationshipName: (NSString *)relationshipName
+ relationshipName: (NSString *)relName
databaseContext: (EODatabaseContext *)dbcontext
editingContext: (EOEditingContext *)ec;
- (id)initWithSourceGlobalID: (EOKeyGlobalID *)sourceGID
- relationshipName: (NSString *)relationshipName
+ relationshipName: (NSString *)relName
databaseContext: (EODatabaseContext *)dbcontext
editingContext: (EOEditingContext *)ec;
diff --git a/EOAccess/EOAccessFault.m b/EOAccess/EOAccessFault.m
index 5d776cb..1e89881 100644
--- a/EOAccess/EOAccessFault.m
+++ b/EOAccess/EOAccessFault.m
@@ -285,12 +285,12 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
@implementation EOAccessArrayFaultHandler
+ (EOAccessArrayFaultHandler *)accessArrayFaultHandlerWithSourceGlobalID: (EOKeyGlobalID *)sourceGID
- relationshipName: (NSString *)aRelationshipName
+ relationshipName: (NSString *)relName
databaseContext: (EODatabaseContext *)dbcontext
editingContext: (EOEditingContext *)ec
{
return [[[self alloc] initWithSourceGlobalID: sourceGID
- relationshipName: aRelationshipName
+ relationshipName: relName
databaseContext: dbcontext
editingContext: ec] autorelease];
}
@@ -304,10 +304,10 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
return self;
}
-- initWithSourceGlobalID: (EOKeyGlobalID *)sourceGID
- relationshipName: (NSString *)relName
- databaseContext: (EODatabaseContext *)dbcontext
- editingContext: (EOEditingContext *)ec
+- (id)initWithSourceGlobalID: (EOKeyGlobalID *)sourceGID
+ relationshipName: (NSString *)relName
+ databaseContext: (EODatabaseContext *)dbcontext
+ editingContext: (EOEditingContext *)ec
{
if ((self = [self init]))
{
diff --git a/EOAccess/EOAdaptor.m b/EOAccess/EOAdaptor.m
index 58363fa..4369049 100644
--- a/EOAccess/EOAdaptor.m
+++ b/EOAccess/EOAdaptor.m
@@ -184,7 +184,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
return adaptor;
}
-+ (id) adaptorWithName: (NSString *)adaptorName
++ (id) adaptorWithName: (NSString *)name
{
//OK
NSBundle *bundle = [NSBundle mainBundle];
@@ -195,7 +195,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
unsigned i, count;
/* Check error */
- if ([adaptorName length] == 0)
+ if ([name length] == 0)
[NSException raise: NSInvalidArgumentException
format: @"%@ -- %@ 0x%x: adaptor name can't be nil",
NSStringFromSelector(_cmd),
@@ -203,11 +203,11 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
self];
// append EOAdaptor
- if ([adaptorName hasSuffix: @"EOAdaptor"] == NO)
- adaptorName = [adaptorName stringByAppendingString: @"EOAdaptor"];
+ if ([name hasSuffix: @"EOAdaptor"] == NO)
+ name = [name stringByAppendingString: @"EOAdaptor"];
/* Look in application bundle */
- adaptorBundlePath = [bundle pathForResource: adaptorName
+ adaptorBundlePath = [bundle pathForResource: name
ofType: @"framework"];
// should be NSString *path=[NSBundle pathForLibraryResource:libraryResource type:@"framework" directory:@"Frameworks"]; ?
@@ -230,7 +230,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
for(i = 0, count = [paths count]; i < count; i++)
{
bundle = [NSBundle bundleWithPath: [paths objectAtIndex: i]];
- adaptorBundlePath = [bundle pathForResource: adaptorName
+ adaptorBundlePath = [bundle pathForResource: name
ofType: @"framework"];
if(adaptorBundlePath && [adaptorBundlePath length])
@@ -251,7 +251,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
- adaptorName];
+ name];
/* Get the adaptor bundle "infoDictionary", and pricipal class, ie. the
adaptor class. Other info about the adaptor should be put in the
@@ -281,7 +281,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
- adaptorName];
+ name];
}
if ([adaptorClass isSubclassOfClass: [self class]] == NO)
@@ -294,7 +294,7 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
NSStringFromClass([adaptorClass class])];
}
- return AUTORELEASE([[adaptorClass alloc] initWithName: adaptorName]);
+ return AUTORELEASE([[adaptorClass alloc] initWithName: name]);
}
+ (void)setExpressionClassName: (NSString *)sqlExpressionClassName
diff --git a/EOAccess/EOAdaptorChannel.h b/EOAccess/EOAdaptorChannel.h
index 40a4f8b..ea95f72 100644
--- a/EOAccess/EOAdaptorChannel.h
+++ b/EOAccess/EOAdaptorChannel.h
@@ -117,10 +117,10 @@ inRowDescribedByQualifier: (EOQualifier *)qualifier
/* Fetching rows */
- (void)selectAttributes: (NSArray *)attributes
fetchSpecification: (EOFetchSpecification *)fetchSpecification
- lock: (BOOL)lockFlag
+ lock: (BOOL)flag
entity: (EOEntity *)entity;
-- (void)lockRowComparingAttributes: (NSArray *)atts
+- (void)lockRowComparingAttributes: (NSArray *)attrs
entity: (EOEntity *)entity
qualifier: (EOQualifier *)qualifier
snapshot: (NSDictionary *)snapshot;
@@ -150,7 +150,7 @@ inRowDescribedByQualifier: (EOQualifier *)qualifier
- (void)addStoredProceduresNamed: (NSArray *)storedProcedureNames
toModel: (EOModel *)model;
-- (void)setDebugEnabled: (BOOL)yn;
+- (void)setDebugEnabled: (BOOL)flag;
- (BOOL)isDebugEnabled;
- (id)delegate;
diff --git a/EOAccess/EOAdaptorChannel.m b/EOAccess/EOAdaptorChannel.m
index 38dd92b..f171a93 100644
--- a/EOAccess/EOAdaptorChannel.m
+++ b/EOAccess/EOAdaptorChannel.m
@@ -118,13 +118,13 @@ NSString *EOAdaptorOptimisticLockingFailure = @"EOAdaptorOptimisticLockingFailur
[self subclassResponsibility: _cmd];
}
-- (void)updateValues: (NSDictionary *)row
+- (void)updateValues: (NSDictionary *)values
inRowDescribedByQualifier: (EOQualifier *)qualifier
entity: (EOEntity *)entity
{
int rows;
- rows = [self updateValues: row
+ rows = [self updateValues: values
inRowsDescribedByQualifier: qualifier
entity: entity];
diff --git a/EOAccess/EOAdaptorContext.h b/EOAccess/EOAdaptorContext.h
index 30ae65a..5991a26 100644
--- a/EOAccess/EOAdaptorContext.h
+++ b/EOAccess/EOAdaptorContext.h
@@ -110,7 +110,7 @@ typedef enum {
- (BOOL)canNestTransactions; // override
- (unsigned)transactionNestingLevel;
-+ (void)setDebugEnabledDefault: (BOOL)yn;
++ (void)setDebugEnabledDefault: (BOOL)flag;
+ (BOOL)debugEnabledDefault;
- (void)setDebugEnabled: (BOOL)debugEnabled;
- (BOOL)isDebugEnabled;
diff --git a/EOAccess/EODatabase.h b/EOAccess/EODatabase.h
index 6f05e0b..d7b077d 100644
--- a/EOAccess/EODatabase.h
+++ b/EOAccess/EODatabase.h
@@ -114,7 +114,7 @@ GDL2ACCESS_EXPORT NSTimeInterval EODistantPastTimeInterval;
- (void)forgetSnapshotForGlobalID: (EOGlobalID *)gid;
-- (void)forgetSnapshotsForGlobalIDs: (NSArray *)array;
+- (void)forgetSnapshotsForGlobalIDs: (NSArray *)gids;
- (void)forgetAllSnapshots;
diff --git a/EOAccess/EODatabase.m b/EOAccess/EODatabase.m
index a8ddaf8..e670347 100644
--- a/EOAccess/EODatabase.m
+++ b/EOAccess/EODatabase.m
@@ -239,7 +239,7 @@ static NSMutableArray *databaseInstances;
[_models removeObject: model];
}
-- (BOOL)addModelIfCompatible: (EOModel *)model;
+- (BOOL)addModelIfCompatible: (EOModel *)model
{
BOOL modelOk = NO;
@@ -543,17 +543,17 @@ static NSMutableArray *databaseInstances;
EOFLOGObjectFnStop();
};
-- (void)forgetSnapshotsForGlobalIDs: (NSArray*)ids
+- (void)forgetSnapshotsForGlobalIDs: (NSArray*)gids
{
NSEnumerator *gidEnum = nil;
id gid = nil;
EOFLOGObjectFnStart();
- NSAssert(ids, @"No Global IDs");
- EOFLOGObjectLevelArgs(@"EODatabaseContext", @"ids=%@", ids);
+ NSAssert(gids, @"No Global IDs");
+ EOFLOGObjectLevelArgs(@"EODatabaseContext", @"gids=%@", gids);
- gidEnum = [ids objectEnumerator];
+ gidEnum = [gids objectEnumerator];
while ((gid = [gidEnum nextObject]))
{
@@ -564,7 +564,7 @@ static NSMutableArray *databaseInstances;
[[NSNotificationCenter defaultCenter]
postNotificationName: EOObjectsChangedInStoreNotification
object: self
- userInfo: [NSDictionary dictionaryWithObject: ids
+ userInfo: [NSDictionary dictionaryWithObject: gids
forKey: EOInvalidatedKey]];
EOFLOGObjectFnStop();
diff --git a/EOAccess/EODatabaseChannel.m b/EOAccess/EODatabaseChannel.m
index 50fce33..0c5317b 100644
--- a/EOAccess/EODatabaseChannel.m
+++ b/EOAccess/EODatabaseChannel.m
@@ -223,7 +223,7 @@ RCS_ID("$Id$")
ASSIGN(_currentEditingContext, context);
}
-- (void)selectObjectsWithFetchSpecification: (EOFetchSpecification *)fetch
+- (void)selectObjectsWithFetchSpecification: (EOFetchSpecification *)fetchSpecification
editingContext: (EOEditingContext *)context
{
//should be OK
@@ -235,7 +235,7 @@ RCS_ID("$Id$")
EOFLOGObjectFnStart();
- entityName = [fetch entityName];
+ entityName = [fetchSpecification entityName];
database = [_databaseContext database];
EOFLOGObjectLevelArgs(@"gsdb", @"database=%@", database);
@@ -244,7 +244,7 @@ RCS_ID("$Id$")
EOFLOGObjectLevelArgs(@"gsdb", @"entity name=%@", [entity name]);
- qualifier=[fetch qualifier];
+ qualifier=[fetchSpecification qualifier];
EOFLOGObjectLevelArgs(@"gsdb", @"qualifier=%@", qualifier);
@@ -259,18 +259,18 @@ RCS_ID("$Id$")
{
EOFetchSpecification *newFetch = nil;
- EOFLOGObjectLevelArgs(@"gsdb", @"fetch=%@", fetch);
+ EOFLOGObjectLevelArgs(@"gsdb", @"fetchSpecification=%@", fetchSpecification);
//howto avoid copy of uncopiable qualifiers (i.e. those who contains uncopiable key or value)
- EOFLOGObjectLevelArgs(@"gsdb", @"fetch=%@", fetch);
+ EOFLOGObjectLevelArgs(@"gsdb", @"fetchSpecification=%@", fetchSpecification);
- newFetch = [[fetch copy] autorelease];
+ newFetch = [[fetchSpecification copy] autorelease];
EOFLOGObjectLevelArgs(@"gsdb", @"newFetch=%@", newFetch);
[newFetch setQualifier: schemaBasedQualifier];
EOFLOGObjectLevelArgs(@"gsdb", @"newFetch=%@", newFetch);
- fetch = newFetch;
+ fetchSpecification = newFetch;
}
EOFLOGObjectLevelArgs(@"gsdb", @"%@ -- %@ 0x%x: isFetchInProgress=%s",
@@ -279,7 +279,7 @@ RCS_ID("$Id$")
self,
([self isFetchInProgress] ? "YES" : "NO"));
- [self _selectWithFetchSpecification:fetch
+ [self _selectWithFetchSpecification:fetchSpecification
editingContext:context];
EOFLOGObjectFnStop();
diff --git a/EOAccess/EODatabaseContext.h b/EOAccess/EODatabaseContext.h
index 8f2e604..dab8629 100644
--- a/EOAccess/EODatabaseContext.h
+++ b/EOAccess/EODatabaseContext.h
@@ -157,7 +157,7 @@ struct _EOTransactionScope;
- (id)faultForRawRow: (NSDictionary *)row
entityNamed: (NSString *)entityName
- editingContext: (EOEditingContext *)editingContext;
+ editingContext: (EOEditingContext *)context;
- (id)entityForGlobalID: (EOGlobalID *)globalID;
@@ -165,7 +165,7 @@ struct _EOTransactionScope;
editingContext: (EOEditingContext *)context;
- (NSArray *)arrayFaultWithSourceGlobalID: (EOGlobalID *)globalID
- relationshipName: (NSString *)name
+ relationshipName: (NSString *)relationshipName
editingContext: (EOEditingContext *)context;
- (void)initializeObject: (id)object
@@ -192,7 +192,7 @@ struct _EOTransactionScope;
- (BOOL)isObjectLockedWithGlobalID: (EOGlobalID *)gid
editingContext: (EOEditingContext *)context;
-- (void)lockObjectWithGlobalID: (EOGlobalID *)gid
+- (void)lockObjectWithGlobalID: (EOGlobalID *)globalID
editingContext: (EOEditingContext *)context;
- (void)invalidateAllObjects;
@@ -252,8 +252,8 @@ It's invoked after prepareForSaveWithCoordinator:editingContext: and before owns
- (EODatabaseOperation*)databaseOperationForObject: (id)object;
- (EODatabaseOperation*)databaseOperationForGlobalID: (EOGlobalID *)gid;
- (void)recordDatabaseOperation: (EODatabaseOperation*)databaseOpe;
-- (void)recordDeleteForObject: (id)param0;
-- (void)recordInsertForObject: (id)param0;
+- (void)recordDeleteForObject: (id)object;
+- (void)recordInsertForObject: (id)object;
- (void)createAdaptorOperationsForDatabaseOperation: (EODatabaseOperation *)dbOpe
attributes: (NSArray *)attributes;
@@ -266,7 +266,7 @@ It's invoked after prepareForSaveWithCoordinator:editingContext: and before owns
- (BOOL)isValidQualifierTypeForAttribute: (EOAttribute *)attribute;
- (id)lockingNonQualifiableAttributes: (NSArray *)attributes;
- (NSArray *)lockingAttributesForAttributes: (NSArray *)attributes
- entity: (EOEntity *)enity;
+ entity: (EOEntity *)entity;
- (NSArray *)primaryKeyAttributesForAttributes: (NSArray *)attributes
entity: (EOEntity *)entity;
- (EOQualifier *)qualifierForLockingAttributes: (NSArray *)attributes
diff --git a/EOAccess/EODatabaseContext.m b/EOAccess/EODatabaseContext.m
index 8550696..193bead 100644
--- a/EOAccess/EODatabaseContext.m
+++ b/EOAccess/EODatabaseContext.m
@@ -1323,7 +1323,7 @@ userInfo = {
EOFLOGObjectFnStop();
}
-- (NSArray *)objectsWithFetchSpecification: (EOFetchSpecification *)fetch
+- (NSArray *)objectsWithFetchSpecification: (EOFetchSpecification *)fetchSpecification
editingContext: (EOEditingContext *)context
{ // TODO
EODatabaseChannel *channel = nil;
@@ -1346,12 +1346,12 @@ userInfo = {
EOFLOGObjectFnStart();
- NSDebugMLLog(@"EODatabaseContext", @"fetch=%@", fetch);
+ NSDebugMLLog(@"EODatabaseContext", @"fetchSpecification=%@", fetchSpecification);
if (_delegateRespondsTo.shouldFetchObjects == YES)
{
array = (id)[_delegate databaseContext: self
- shouldFetchObjectsWithFetchSpecification: fetch
+ shouldFetchObjectsWithFetchSpecification: fetchSpecification
editingContext: context];
}
@@ -1360,28 +1360,28 @@ userInfo = {
IMP enumNO=NULL; // nextObject
array = [NSMutableArray arrayWithCapacity: 8];
- entityName = [fetch entityName];//OK
+ entityName = [fetchSpecification entityName];//OK
entity = [_database entityNamed: entityName];//OK
NSAssert1(entity,@"No entity named %@",
entityName);
- /* moved in EODatabaseChannel _selectWithFetchSpecification:(EOFetchSpecification *)fetch
+ /* moved in EODatabaseChannel _selectWithFetchSpecification:(EOFetchSpecification *)fetchSpecification
editingContext:(EOEditingContext *)context
- limit = [fetch fetchLimit];
- usesDistinct = [fetch usesDistinct];
+ limit = [fetchSpecification fetchLimit];
+ usesDistinct = [fetchSpecification usesDistinct];
subEntities = [entity subEntities];
- if ([subEntities count] && [fetch isDeep] == YES)
+ if ([subEntities count] && [fetchSpecification isDeep] == YES)
{
subEntitiesEnum = [subEntities objectEnumerator];
while ((subEntity = [subEntitiesEnum nextObject]))
{
EOFetchSpecification *fetchSubEntity;
- fetchSubEntity = AUTORELEASE([fetch copy]);
+ fetchSubEntity = AUTORELEASE([fetchSpecification copy]);
[fetchSubEntity setEntityName:[entity name]];
[array addObjectsFromArray:[context objectsWithFetchSpecification:
@@ -1389,7 +1389,7 @@ userInfo = {
}
}
*/
- rawRowKeyPaths = [fetch rawRowKeyPaths];//OK
+ rawRowKeyPaths = [fetchSpecification rawRowKeyPaths];//OK
if (rawRowKeyPaths)
#if 0
{
@@ -1437,15 +1437,15 @@ userInfo = {
NSAutoreleasePool *arp = nil;//To avoid too much memory use when fetching a lot of objects
int limit = 0;
- [channel selectObjectsWithFetchSpecification: fetch
+ [channel selectObjectsWithFetchSpecification: fetchSpecification
editingContext: context];//OK
NSDebugMLLog(@"EODatabaseContext",
@"[channel isFetchInProgress]=%s",
([channel isFetchInProgress] ? "YES" : "NO"));
- limit = [fetch fetchLimit];//OK
- promptsAfterFetchLimit = [fetch promptsAfterFetchLimit];
+ limit = [fetchSpecification fetchLimit];//OK
+ promptsAfterFetchLimit = [fetchSpecification promptsAfterFetchLimit];
NSDebugMLLog(@"EODatabaseContext", @"Will Fetch");
@@ -1583,7 +1583,7 @@ userInfo = {
EOGlobalID *gid;
BOOL isFault;
- qualifier = [fetch qualifier];
+ qualifier = [fetchSpecification qualifier];
cache = (id)[_database resultCacheForEntityNamed: entityName];
if (cache == nil)
@@ -1739,9 +1739,9 @@ userInfo = {
NSDebugMLLog(@"EODatabaseContext", @"array before sort: %@", array);
- if ([fetch sortOrderings])
+ if ([fetchSpecification sortOrderings])
array = (id)[array sortedArrayUsingKeyOrderArray:
- [fetch sortOrderings]];
+ [fetchSpecification sortOrderings]];
}
else
{
@@ -1780,7 +1780,7 @@ userInfo = {
NSAutoreleasePool *arp = nil;//To avoid too much memory use when fetching a lot of objects
int limit = 0;
- [channel selectObjectsWithFetchSpecification: fetch
+ [channel selectObjectsWithFetchSpecification: fetchSpecification
editingContext: context];//OK
NSDebugMLLog(@"EODatabaseContext",
@@ -1788,8 +1788,8 @@ userInfo = {
([channel isFetchInProgress]
? "YES" : "NO"));
- limit = [fetch fetchLimit];//OK
- promptsAfterFetchLimit = [fetch promptsAfterFetchLimit];
+ limit = [fetchSpecification fetchLimit];//OK
+ promptsAfterFetchLimit = [fetchSpecification promptsAfterFetchLimit];
NSDebugMLLog(@"EODatabaseContext", @"Will Fetch");
@@ -1925,10 +1925,10 @@ userInfo = {
NSDebugMLLog(@"EODatabaseContext",
@"array before prefetchingRelationshipKeyPaths: %@", array);
- if ([fetch prefetchingRelationshipKeyPaths]) //OK
+ if ([fetchSpecification prefetchingRelationshipKeyPaths]) //OK
qualArray = [NSMutableArray arrayWithCapacity: 5];
- relationshipKeyPathEnum = [[fetch prefetchingRelationshipKeyPaths]
+ relationshipKeyPathEnum = [[fetchSpecification prefetchingRelationshipKeyPaths]
objectEnumerator];
enumNO=NULL;
while ((relationshipKeyPath = GDL2_NextObjectWithImpPtr(relationshipKeyPathEnum,&enumNO)))
@@ -1958,7 +1958,7 @@ userInfo = {
if (_delegateRespondsTo.didFetchObjects == YES)
[_delegate databaseContext: self
didFetchObjects: array
- fetchSpecification: fetch
+ fetchSpecification: fetchSpecification
editingContext: context];
NSDebugMLLog(@"EODatabaseContext",@"step 1 channel is busy=%d",
diff --git a/EOAccess/EODatabaseDataSource.h b/EOAccess/EODatabaseDataSource.h
index 18934f1..b581b3e 100644
--- a/EOAccess/EODatabaseDataSource.h
+++ b/EOAccess/EODatabaseDataSource.h
@@ -67,12 +67,12 @@
- (void)setFetchSpecification: (EOFetchSpecification *)fetchSpecification;
- (EOFetchSpecification *)fetchSpecification;
-- (void)setAuxiliaryQualifier: (EOQualifier *)newQualifier;
+- (void)setAuxiliaryQualifier: (EOQualifier *)qualifier;
- (EOQualifier *)auxiliaryQualifier;
- (EOFetchSpecification *)fetchSpecificationForFetch;
-- (void)setFetchEnabled: (BOOL)yn;
+- (void)setFetchEnabled: (BOOL)flag;
- (BOOL)isFetchEnabled;
@end
diff --git a/EOAccess/EODatabaseOperation.h b/EOAccess/EODatabaseOperation.h
index 7e63234..54907b0 100644
--- a/EOAccess/EODatabaseOperation.h
+++ b/EOAccess/EODatabaseOperation.h
@@ -164,7 +164,7 @@ The newRow dictionary is created when creating the database operation (in EOData
- (EOEntity *)entity;
- (EODatabaseOperator)databaseOperator;
-- (void)setDatabaseOperator: (EODatabaseOperator)dbOp;
+- (void)setDatabaseOperator: (EODatabaseOperator)dbOpe;
- (NSDictionary *)rowDiffs;
- (NSDictionary *)rowDiffsForAttributes: (NSArray *)attributes;
diff --git a/EOAccess/EOEntity.h b/EOAccess/EOEntity.h
index 6b0bf7b..ee34019 100644
--- a/EOAccess/EOEntity.h
+++ b/EOAccess/EOEntity.h
@@ -143,7 +143,7 @@
/* Accessing attributes */
- (NSArray *)attributes;
- (EOAttribute *)attributeNamed: (NSString *)attributeName;
-- (EOAttribute *)anyAttributeNamed: (NSString *)relationshipName;
+- (EOAttribute *)anyAttributeNamed: (NSString *)attributeName;
/* Accessing relationships */
- (NSArray *)relationships;
diff --git a/EOAccess/EOEntity.m b/EOAccess/EOEntity.m
index d5bb40d..923ba52 100644
--- a/EOAccess/EOEntity.m
+++ b/EOAccess/EOEntity.m
@@ -1169,12 +1169,12 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
return [[self relationshipsByName] objectForKey: relationshipName];
}
-- (EORelationship *)anyRelationshipNamed: (NSString *)relationshipNamed
+- (EORelationship *)anyRelationshipNamed: (NSString *)relationshipName
{
EORelationship *rel;
NSEnumerator *relEnum = nil;
- rel = [self relationshipNamed: relationshipNamed];
+ rel = [self relationshipNamed: relationshipName];
//VERIFY
if (!rel)
@@ -1186,7 +1186,7 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
while (!rel && (tmpRel = GDL2_NextObjectWithImpPtr(relEnum,&enumNO)))
{
- if ([[tmpRel name] isEqual: relationshipNamed])
+ if ([[tmpRel name] isEqual: relationshipName])
rel = tmpRel;
}
}
@@ -1535,25 +1535,25 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
return dict;
}
-- (BOOL)isValidAttributeUsedForLocking: (EOAttribute *)anAttribute
+- (BOOL)isValidAttributeUsedForLocking: (EOAttribute *)attribute
{
- if (!([anAttribute isKindOfClass: GDL2_EOAttributeClass]
- && [[self attributesByName] objectForKey: [anAttribute name]]))
+ if (!([attribute isKindOfClass: GDL2_EOAttributeClass]
+ && [[self attributesByName] objectForKey: [attribute name]]))
return NO;
- if ([anAttribute isDerived])
+ if ([attribute isDerived])
return NO;
return YES;
}
-- (BOOL)isValidPrimaryKeyAttribute: (EOAttribute *)anAttribute
+- (BOOL)isValidPrimaryKeyAttribute: (EOAttribute *)attribute
{
- if (!([anAttribute isKindOfClass: GDL2_EOAttributeClass]
- && [[self attributesByName] objectForKey: [anAttribute name]]))
+ if (!([attribute isKindOfClass: GDL2_EOAttributeClass]
+ && [[self attributesByName] objectForKey: [attribute name]]))
return NO;
- if ([anAttribute isDerived])
+ if ([attribute isDerived])
return NO;
return YES;
@@ -1592,15 +1592,15 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
return isValid;
}
-- (BOOL)isValidClassProperty: (id)aProperty
+- (BOOL)isValidClassProperty: (id)property
{
id thePropertyName;
- if (!([aProperty isKindOfClass: GDL2_EOAttributeClass]
- || [aProperty isKindOfClass: [EORelationship class]]))
+ if (!([property isKindOfClass: GDL2_EOAttributeClass]
+ || [property isKindOfClass: [EORelationship class]]))
return NO;
- thePropertyName = [(EOAttribute *)aProperty name];
+ thePropertyName = [(EOAttribute *)property name];
if ([[self attributesByName] objectForKey: thePropertyName]
|| [[self relationshipsByName] objectForKey: thePropertyName])
diff --git a/EOAccess/EOModel.h b/EOAccess/EOModel.h
index 6533cab..4831e7e 100644
--- a/EOAccess/EOModel.h
+++ b/EOAccess/EOModel.h
@@ -140,12 +140,12 @@
- (void)_classDescriptionNeeded: (NSNotification *)notification;
- (id)_instantiatedEntities;
- (void)_setPath: (NSString *)path;
-- (EOEntity *)_entityForClass: (Class)param0;
+- (EOEntity *)_entityForClass: (Class)aClass;
- (id)_childrenForEntityNamed: (id)param0;
- (void)_registerChild: (id)param0
forParent: (id)param1;
- (void)_setInheritanceLinks: (id)param0;
-- (void)_removeEntity: (id)param0;
+- (void)_removeEntity: (EOEntity *)entity;
- (EOEntity *)_addEntityWithPropertyList: (NSDictionary *)propertyList;
- (void)_addFakeEntityWithPropertyList: (NSDictionary *)propertyList;
- (id)_addEntity: (EOEntity *)entity;
@@ -161,7 +161,7 @@
- (void)setAdaptorName: (NSString *)adaptorName;
- (void)setConnectionDictionary: (NSDictionary *)connectionDictionary;
-- (void)setUserInfo: (NSDictionary *)dictionary;
+- (void)setUserInfo: (NSDictionary *)userInfo;
- (void)addEntity: (EOEntity *)entity;
- (void)removeEntity: (EOEntity *)entity;
diff --git a/EOAccess/EOModel.m b/EOAccess/EOModel.m
index 0ce60e5..19e8cae 100644
--- a/EOAccess/EOModel.m
+++ b/EOAccess/EOModel.m
@@ -1011,6 +1011,7 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
- (void)awakeWithPropertyList: (NSDictionary *)propertyList
{
+ return;
}
- (void)encodeIntoPropertyList: (NSMutableDictionary *)propertyList
@@ -1246,15 +1247,17 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
forParent: (id)param1
{
// TODO [self notImplemented:_cmd];
+ return;
}
- (void) _setInheritanceLinks: (id)param0
{
// TODO
[self notImplemented: _cmd];
+ return;
}
-- (void) _removeEntity: (id)entity
+- (void) _removeEntity: (EOEntity *)entity
{
//should be ok
NSString *entityName = nil;
@@ -1262,13 +1265,13 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
if ([entity isKindOfClass: [EOEntity class]])
{
- entityName = [(EOEntity*)entity name];
+ entityName = [entity name];
entityClassName = [entity className];
}
else
{
- entityName = [entity objectForKey: @"name"];
- entityClassName = [entity objectForKey: @"className"];
+ entityName = [(NSDictionary *)entity objectForKey: @"name"];
+ entityClassName = [(NSDictionary *)entity objectForKey: @"className"];
}
[_entitiesByName removeObjectForKey: entityName];
@@ -1495,7 +1498,7 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
}
}
-- (void) removeEntityAndReferences: (EOEntity *)entity;
+- (void) removeEntityAndReferences: (EOEntity *)entity
{
[self removeEntity: entity];
// TODO;
diff --git a/EOAccess/EOModelGroup.m b/EOAccess/EOModelGroup.m
index c27445b..892bcb7 100644
--- a/EOAccess/EOModelGroup.m
+++ b/EOAccess/EOModelGroup.m
@@ -396,7 +396,7 @@ of the mainBundle, and all bundles and frameworks loaded into the app.
return newFetchSpecification;
}
-- (EOStoredProcedure *)storedProcedureNamed: (NSString *)aName
+- (EOStoredProcedure *)storedProcedureNamed: (NSString *)name
{
EOStoredProcedure *newStoredProcedure = nil;
NSEnumerator *modelEnum;
@@ -407,7 +407,7 @@ of the mainBundle, and all bundles and frameworks loaded into the app.
modelEnum = [_modelsByName objectEnumerator];
while ((model = [modelEnum nextObject]))
{
- if ((newStoredProcedure = [model storedProcedureNamed: aName]))
+ if ((newStoredProcedure = [model storedProcedureNamed: name]))
{
EOFLOGObjectFnStopOrCond2(@"ModelingClasses", @"EOModelGroup");
@@ -421,3 +421,53 @@ of the mainBundle, and all bundles and frameworks loaded into the app.
}
@end
+
+@implementation EOObjectStoreCoordinator (EOModelGroup)
+
+- (id)modelGroup
+{
+ //Seems OK
+ EOModelGroup *modelGroup;
+ NSDictionary *userInfo;
+
+ EOFLOGObjectFnStart();
+
+ userInfo = [self userInfo];
+ modelGroup = [userInfo objectForKey: @"EOModelGroup"];
+
+ if (!modelGroup)
+ {
+ modelGroup = [EOModelGroup defaultGroup];
+ [self setModelGroup: modelGroup];
+ }
+
+ EOFLOGObjectFnStop();
+
+ return modelGroup;
+}
+
+- (void)setModelGroup: (EOModelGroup *)modelGroup
+{
+ NSMutableDictionary *userInfo;
+
+ EOFLOGObjectFnStart();
+
+ userInfo = (NSMutableDictionary *)[self userInfo];
+
+ if (userInfo)
+ [userInfo setObject: modelGroup
+ forKey: @"EOModelGroup"];
+ else
+ {
+ userInfo = (id)[NSMutableDictionary dictionary];
+
+ [userInfo setObject: modelGroup
+ forKey: @"EOModelGroup"];
+ [self setUserInfo: userInfo];
+ }
+
+ EOFLOGObjectFnStop();
+}
+
+@end
+
diff --git a/EOAccess/EORelationship.h b/EOAccess/EORelationship.h
index b017359..9ae549c 100644
--- a/EOAccess/EORelationship.h
+++ b/EOAccess/EORelationship.h
@@ -160,10 +160,10 @@ typedef enum {
- (void)setName: (NSString *)name;
- (void)setDefinition: (NSString *)definition;
- (void)setEntity: (EOEntity *)entity;
-- (void)setToMany: (BOOL)yn;
-- (void)setPropagatesPrimaryKey: (BOOL)yn;
-- (void)setIsBidirectional: (BOOL)yn;
-- (void)setOwnsDestination: (BOOL)yn;
+- (void)setToMany: (BOOL)flag;
+- (void)setPropagatesPrimaryKey: (BOOL)flag;
+- (void)setIsBidirectional: (BOOL)flag;
+- (void)setOwnsDestination: (BOOL)flag;
- (void)addJoin: (EOJoin *)join;
- (void)removeJoin: (EOJoin *)join;
- (void)setJoinSemantic: (EOJoinSemantic)joinSemantic;
diff --git a/EOAccess/EOSQLExpression.h b/EOAccess/EOSQLExpression.h
index d8b2dad..a5820f6 100644
--- a/EOAccess/EOSQLExpression.h
+++ b/EOAccess/EOSQLExpression.h
@@ -97,7 +97,7 @@ GDL2ACCESS_EXPORT NSString *EOBindVariableColumnKey;
entity: (EOEntity *)entity;
+ (EOSQLExpression *)selectStatementForAttributes: (NSArray *)attributes
- lock: (BOOL)yn
+ lock: (BOOL)flag
fetchSpecification: (EOFetchSpecification *)fetchSpecification
entity: (EOEntity *)entity;
@@ -128,7 +128,7 @@ GDL2ACCESS_EXPORT NSString *EOBindVariableColumnKey;
- (void)prepareDeleteExpressionForQualifier: (EOQualifier *)qualifier;
- (void)prepareSelectExpressionWithAttributes: (NSArray *)attributes
- lock: (BOOL)yn
+ lock: (BOOL)flag
fetchSpecification: (EOFetchSpecification *)fetchSpecification;
- (NSString *)assembleJoinClauseWithLeftName: (NSString *)leftName
@@ -192,7 +192,7 @@ GDL2ACCESS_EXPORT NSString *EOBindVariableColumnKey;
- (void)addOrderByAttributeOrdering: (EOSortOrdering *)sortOrdering;
+ (BOOL)useQuotedExternalNames;
-+ (void)setUseQuotedExternalNames: (BOOL)yn;
++ (void)setUseQuotedExternalNames: (BOOL)flag;
- (NSString *)externalNameQuoteCharacter;
- (void)setUseAliases: (BOOL)useAliases;
@@ -201,7 +201,7 @@ GDL2ACCESS_EXPORT NSString *EOBindVariableColumnKey;
- (NSString *)sqlStringForSchemaObjectName: (NSString *)name;
- (NSString *)sqlStringForAttributeNamed: (NSString *)name;
- (NSString *)sqlStringForSelector: (SEL)selector value: (id)value;
-- (NSString *)sqlStringForValue: (id)value attributeNamed: (NSString *)string;
+- (NSString *)sqlStringForValue: (id)value attributeNamed: (NSString *)attributeName;
- (NSString *)sqlStringForAttribute: (EOAttribute *)attribute;
- (NSString *)sqlStringForAttributePath: (NSArray *)path;
@@ -220,7 +220,7 @@ GDL2ACCESS_EXPORT NSString *EOBindVariableColumnKey;
- (BOOL)mustUseBindVariableForAttribute: (EOAttribute *)att;
+ (BOOL)useBindVariables;
-+ (void)setUseBindVariables: (BOOL)yn;
++ (void)setUseBindVariables: (BOOL)flag;
- (NSArray *)bindVariableDictionaries;
- (void)addBindVariableDictionary: (NSMutableDictionary *)binding;
diff --git a/EOAccess/EOSQLExpression.m b/EOAccess/EOSQLExpression.m
index 8e7acb9..b58014e 100644
--- a/EOAccess/EOSQLExpression.m
+++ b/EOAccess/EOSQLExpression.m
@@ -75,7 +75,6 @@ RCS_ID("$Id$")
#include
#include
#include
-#include
#include "EOPrivate.h"
#include "EOEntityPriv.h"
@@ -661,7 +660,7 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
*/
- (void)prepareSelectExpressionWithAttributes: (NSArray *)attributes
- lock: (BOOL)lockFlag
+ lock: (BOOL)flag
fetchSpecification: (EOFetchSpecification *)fetchSpecification
{
EOQualifier *fetchQualifier = nil;
@@ -751,7 +750,7 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"tableList=%@", tableList);
//Build LockClause
- if (lockFlag)
+ if (flag)
lockClauseString = [self lockClause];
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"lockClauseString=%@",
lockClauseString);
@@ -767,7 +766,7 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
//Now Build Statement
statement = [self assembleSelectStatementWithAttributes: attributes
- lock: lockFlag
+ lock: flag
qualifier: fetchQualifier
fetchOrder: sortOrderings
selectString: selectCommand
@@ -1855,42 +1854,42 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
return sqlString;
}
-- (NSString *)sqlStringForAttribute: (EOAttribute *)anAttribute
+- (NSString *)sqlStringForAttribute: (EOAttribute *)attribute
{
NSString *sqlString = nil;
EOFLOGObjectFnStartCond(@"EOSQLExpression");
- EOFLOGObjectLevelArgs(@"EOSQLExpression", @"anAttribute=%@",
- anAttribute);
+ EOFLOGObjectLevelArgs(@"EOSQLExpression", @"attribute=%@",
+ attribute);
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"sFlattened=%s",
- ([anAttribute isFlattened] ? "YES" : "NO"));
+ ([attribute isFlattened] ? "YES" : "NO"));
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"_definitionArray=%@",
- [anAttribute _definitionArray]);
+ [attribute _definitionArray]);
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"_definitionArray count=%d",
- [[anAttribute _definitionArray]count]);
+ [[attribute _definitionArray]count]);
- if ([anAttribute isFlattened])
+ if ([attribute isFlattened])
{
sqlString = [self sqlStringForAttributePath:
- [anAttribute _definitionArray]];
+ [attribute _definitionArray]];
NSAssert1(sqlString, @"No sqlString for flattened attribute: %@",
- anAttribute);
+ attribute);
}
//mirko:
/*
-else if([anAttribute isDerived] == YES)
- return [anAttribute definition];
+else if([attribute isDerived] == YES)
+ return [attribute definition];
*/
else
{
if (![self useAliases])//OK
{
- sqlString = [anAttribute columnName];
+ sqlString = [attribute columnName];
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"sqlString=%@", sqlString);
}
else
@@ -1945,9 +1944,9 @@ else if([anAttribute isDerived] == YES)
if (attrArray)
{
- if ([attrArray containsObject: anAttribute])
+ if ([attrArray containsObject: attribute])
{
- NSString *columnName = [anAttribute columnName];
+ NSString *columnName = [attribute columnName];
EOFLOGObjectLevelArgs(@"EOSQLExpression",
@"columnName=%@", columnName);
@@ -1957,8 +1956,8 @@ else if([anAttribute isDerived] == YES)
NSEmitTODO(); //TODO what to do when there's no column name (definition only like "((firstName || ' ') || lastName)") ?
EOFLOGObjectLevelArgs(@"EOSQLExpression",
- @"anAttribute=%@",
- anAttribute);
+ @"attribute=%@",
+ attribute);
EOFLOGObjectLevelArgs(@"EOSQLExpression",
@"columnName=%@", columnName);
EOFLOGObjectLevelArgs(@"EOSQLExpression",
@@ -1969,7 +1968,7 @@ else if([anAttribute isDerived] == YES)
}
NSAssert1(columnName, @"No columnName for attribute %@",
- anAttribute);
+ attribute);
sqlString = [NSString stringWithFormat: @"%@.%@",
[_aliasesByRelationshipPath
@@ -1985,7 +1984,7 @@ else if([anAttribute isDerived] == YES)
sqlString);
}
- NSAssert1(sqlString, @"No SQLString for attribute %@", anAttribute);
+ NSAssert1(sqlString, @"No SQLString for attribute %@", attribute);
}
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"sqlString=%@", sqlString);
@@ -2525,805 +2524,3 @@ All relationshipPaths in _aliasesByRelationshipPath are direct paths **/
@end
-
-NSString *EOCreateTablesKey = @"EOCreateTablesKey";
-NSString *EODropTablesKey = @"EODropTablesKey";
-NSString *EOCreatePrimaryKeySupportKey = @"EOCreatePrimaryKeySupportKey";
-NSString *EODropPrimaryKeySupportKey = @"EODropPrimaryKeySupportKey";
-NSString *EOPrimaryKeyConstraintsKey = @"EOPrimaryKeyConstraintsKey";
-NSString *EOForeignKeyConstraintsKey = @"EOForeignKeyConstraintsKey";
-NSString *EOCreateDatabaseKey = @"EOCreateDatabaseKey";
-NSString *EODropDatabaseKey = @"EODropDatabaseKey";
-
-
-@implementation EOSQLExpression (EOSchemaGeneration)
-
-+ (NSArray *)_administrativeDatabaseStatementsForSelector:(SEL) sel
- forEntityGroup:(NSArray *)group
-{
- EOEntity *entity;
- EOModel *model;
- NSDictionary *connDict;
- NSDictionary *admDict;
- NSArray *stmts;
- NSString *notifName;
- NSMutableDictionary *notifDict;
-
- entity = [group lastObject];
- model = [entity model];
- connDict = [model connectionDictionary];
-
- notifDict = (id)[NSMutableDictionary dictionaryWithCapacity: 2];
- [notifDict setObject: model forKey: EOModelKey];
- notifName = EOAdministrativeConnectionDictionaryNeededNotification;
- [[NSNotificationCenter defaultCenter] postNotificationName: notifName
- object: notifDict];
- admDict = [notifDict objectForKey: EOAdministrativeConnectionDictionaryKey];
-/* TODO: ayers
- if (admDict == nil && [admDict count] == 0)
- {
- EOAdaptor *adaptor;
- EOLoginPanel *panel;
-
- adaptor = [EOAdaptor adaptorWithModel: model];
- panel = [[adaptor class] sharedLoginPanelInstance];
- admDict = [panel administrativeConnectionDictionaryForAdaptor: adaptor];
- }
-*/
- stmts = [self performSelector: sel
- withObject: connDict
- withObject: admDict];
-
- return stmts;
-}
-
-+ (NSArray *)_dropDatabaseStatementsForEntityGroups: (NSArray *)entityGroups
-{
- NSMutableArray *cumStmts;
- NSArray *stmts;
- NSArray *group;
- unsigned i,n;
- SEL sel;
-
- sel = @selector(dropDatabaseStatementsForConnectionDictionary:administrativeConnectionDictionary:);
-
- n = [entityGroups count];
- cumStmts = [NSMutableArray arrayWithCapacity: n];
-
- for (i=0; i
+ * Returns an array of EOSQLExpression suitable to create the schema for the
+ * given entities specific for the target db.
+ * Possible options are:
+ *
+ * - Name Value Default
+ *
+ * - createTables YES/NO YES
+ * - dropTables YES/NO YES
+ * - createPrimaryKeySupport YES/NO YES
+ * - dropPrimaryKeySupport YES/NO YES
+ * - primaryKeyConstraints YES/NO YES
+ * - foreignKeyConstraints YES/NO NO
+ * - createDatabase YES/NO NO
+ * - dropDatabase YES/NO NO
+ *
+ */
+ (NSArray *)schemaCreationStatementsForEntities: (NSArray *)entities
options: (NSDictionary *)options;
@@ -110,10 +135,9 @@
/** Keys to use the options dictionary for
- +schemaCreationScriptForEntities:options:
- and +schemaCreationStatementsForEntities:options: **/
-
-
+ * +schemaCreationScriptForEntities:options:
+ * and +schemaCreationStatementsForEntities:options:
+ */
GDL2ACCESS_EXPORT NSString *EOCreateTablesKey;
GDL2ACCESS_EXPORT NSString *EODropTablesKey;
GDL2ACCESS_EXPORT NSString *EOCreatePrimaryKeySupportKey;
diff --git a/EOAccess/EOSchemaGeneration.m b/EOAccess/EOSchemaGeneration.m
new file mode 100644
index 0000000..280d19c
--- /dev/null
+++ b/EOAccess/EOSchemaGeneration.m
@@ -0,0 +1,865 @@
+/**
+ EOSchemaGeneration.m EOSchemaGeneration Class
+
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ Author: David Ayers
+ Date: February 2006
+
+ $Revision: 23653 $
+ $Date: 2006-09-28 17:25:30 +0200 (Don, 28 Sep 2006) $
+
+
+
+ This file is part of the GNUstep Database Library.
+
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+**/
+
+#include "config.h"
+
+RCS_ID("$Id: EOSchemaGeneration.m 23653 2006-09-28 15:25:30Z ratmice $")
+
+#include
+
+#ifdef GNUSTEP
+#include
+#include
+#else
+#include
+#endif
+
+#ifndef GNUSTEP
+#include
+#include
+#include
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+NSString *EOCreateTablesKey = @"EOCreateTablesKey";
+NSString *EODropTablesKey = @"EODropTablesKey";
+NSString *EOCreatePrimaryKeySupportKey = @"EOCreatePrimaryKeySupportKey";
+NSString *EODropPrimaryKeySupportKey = @"EODropPrimaryKeySupportKey";
+NSString *EOPrimaryKeyConstraintsKey = @"EOPrimaryKeyConstraintsKey";
+NSString *EOForeignKeyConstraintsKey = @"EOForeignKeyConstraintsKey";
+NSString *EOCreateDatabaseKey = @"EOCreateDatabaseKey";
+NSString *EODropDatabaseKey = @"EODropDatabaseKey";
+
+
+@implementation EOSQLExpression (EOSchemaGeneration)
+
++ (NSArray *)_administrativeDatabaseStatementsForSelector:(SEL) sel
+ forEntityGroup:(NSArray *)group
+{
+ EOEntity *entity;
+ EOModel *model;
+ NSDictionary *connDict;
+ NSDictionary *admDict;
+ NSArray *stmts;
+ NSString *notifName;
+ NSMutableDictionary *notifDict;
+
+ entity = [group lastObject];
+ model = [entity model];
+ connDict = [model connectionDictionary];
+
+ notifDict = (id)[NSMutableDictionary dictionaryWithCapacity: 2];
+ [notifDict setObject: model forKey: EOModelKey];
+ notifName = EOAdministrativeConnectionDictionaryNeededNotification;
+ [[NSNotificationCenter defaultCenter] postNotificationName: notifName
+ object: notifDict];
+ admDict = [notifDict objectForKey: EOAdministrativeConnectionDictionaryKey];
+/* TODO: ayers
+ if (admDict == nil && [admDict count] == 0)
+ {
+ EOAdaptor *adaptor;
+ EOLoginPanel *panel;
+
+ adaptor = [EOAdaptor adaptorWithModel: model];
+ panel = [[adaptor class] sharedLoginPanelInstance];
+ admDict = [panel administrativeConnectionDictionaryForAdaptor: adaptor];
+ }
+*/
+ stmts = [self performSelector: sel
+ withObject: connDict
+ withObject: admDict];
+
+ return stmts;
+}
+
++ (NSArray *)_dropDatabaseStatementsForEntityGroups: (NSArray *)entityGroups
+{
+ NSMutableArray *cumStmts;
+ NSArray *stmts;
+ NSArray *group;
+ unsigned i,n;
+ SEL sel;
+
+ sel = @selector(dropDatabaseStatementsForConnectionDictionary:administrativeConnectionDictionary:);
+
+ n = [entityGroups count];
+ cumStmts = [NSMutableArray arrayWithCapacity: n];
+
+ for (i=0; i