mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-23 05:00:46 +00:00
2003-06-26 Manuel Guesdon <mguesdon@orange-concept.com>
* config.h.in: o added EMIT_TODO control * EOAccess/EOAccessFault.m: o commented debug logs * EOAccess/EODatabaseContext.m: o more information in asserts o asserts o fix in -relayPrimaryKey:object:entity: for nil 1:1 relationship value o add -forgetSnapshotForGlobalID call in -refaultObject:withGlobalID:editingContext: o add -forgetSnapshotForGlobalID database call in -forgetSnapshotForGlobalID: * EOAccess/EOEntity.m: o logs o fix in -awakeObject:fromInsertionInEditingContext: to avoid setting already present values o reverted code in -awakeObject:fromInsertionInEditingContext: My (old) tests show that we create 1: object not on mandatory property but on propagatesPrimaryKey one if someone has an example of EOF creating an object here without propagatesPrimaryKey, please send it to me. * EOAccess/EOModelGroup.m: o don't autorelease return model group in -globalModelGroup as it will crash. I haven't find why :-( o logs * EOAccess/EOSQLExpression.m: o fix bug in -assembleSelectStatementWithAttributes🔒qualifier: fetchOrder:selectString:columnList:tableList: whereClause:joinClause:orderByClause:lockClause: by adding () around where and join clause o add detail in sqlStringForSelector:value: exception * EOAdaptors/Postgres95/PostPostgres95Channel.m: o add more information on exceptions * EOAdaptors/Postgres95/Postgres95SQLExpression.m: o fix escaping string in -formatValue:forAttribute: o fix bug in -assembleSelectStatementWithAttributes🔒qualifier: fetchOrder:selectString:columnList:tableList: whereClause:joinClause:orderByClause:lockClause: by adding () around where and join clause * EOAdaptors/Postgres95/Postgres95Value.m: o Change log in +newValueForDateType:length:attribute: * EOControl/EOCheapArray.m o removed some logs * EOAccess/EOClassDescription.m: o fix in -validateForUpdate o logs * EOControl/Debug.h: o donditional define of NSEmitTODO() * EOControl/EODetailDataSource.h/.m: o added -setDetailKey: * EOControl/EOEditingContext.m o logs * EOControl/EOFetchSpecification.m o logs * EOControl/EOKeyValueCoding.m: o fix in computeSum, computeAverage * EOControl/EOQualifier.m o logs * EOControl/EOSortOrdering.m o use valueForKeyPath: instead of valueForKey: to allow sort on related objects * EOControl/EOUndoManager.h o protection of include git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@17037 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0dadfc5e25
commit
cca381a47b
20 changed files with 240 additions and 78 deletions
63
ChangeLog
63
ChangeLog
|
@ -1,3 +1,66 @@
|
|||
2003-06-26 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* config.h.in:
|
||||
o added EMIT_TODO control
|
||||
* EOAccess/EOAccessFault.m:
|
||||
o commented debug logs
|
||||
* EOAccess/EODatabaseContext.m:
|
||||
o more information in asserts
|
||||
o asserts
|
||||
o fix in -relayPrimaryKey:object:entity: for
|
||||
nil 1:1 relationship value
|
||||
o add -forgetSnapshotForGlobalID call in -refaultObject:withGlobalID:editingContext:
|
||||
o add -forgetSnapshotForGlobalID database call in -forgetSnapshotForGlobalID:
|
||||
* EOAccess/EOEntity.m:
|
||||
o logs
|
||||
o fix in -awakeObject:fromInsertionInEditingContext: to avoid
|
||||
setting already present values
|
||||
o reverted code in -awakeObject:fromInsertionInEditingContext:
|
||||
My (old) tests show that we create 1: object not on
|
||||
mandatory property but on propagatesPrimaryKey one
|
||||
if someone has an example of EOF creating an object
|
||||
here without propagatesPrimaryKey, please send it to me.
|
||||
* EOAccess/EOModelGroup.m:
|
||||
o don't autorelease return model group in -globalModelGroup as it will crash. I haven't find why :-(
|
||||
o logs
|
||||
|
||||
* EOAccess/EOSQLExpression.m:
|
||||
o fix bug in -assembleSelectStatementWithAttributes:lock:qualifier:
|
||||
fetchOrder:selectString:columnList:tableList:
|
||||
whereClause:joinClause:orderByClause:lockClause:
|
||||
by adding () around where and join clause
|
||||
o add detail in sqlStringForSelector:value: exception
|
||||
* EOAdaptors/Postgres95/PostPostgres95Channel.m:
|
||||
o add more information on exceptions
|
||||
* EOAdaptors/Postgres95/Postgres95SQLExpression.m:
|
||||
o fix escaping string in -formatValue:forAttribute:
|
||||
o fix bug in -assembleSelectStatementWithAttributes:lock:qualifier:
|
||||
fetchOrder:selectString:columnList:tableList:
|
||||
whereClause:joinClause:orderByClause:lockClause:
|
||||
by adding () around where and join clause
|
||||
* EOAdaptors/Postgres95/Postgres95Value.m:
|
||||
o Change log in +newValueForDateType:length:attribute:
|
||||
* EOControl/EOCheapArray.m
|
||||
o removed some logs
|
||||
* EOAccess/EOClassDescription.m:
|
||||
o fix in -validateForUpdate
|
||||
o logs
|
||||
* EOControl/Debug.h:
|
||||
o donditional define of NSEmitTODO()
|
||||
* EOControl/EODetailDataSource.h/.m:
|
||||
o added -setDetailKey:
|
||||
* EOControl/EOEditingContext.m
|
||||
o logs
|
||||
* EOControl/EOFetchSpecification.m
|
||||
o logs
|
||||
* EOControl/EOKeyValueCoding.m:
|
||||
o fix in computeSum, computeAverage
|
||||
* EOControl/EOQualifier.m
|
||||
o logs
|
||||
* EOControl/EOSortOrdering.m
|
||||
o use valueForKeyPath: instead of valueForKey: to allow sort on related objects
|
||||
* EOControl/EOUndoManager.h
|
||||
o protection of include
|
||||
|
||||
2003-06-23 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOControl/EONSAddOns.h/m:
|
||||
|
|
|
@ -174,8 +174,8 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
- (void)dealloc
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOAccessFaultHandler %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Dealloc EOAccessFaultHandler %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
|
||||
DESTROY(gid);
|
||||
|
@ -185,8 +185,8 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
[super dealloc];
|
||||
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOAccessFaultHandler %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Dealloc EOAccessFaultHandler %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -311,8 +311,8 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
- (void)dealloc
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOAccessArrayFaultHandler %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Dealloc EOAccessArrayFaultHandler %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
|
||||
DESTROY(sgid);
|
||||
|
@ -322,8 +322,8 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
|
||||
[super dealloc];
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Stop Dealloc EOAccessArrayFaultHandler %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Stop Dealloc EOAccessArrayFaultHandler %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1183,7 +1183,7 @@ userInfo = {
|
|||
editingContext: context
|
||||
isComplete: YES]; //Why YES ?
|
||||
|
||||
//NO: done in edcontext by calling clearOriginalSnapshotForObject: [self forgetSnapshotForGlobalID:globalID];
|
||||
[self forgetSnapshotForGlobalID:globalID];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
@ -1778,6 +1778,7 @@ userInfo = {
|
|||
|
||||
EOFLOGObjectLevel(@"EODatabaseContext",
|
||||
@"AFTER FETCH");
|
||||
NSAssert(obj,@"No object");
|
||||
[array addObject: obj];
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext",
|
||||
@"array count=%d",
|
||||
|
@ -2968,6 +2969,7 @@ but not owned by this context to the coordinator.
|
|||
EODatabaseOperation *dbOpe = nil;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
NSAssert(object, @"No object");
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"object=%@", object);
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"changes=%@", changes);
|
||||
|
@ -3610,6 +3612,10 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
forKey: destinationKey];
|
||||
}
|
||||
|
||||
NSAssert1(destinationObject,
|
||||
@"No destinationObject for call of recordUpdateForObject:changes: changes: %@",
|
||||
changes);
|
||||
|
||||
[self recordUpdateForObject: destinationObject
|
||||
changes: changes];
|
||||
}
|
||||
|
@ -3785,6 +3791,10 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"relayedValues=%@",
|
||||
relayedValues);
|
||||
|
||||
NSAssert1(destinationObject,
|
||||
@"No destinationObject for call of recordUpdateForObject:changes: relayedValues: %@",
|
||||
relayedValues);
|
||||
|
||||
[self recordUpdateForObject: destinationObject
|
||||
changes: relayedValues];
|
||||
}
|
||||
|
@ -4191,6 +4201,10 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NSAssert3(destObject,
|
||||
@"No destinationObject. pk=%@ relationship=%@ sourceObject=%@",
|
||||
pk,relationship,sourceObject);
|
||||
|
||||
destAttributes = [relationship destinationAttributes];
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"destAttributes=%@",
|
||||
destAttributes);
|
||||
|
@ -4336,10 +4350,14 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"value=%@",
|
||||
value);
|
||||
|
||||
[self relayPrimaryKey: pk
|
||||
sourceObject: object
|
||||
destObject: value
|
||||
relationship: substRelationship]; //this one ??
|
||||
// 1:1 relationships may be optional so we may have no value here
|
||||
if (value)
|
||||
{
|
||||
[self relayPrimaryKey: pk
|
||||
sourceObject: object
|
||||
destObject: value
|
||||
relationship: substRelationship]; //this one ??
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4441,6 +4459,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
entity: entity];
|
||||
|
||||
dbSnapshot = [dbOpe dbSnapshot];
|
||||
|
||||
lockingQualifier = [self qualifierForLockingAttributes:
|
||||
lockingAttributes
|
||||
primaryKeyAttributes: pkAttributes
|
||||
|
@ -5147,8 +5166,8 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
EOFLOGObjectLevel(@"EODatabaseContext", @"NO VALUE");
|
||||
}
|
||||
|
||||
NSAssert3(value, @"no value for %@ in %p %@", snapName,
|
||||
snapshot, snapshot);
|
||||
NSAssert4(value, @"no value for %@ in %p %@ entity %@", snapName,
|
||||
snapshot, snapshot, [entity name]);
|
||||
|
||||
aQualifier = [EOKeyValueQualifier
|
||||
qualifierWithKey: attributeName
|
||||
|
@ -6096,6 +6115,9 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
//TODO-VERIFY deleteStack
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"self=%p database=%p [_uniqueStack count]=%d",
|
||||
self, _database,[_uniqueStack count]);
|
||||
|
||||
if ([_uniqueStack count] > 0)
|
||||
{
|
||||
NSMutableDictionary *snapshots = [_uniqueStack lastObject];
|
||||
|
@ -6105,6 +6127,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
snapshots = [_uniqueArrayStack lastObject];
|
||||
[snapshots removeObjectForKey: gid];
|
||||
}
|
||||
[_database forgetSnapshotForGlobalID: gid]; //MG Really here ?
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
@ -6547,6 +6570,7 @@ _numLocked = 0;
|
|||
EOGlobalID *gid = nil;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
NSAssert(object, @"No object");
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext",@"object=%p of class %@",
|
||||
object,[object class]);
|
||||
|
@ -6554,7 +6578,8 @@ _numLocked = 0;
|
|||
_editingContext);
|
||||
|
||||
objectEditingContext = [object editingContext];
|
||||
NSAssert1(objectEditingContext, @"No editing context for object %p", object);
|
||||
NSAssert2(objectEditingContext, @"No editing context for object %p: %@",
|
||||
object,object);
|
||||
|
||||
gid = [objectEditingContext globalIDForObject: object];
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"gid=%@", gid);
|
||||
|
@ -6599,6 +6624,7 @@ _numLocked = 0;
|
|||
EOGlobalID *gid = [self _globalIDForObject: object]; //OK
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext", @"gid=%@", gid);
|
||||
|
||||
|
||||
pk = [entity primaryKeyForGlobalID: (EOKeyGlobalID*)gid]; //OK
|
||||
EOFLOGObjectLevelArgs(@"EODatabaseContext",@"object=%p pk=%@",
|
||||
object,pk);
|
||||
|
@ -6642,6 +6668,7 @@ _numLocked = 0;
|
|||
if (isPKValid == NO)
|
||||
pk = nil;
|
||||
|
||||
|
||||
if (isPKValid == NO && shouldGeneratePrimaryKey)
|
||||
{
|
||||
pk = nil;
|
||||
|
@ -6696,6 +6723,7 @@ _numLocked = 0;
|
|||
EOFLOGObjectLevelArgs(@"EODatabaseContext",
|
||||
@"** prepare pk %@", pk);
|
||||
|
||||
|
||||
if (pk == nil && [[pkAttr valueClassName]
|
||||
isEqual:@"NSData"] == YES)
|
||||
{
|
||||
|
@ -6791,9 +6819,11 @@ _numLocked = 0;
|
|||
};
|
||||
pk = [self valuesForKeys: pkNames
|
||||
object: object];
|
||||
|
||||
if (![entity isPrimaryKeyValidInObject: pk])
|
||||
pk=nil;
|
||||
};
|
||||
|
||||
if (pk)
|
||||
{
|
||||
EODatabaseOperation *dbOpe = [self databaseOperationForObject: object];
|
||||
|
|
|
@ -4174,15 +4174,18 @@ toDestinationAttributeInLastComponentOfRelationshipPath: (NSString*)path
|
|||
fromFetchInEditingContext: (EOEditingContext *)context
|
||||
{
|
||||
//OK
|
||||
EOFLOGObjectFnStart();
|
||||
[super awakeObject: object
|
||||
fromFetchInEditingContext: context];
|
||||
//nothing to do
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (void)awakeObject: (id)object
|
||||
fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
||||
{
|
||||
//near OK
|
||||
EOFLOGObjectFnStart();
|
||||
[super awakeObject: object
|
||||
fromInsertionInEditingContext: anEditingContext];
|
||||
{
|
||||
|
@ -4197,13 +4200,24 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
|
||||
if (isToMany)
|
||||
{
|
||||
//Put an empty muable array [Ref: Assigns empty arrays to to-many relationship properties of newly inserted enterprise objects]
|
||||
[object takeStoredValue: [EOCheapCopyMutableArray array]
|
||||
forKey: [relationship name]];
|
||||
// We put a value only if there's not already one
|
||||
NSString* relationshipName=[relationship name];
|
||||
id relationshipValue = [object storedValueForKey:relationshipName];
|
||||
if (relationshipValue == nil)
|
||||
{
|
||||
//Put an empty mutable array [Ref: Assigns empty arrays to to-many
|
||||
// relationship properties of newly inserted enterprise objects]
|
||||
[object takeStoredValue: [EOCheapCopyMutableArray array]
|
||||
forKey: [relationship name]];
|
||||
};
|
||||
}
|
||||
else //??
|
||||
{
|
||||
#if 0
|
||||
/* Manuel
|
||||
My (old) tests show that we create 1: object not on mandatory property but on propagatesPrimaryKey one *only*
|
||||
if someone has an example of EOF creating an object here without propagatesPrimaryKey, please send it to me.
|
||||
*/
|
||||
#if 1
|
||||
BOOL propagatesPrimaryKey = [relationship propagatesPrimaryKey];
|
||||
|
||||
if (propagatesPrimaryKey)
|
||||
|
@ -4288,13 +4302,16 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
}
|
||||
}
|
||||
#else
|
||||
// We'll put only mandatory values
|
||||
if ([relationship isMandatory])
|
||||
{
|
||||
id objectTo = [object storedValueForKey: [relationship name]];
|
||||
NSString* relationshipName=[relationship name];
|
||||
id objectTo = [object storedValueForKey:relationshipName];
|
||||
|
||||
// We put a value only if there's not already one
|
||||
if (objectTo == nil)
|
||||
{
|
||||
EOEntity *entityTo;
|
||||
EOEntity *entityTo=nil;
|
||||
|
||||
entityTo = [relationship destinationEntity];
|
||||
objectTo = [[entityTo classDescriptionForInstances]
|
||||
|
@ -4302,16 +4319,18 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
anEditingContext
|
||||
globalID: nil
|
||||
zone: NULL];
|
||||
|
||||
[anEditingContext insertObject: objectTo];
|
||||
|
||||
[object addObject: objectTo
|
||||
toBothSidesOfRelationshipWithKey:
|
||||
[relationship name]];
|
||||
toBothSidesOfRelationshipWithKey:relationshipName];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (EOClassDescription *)classDescriptionForDestinationKey: (NSString *)detailKey
|
||||
|
|
|
@ -71,6 +71,8 @@ static EOModelGroup *defaultModelGroup = nil;
|
|||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"defaultModelGroup=%p",defaultModelGroup);
|
||||
|
||||
if (defaultModelGroup)
|
||||
modelGroup = defaultModelGroup;
|
||||
else if (delegateDefaultModelGroup)
|
||||
|
@ -83,6 +85,8 @@ static EOModelGroup *defaultModelGroup = nil;
|
|||
NSLog(@"WARNING: No default Group");
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"modelGroup=%p",modelGroup);
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
return modelGroup;
|
||||
|
@ -90,6 +94,9 @@ static EOModelGroup *defaultModelGroup = nil;
|
|||
|
||||
+ (void)setDefaultGroup: (EOModelGroup *)group
|
||||
{
|
||||
NSDebugMLLog(@"gsdb", @"group=%p defaultModelGroup=%p",
|
||||
group,defaultModelGroup);
|
||||
|
||||
if (group != defaultModelGroup)
|
||||
{
|
||||
if (defaultModelGroup)
|
||||
|
@ -115,6 +122,7 @@ static EOModelGroup *defaultModelGroup = nil;
|
|||
EOFLOGObjectFnStart();
|
||||
|
||||
group = [EOModelGroup new];
|
||||
NSDebugMLLog(@"gsdb", @"group=%p",group);
|
||||
|
||||
[bundles addObjectsFromArray: [NSBundle allBundles]];
|
||||
[bundles addObjectsFromArray: [NSBundle allFrameworks]];
|
||||
|
@ -140,7 +148,7 @@ static EOModelGroup *defaultModelGroup = nil;
|
|||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
return [group autorelease]; // TODO release problem with EOModel
|
||||
return group;//MG20030330;[group autorelease]; // TODO release problem with EOModel
|
||||
}
|
||||
|
||||
/** returns a model group composed of all models in the resource directory
|
||||
|
@ -163,10 +171,12 @@ of the mainBundle, and all bundles and frameworks loaded into the app.
|
|||
|
||||
- init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_modelsByName = [NSMutableDictionary new];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
NSDebugMLLog(@"gsdb", @"model group=%p",self);
|
||||
|
||||
_modelsByName = [NSMutableDictionary new];
|
||||
};
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -1005,7 +1005,7 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
|
|||
joinClause = nil;
|
||||
|
||||
if (whereClause && joinClause)
|
||||
[sqlString appendFormat: @" WHERE %@ AND %@",
|
||||
[sqlString appendFormat: @" WHERE (%@) AND (%@)",
|
||||
whereClause, joinClause];
|
||||
else if (whereClause || joinClause)
|
||||
[sqlString appendFormat: @" WHERE %@",
|
||||
|
@ -1728,7 +1728,7 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
|
|||
else
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"EOSQLExpression: Unknown selector of sqlStringForSelector:value:"];
|
||||
format: @"EOSQLExpression: Unknown selector of sqlStringForSelector:value: '%@'",NSStringFromSelector(selector)];
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
Postgres95Channel.m <title>Postgres95Channel</title>
|
||||
|
||||
Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
Author: Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
||||
Date: February 2000
|
||||
|
@ -499,13 +499,14 @@ zone:zone
|
|||
case PGRES_NONFATAL_ERROR:
|
||||
case PGRES_FATAL_ERROR:
|
||||
{
|
||||
NSString* errorString=[NSString stringWithCString:PQerrorMessage(_pgConn)];
|
||||
if ([self isDebugEnabled])
|
||||
NSLog(@"SQL expression '%@' caused %s",
|
||||
[_sqlExpression statement], PQerrorMessage(_pgConn));
|
||||
NSDebugMLLog(@"SQL expression '%@' caused %s",
|
||||
[_sqlExpression statement], PQerrorMessage(_pgConn));
|
||||
NSLog(@"SQL expression '%@' caused %@",
|
||||
[_sqlExpression statement], errorString);
|
||||
NSDebugMLLog(@"SQL expression '%@' caused %@",
|
||||
[_sqlExpression statement], errorString);
|
||||
[NSException raise: Postgres95Exception
|
||||
format: @"unexpected result returned by PQresultStatus()"];
|
||||
format: @"unexpected result returned by PQresultStatus(): %@",errorString];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
|
@ -513,8 +514,16 @@ zone:zone
|
|||
}
|
||||
default:
|
||||
{
|
||||
NSString* errorString=[NSString stringWithCString:PQerrorMessage(_pgConn)];
|
||||
if ([self isDebugEnabled])
|
||||
NSLog(@"SQL expression '%@' returned status %d: %@",
|
||||
[_sqlExpression statement], status, errorString);
|
||||
NSDebugMLLog(@"SQL expression '%@' returned status %d: %@",
|
||||
[_sqlExpression statement], status, errorString);
|
||||
[NSException raise: Postgres95Exception
|
||||
format: @"unexpected result returned by PQresultStatus():"];
|
||||
format: @"unexpected result returned by PQresultStatus(): status %d: %@",
|
||||
status,errorString];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,10 +215,12 @@ RCS_ID("$Id$")
|
|||
|
||||
length=[string cStringLength];
|
||||
tempString = [string cString];
|
||||
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"string '%@' tempString=%s",
|
||||
string, tempString);
|
||||
|
||||
for (i = 0, dif = 0; i < length; i++)
|
||||
{
|
||||
switch (tempString[i + dif])
|
||||
switch (tempString[i])
|
||||
{
|
||||
case '\\':
|
||||
case '\'':
|
||||
|
@ -233,6 +235,8 @@ RCS_ID("$Id$")
|
|||
break;
|
||||
}
|
||||
}
|
||||
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"string '%@' tempString=%s",
|
||||
string, tempString);
|
||||
|
||||
formatted = [NSString stringWithFormat: @"'%@'", string];
|
||||
|
||||
|
@ -287,7 +291,7 @@ RCS_ID("$Id$")
|
|||
tableList];
|
||||
|
||||
if (whereClause && joinClause)
|
||||
[sqlString appendFormat: @" WHERE %@ AND %@",
|
||||
[sqlString appendFormat: @" WHERE (%@) AND (%@)",
|
||||
whereClause,
|
||||
joinClause];
|
||||
else if (whereClause || joinClause)
|
||||
|
|
|
@ -164,8 +164,7 @@ For efficiency reasons, the returned value is NOT autoreleased !
|
|||
calendarFormat: format];
|
||||
// TODO server TZ ?
|
||||
|
||||
// NSDebugMLLog(@"gsdb",@"str=%@ d=%@ format=%@",str,d,format);
|
||||
NSDebugMLog(@"str=%@ d=%@ format=%@", str, d, format);
|
||||
NSDebugMLLog(@"gsdb",@"str=%@ d=%@ format=%@",str,d,format);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
EOCheapArray.m <title>EOCheapCopyArray Classes</title>
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
Author: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Sep 2000
|
||||
|
@ -327,28 +327,16 @@ RCS_ID("$Id$")
|
|||
|
||||
- (void)addObject: (id)object
|
||||
{
|
||||
//7d0
|
||||
//im=530
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"self %p=%@", self, self);
|
||||
NSDebugMLLog(@"gsdb", @"object %p of class %@=%@",
|
||||
object,
|
||||
[object class],
|
||||
object);
|
||||
|
||||
if (!object)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to add nil"];
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"self %p=%@", self, self);
|
||||
|
||||
[self _mutate];
|
||||
|
||||
NSDebugMLLog(@"gsdb",@"self %p=%@", self, self);
|
||||
|
||||
if (_count >= _capacity)
|
||||
{
|
||||
unsigned int grow = (_grow_factor>5 ? _grow_factor : 5);
|
||||
|
@ -371,8 +359,6 @@ RCS_ID("$Id$")
|
|||
_contents_array[_count] = RETAIN(object);
|
||||
_count++; // Do this AFTER we have retained the object.
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"self %p=%@", self, self);
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
|
|
|
@ -231,12 +231,14 @@ static id classDelegate = nil;
|
|||
|
||||
entityName = [description entityName];
|
||||
//NSAssert(entityName,@"No Entity Name");
|
||||
NSDebugMLLog(@"gsdb", @"entityName=%@", entityName);
|
||||
|
||||
NSMapInsert(classDescriptionForClass, aClass, description);
|
||||
if (entityName)
|
||||
{
|
||||
NSMapInsert(classDescriptionForEntity, entityName, description);
|
||||
}
|
||||
NSDebugMLLog(@"gsdb", @"end");
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
@ -267,8 +269,13 @@ fromFetchInEditingContext: (EOEditingContext *)anEditingContext
|
|||
fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
||||
{
|
||||
//Near OK
|
||||
NSArray *toManyRelationshipKeys = [self toManyRelationshipKeys];
|
||||
int toManyCount = [toManyRelationshipKeys count];
|
||||
NSArray *toManyRelationshipKeys = nil;
|
||||
int toManyCount = 0;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
toManyRelationshipKeys = [self toManyRelationshipKeys];
|
||||
toManyCount = [toManyRelationshipKeys count];
|
||||
|
||||
if (toManyCount > 0)
|
||||
{
|
||||
|
@ -278,6 +285,7 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
{
|
||||
id key = [toManyRelationshipKeys objectAtIndex: i];
|
||||
id value = [object storedValueForKey: key];
|
||||
NSDebugMLLog(@"gsdb", @"key=%@ value=%@",key,value);
|
||||
|
||||
if (value)
|
||||
{
|
||||
|
@ -291,6 +299,7 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
}
|
||||
}
|
||||
}
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (EOClassDescription *)classDescriptionForDestinationKey: (NSString *)detailKey
|
||||
|
@ -1152,7 +1161,7 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
exception = [self validateForDelete];
|
||||
exception = [self validateForSave];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
|
@ -1183,10 +1192,13 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
|
||||
- (void)clearProperties
|
||||
{
|
||||
NSArray *toOne = [self toOneRelationshipKeys];
|
||||
NSArray *toMany = [self toManyRelationshipKeys];
|
||||
NSEnumerator *relEnum;
|
||||
NSString *key;
|
||||
NSArray *toOne = nil;
|
||||
NSArray *toMany = nil;
|
||||
NSEnumerator *relEnum = nil;
|
||||
NSString *key = nil;
|
||||
EOFLOGObjectFnStart();
|
||||
toOne = [self toOneRelationshipKeys];
|
||||
toMany = [self toManyRelationshipKeys];
|
||||
|
||||
relEnum = [toOne objectEnumerator];
|
||||
while ((key = [relEnum nextObject]))
|
||||
|
@ -1195,6 +1207,7 @@ fromInsertionInEditingContext: (EOEditingContext *)anEditingContext
|
|||
relEnum = [toMany objectEnumerator];
|
||||
while ((key = [relEnum nextObject]))
|
||||
[self takeStoredValue: nil forKey: key];
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (void)propagateDeleteWithEditingContext: (EOEditingContext *)editingContext
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
- (void)qualifyWithRelationshipKey: (NSString *)key
|
||||
ofObject: masterObject;
|
||||
- (NSString *)detailKey;
|
||||
- (void)setDetailKey:(NSString *)detailKey;
|
||||
- (id)masterObject;
|
||||
|
||||
- (EOEditingContext *)editingContext;
|
||||
|
|
|
@ -179,6 +179,11 @@ RCS_ID("$Id$")
|
|||
return _detailKey;
|
||||
}
|
||||
|
||||
- (void)setDetailKey:(NSString *)detailKey
|
||||
{
|
||||
ASSIGN(_detailKey, detailKey);
|
||||
};
|
||||
|
||||
- (id)masterObject
|
||||
{
|
||||
return _masterObject;
|
||||
|
|
|
@ -1338,6 +1338,9 @@ validateTable:(NSHashTable*)table
|
|||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EOEditingContext", @"unprocessed: %@",
|
||||
[self unprocessedDescription]);
|
||||
|
||||
validateForDelete = [self validateTable: _unprocessedDeletes
|
||||
withSelector: @selector(validateForDelete)
|
||||
exceptionArray: &exceptions
|
||||
|
@ -1441,6 +1444,12 @@ validateTable:(NSHashTable*)table
|
|||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EOEditingContext", @"table: %@",
|
||||
NSStringFromHashTable(table));
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EOEditingContext", @"sel: %@",
|
||||
NSStringFromSelector(sel));
|
||||
|
||||
enumerator = NSEnumerateHashTable(table);
|
||||
|
||||
while ((ok || continueAfterFailure)
|
||||
|
@ -2027,12 +2036,18 @@ validateTable:(NSHashTable*)table
|
|||
- (void) clearOriginalSnapshotForObject: (id)object
|
||||
{
|
||||
//Consider OK
|
||||
EOGlobalID *gid = [self globalIDForObject: object];
|
||||
EOGlobalID *gid = nil;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
gid = [self globalIDForObject: object];
|
||||
|
||||
if (gid)
|
||||
{
|
||||
[_snapshotsByGID removeObjectForKey: gid];
|
||||
}
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (id)objectForGlobalID:(EOGlobalID *)globalID
|
||||
|
|
|
@ -84,8 +84,8 @@ RCS_ID("$Id$")
|
|||
- (void)dealloc
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOFetchSpecification %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Dealloc EOFetchSpecification %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
|
||||
DESTROY(_qualifier);
|
||||
|
@ -98,8 +98,8 @@ RCS_ID("$Id$")
|
|||
[super dealloc];
|
||||
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Stop Dealloc EOFetchSpecification %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Stop Dealloc EOFetchSpecification %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ NSString *EOUnknownUserInfoKey = @"EOUnknownUserInfoKey";
|
|||
ret = [NSDecimalNumber zero];
|
||||
|
||||
while ((item = [arrayEnum nextObject]))
|
||||
[ret decimalNumberByAdding: [item valueForKey:key]];
|
||||
ret=[ret decimalNumberByAdding: [item valueForKey:key]];
|
||||
|
||||
EOFLOGObjectFnStopCond(@"EOKVC");
|
||||
|
||||
|
@ -468,7 +468,7 @@ NSString *EOUnknownUserInfoKey = @"EOUnknownUserInfoKey";
|
|||
ret = [NSDecimalNumber zero];
|
||||
|
||||
while ((item = [arrayEnum nextObject]))
|
||||
[ret decimalNumberByAdding: [item valueForKey:key]];
|
||||
ret=[ret decimalNumberByAdding: [item valueForKey:key]];
|
||||
|
||||
ret = [ret decimalNumberByDividingBy:
|
||||
[NSDecimalNumber decimalNumberWithMantissa: [self count]
|
||||
|
@ -854,7 +854,7 @@ NSString *EOUnknownUserInfoKey = @"EOUnknownUserInfoKey";
|
|||
isSmart:YES];
|
||||
}
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
//#if !FOUNDATION_HAS_KVC
|
||||
- (void)takeValue: (id)value
|
||||
forKeyPath: (NSString *)keyPath
|
||||
{
|
||||
|
@ -862,7 +862,7 @@ NSString *EOUnknownUserInfoKey = @"EOUnknownUserInfoKey";
|
|||
forKeyPath:keyPath
|
||||
isSmart:NO];
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
//#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
- (void)takeValue: (id)value
|
||||
forKeyPath: (NSString *)keyPath
|
||||
|
|
|
@ -118,15 +118,15 @@ RCS_ID("$Id$")
|
|||
- (void)dealloc
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOQualifier %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Dealloc EOQualifier %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
|
||||
[super dealloc];
|
||||
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Stop Dealloc EOQualifier %p. ThreadID=%p",
|
||||
(void*)self,(void*)objc_thread_id());
|
||||
// NSDebugFLog(@"Stop Dealloc EOQualifier %p. ThreadID=%p",
|
||||
// (void*)self,(void*)objc_thread_id());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -191,8 +191,8 @@ compareUsingSortOrderings(id left,
|
|||
EOSortOrdering *sortOrd = [sortOrders objectAtIndex: i];
|
||||
NSString *key = [sortOrd key];
|
||||
SEL compSel = [sortOrd selector];
|
||||
id leftVal = [left valueForKey: key];
|
||||
id rightVal = [right valueForKey: key];
|
||||
id leftVal = [left valueForKeyPath: key];
|
||||
id rightVal = [right valueForKeyPath: key];
|
||||
BOOL inverted = NO;
|
||||
NSComparisonResult (*imp)(id, SEL, id);
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EOUndoManager_h__
|
||||
#define __EOUndoManager_h__
|
||||
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSUndoManager.h>
|
||||
#else
|
||||
|
@ -41,3 +44,5 @@
|
|||
- (void) reenableUndoRegistration;
|
||||
|
||||
@end
|
||||
|
||||
#endif // __EOUndoManager_h__
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
/* Define if Foundation implements KeyValueCoding. */
|
||||
#define FOUNDATION_HAS_KVC 1
|
||||
|
||||
/* Log TODO points */
|
||||
#define EMIT_TODO 1
|
||||
|
||||
|
||||
#define RCS_ID(name) \
|
||||
static const char rcsId[] = name; \
|
||||
|
|
Loading…
Reference in a new issue