mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-21 10:30:58 +00:00
* EOAccess/EODatabaseContext.m
(qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:) Revert rewrite. Adapt to NSUInteger. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30194 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
234e98ea68
commit
6b8476b76b
2 changed files with 63 additions and 79 deletions
30
ChangeLog
30
ChangeLog
|
@ -1,18 +1,26 @@
|
||||||
2010-04-19 David Wetzel <dave@turbocat.de>
|
2010-04-19 David Ayers <ayers@fsfe.org>
|
||||||
* EOInterface/EOAssociation.m: remove hacks
|
|
||||||
* EOControl/EOEditingContext.m: remove hacks, adapt to EOCustomObject
|
|
||||||
* EOControl/EOCustomObject.h/m: added code here
|
|
||||||
* EOControl/EOClassDescription.h/m: adapt to EOCustomObject
|
|
||||||
* EOControl/EOPrivate.h: adapt to EOCustomObject
|
|
||||||
* EOControl/EOClassDescription.m:adapt to EOCustomObject
|
|
||||||
|
|
||||||
* EOAccess/EODatabaseContext.m rewrote qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
|
* EOAccess/EODatabaseContext.m
|
||||||
|
(qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:)
|
||||||
|
Revert rewrite. Adapt to NSUInteger.
|
||||||
|
|
||||||
|
2010-04-19 David Wetzel <dave@turbocat.de>
|
||||||
|
|
||||||
|
* EOInterface/EOAssociation.m: remove hacks
|
||||||
|
* EOControl/EOEditingContext.m: remove hacks, adapt to EOCustomObject
|
||||||
|
* EOControl/EOCustomObject.h/m: added code here
|
||||||
|
* EOControl/EOClassDescription.h/m: adapt to EOCustomObject
|
||||||
|
* EOControl/EOPrivate.h: adapt to EOCustomObject
|
||||||
|
* EOControl/EOClassDescription.m:adapt to EOCustomObject
|
||||||
|
|
||||||
|
* EOAccess/EODatabaseContext.m rewrote qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
|
||||||
|
|
||||||
|
|
||||||
2010-04-17 David Wetzel <dave@turbocat.de>
|
2010-04-17 David Wetzel <dave@turbocat.de>
|
||||||
* EOCustomObject.h/m new class like in EOF3. Use this as your EO's superclass or
|
|
||||||
use EOGenericRecords
|
* EOCustomObject.h/m new class like in EOF3. Use this as your EO's superclass or
|
||||||
* EOControl/EOControl.h: add EOCustomObject.h
|
use EOGenericRecords
|
||||||
|
* EOControl/EOControl.h: add EOCustomObject.h
|
||||||
|
|
||||||
2010-04-14 David Ayers <ayers@fsfe.org>
|
2010-04-14 David Ayers <ayers@fsfe.org>
|
||||||
|
|
||||||
|
|
|
@ -5399,92 +5399,68 @@ Raises an exception is the adaptor is unable to perform the operations.
|
||||||
NSMutableArray *qualifiers = nil;
|
NSMutableArray *qualifiers = nil;
|
||||||
int which;
|
int which;
|
||||||
|
|
||||||
EOFLOGObjectFnStart();
|
|
||||||
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"attributes=%@", attributes);
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"primaryKeyAttributes=%@",
|
|
||||||
primaryKeyAttributes);
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"snapshot=%@", snapshot);
|
|
||||||
|
|
||||||
//First use primaryKeyAttributes, next use attributes
|
//First use primaryKeyAttributes, next use attributes
|
||||||
for (which = 0; which < 2; which++)
|
for (which = 0; which < 2; which++)
|
||||||
{
|
{
|
||||||
NSArray *array = (which == 0 ? primaryKeyAttributes : attributes);
|
NSArray *array = (which == 0 ? primaryKeyAttributes : attributes);
|
||||||
int count = [array count];
|
NSUInteger i,count = [array count];
|
||||||
|
|
||||||
if (count>0)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
IMP oaiIMP=[array methodForSelector: @selector(objectAtIndex:)];
|
EOAttribute *attribute = [array objectAtIndex: i];
|
||||||
int i=0;
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
EOAttribute *attribute = GDL2_ObjectAtIndexWithImp(array,oaiIMP,i);
|
|
||||||
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"attribute=%@", attribute);
|
if (which == 0 || ![primaryKeyAttributes containsObject: attribute])// Test if we haven't already processed it
|
||||||
|
{
|
||||||
if (which == 0 || ![primaryKeyAttributes containsObject: attribute])// Test if we haven't already processed it
|
if (![self isValidQualifierTypeForAttribute: attribute])
|
||||||
{
|
{
|
||||||
if (![self isValidQualifierTypeForAttribute: attribute])
|
NSLog(@"Invalid externalType for attribute '%@' of entity named '%@' - model '%@'",
|
||||||
{
|
[attribute name], [[attribute entity] name],
|
||||||
NSLog(@"Invalid externalType for attribute '%@' of entity named '%@' - model '%@'",
|
[[[attribute entity] model] name]);
|
||||||
[attribute name], [[attribute entity] name],
|
NSEmitTODO();
|
||||||
[[[attribute entity] model] name]);
|
[self notImplemented: _cmd]; //TODO
|
||||||
NSEmitTODO();
|
}
|
||||||
[self notImplemented: _cmd]; //TODO
|
else
|
||||||
}
|
{
|
||||||
else
|
NSString *attributeName = nil;
|
||||||
{
|
NSString *snapName = nil;
|
||||||
NSString *attributeName = nil;
|
id value = nil;
|
||||||
NSString *snapName = nil;
|
EOQualifier *aQualifier = nil;
|
||||||
id value = nil;
|
|
||||||
EOQualifier *aQualifier = nil;
|
attributeName = [attribute name];
|
||||||
|
NSAssert1(attributeName, @"no attribute name for attribute %@", attribute);
|
||||||
|
|
||||||
attributeName = [attribute name];
|
snapName = [entity snapshotKeyForAttributeName: attributeName];
|
||||||
NSAssert1(attributeName, @"no attribute name for attribute %@", attribute);
|
NSAssert2(snapName, @"no snapName for attribute %@ in entity %@",
|
||||||
|
attributeName, [entity name]);
|
||||||
|
|
||||||
snapName = [entity snapshotKeyForAttributeName: attributeName];
|
value = [snapshot objectForKey:snapName];
|
||||||
NSAssert2(snapName, @"no snapName for attribute %@ in entity %@", attributeName, [entity name]);
|
|
||||||
|
|
||||||
value = [snapshot objectForKey:snapName];
|
NSAssert4(value != nil,
|
||||||
|
@"no value for snapshotKey '%@' in snapshot (address=%p) %@ for entity %@",
|
||||||
|
snapName, snapshot, snapshot, [entity name]);
|
||||||
|
|
||||||
|
aQualifier
|
||||||
|
= [EOKeyValueQualifier qualifierWithKey: attributeName
|
||||||
|
operatorSelector: @selector(isEqualTo:)
|
||||||
|
value: value];
|
||||||
|
|
||||||
if (!value)
|
if (!qualifiers)
|
||||||
{
|
qualifiers = [NSMutableArray array];
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"NO VALUE");
|
|
||||||
}
|
|
||||||
|
|
||||||
NSAssert4(value, @"no value for snapshotKey '%@' in snapshot (address=%p) %@ for entity %@",
|
[qualifiers addObject: aQualifier];
|
||||||
snapName, snapshot, snapshot, [entity name]);
|
|
||||||
|
|
||||||
aQualifier = [EOKeyValueQualifier
|
|
||||||
qualifierWithKey: attributeName
|
|
||||||
operatorSelector: @selector(isEqualTo:)
|
|
||||||
value: value];
|
|
||||||
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"aQualifier=%@",
|
|
||||||
aQualifier);
|
|
||||||
|
|
||||||
if (!qualifiers)
|
|
||||||
qualifiers = [NSMutableArray array];
|
|
||||||
|
|
||||||
[qualifiers addObject: aQualifier];
|
|
||||||
|
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"qualifiers=%@",
|
|
||||||
qualifiers);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([qualifiers count] == 1)
|
if ([qualifiers count] == 1)
|
||||||
qualifier = [qualifiers objectAtIndex: 0];
|
{
|
||||||
|
qualifier = [qualifiers objectAtIndex: 0];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
qualifier = [EOAndQualifier qualifierWithQualifierArray: qualifiers];
|
{
|
||||||
|
qualifier = [EOAndQualifier qualifierWithQualifierArray: qualifiers];
|
||||||
NSDebugMLLog(@"EODatabaseContext", @"qualifier=%@", qualifier);
|
}
|
||||||
|
|
||||||
EOFLOGObjectFnStop();
|
|
||||||
|
|
||||||
return qualifier;
|
return qualifier;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue