* EOAccess/EODatabaseDataSource.m ([EODatabaseDataSource

-initWithEditingContext:entityName:fetchSpecificationName:]):
	Create default fetch specification if we cannot obtain one from
	the entity by name as reported by Dirk Lattermann.
	* EOAccess/EOEntity.h/m
	([EOEntity -addFetchSpecification:withName:]): Corrected name and
	initialization as reported by Dirk Lattermann.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@16729 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2003-05-14 21:33:01 +00:00
parent 0b467c7502
commit 89d7e88574
4 changed files with 37 additions and 11 deletions

View file

@ -1,3 +1,13 @@
2003-08-14 David Ayers <d.ayers@inode.at>
* EOAccess/EODatabaseDataSource.m ([EODatabaseDataSource
-initWithEditingContext:entityName:fetchSpecificationName:]):
Create default fetch specification if we cannot obtain one from
the entity by name as reported by Dirk Lattermann.
* EOAccess/EOEntity.h/m
([EOEntity -addFetchSpecification:withName:]): Corrected name and
initialization as reported by Dirk Lattermann.
2003-08-05 David Ayers <d.ayers@inode.at>
* EOControl/EOObjectStoreCoordinator.m ([EOObjectStoreCoordinator

View file

@ -77,17 +77,17 @@ RCS_ID("$Id$")
@implementation EODatabaseDataSource
- initWithEditingContext: (EOEditingContext *)editingContext
entityName: (NSString *)entityName
- (id)initWithEditingContext: (EOEditingContext *)editingContext
entityName: (NSString *)entityName
{
return [self initWithEditingContext: editingContext
entityName: entityName
fetchSpecificationName: nil];
}
- initWithEditingContext: (EOEditingContext *)editingContext
entityName: (NSString *)entityName
fetchSpecificationName: (NSString *)fetchName
- (id)initWithEditingContext: (EOEditingContext *)editingContext
entityName: (NSString *)entityName
fetchSpecificationName: (NSString *)fetchName
{
NSArray *stores;
EODatabaseContext *store = nil;
@ -95,6 +95,7 @@ RCS_ID("$Id$")
EOModel *model;
EOEntity *entity = nil;
id rootStore;
EOFetchSpecification *fetchSpec;
if ((self = [super init]))
{
@ -146,8 +147,16 @@ RCS_ID("$Id$")
self,
editingContext,
entityName];
ASSIGN(_fetchSpecification, [entity fetchSpecificationNamed:fetchName]);
fetchSpec = [entity fetchSpecificationNamed: fetchName];
if (fetchSpec == nil)
{
fetchSpec = [EOFetchSpecification
fetchSpecificationWithEntityName: entityName
qualifier: nil
sortOrderings: nil];
}
ASSIGN(_fetchSpecification, fetchSpec);
}
return self;

View file

@ -235,7 +235,7 @@
- (void)removeRelationship: (EORelationship *)relationship;
- (void)addFetchSpecification: (EOFetchSpecification *)fetchSpec
named: (NSString *)name;
withName: (NSString *)name;
- (void)removeFetchSpecificationNamed: (NSString *)name;
- (void)setClassName: (NSString*)name;

View file

@ -278,11 +278,12 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
if (tmpObject)
{
tmpObject = AUTORELEASE([tmpObject mutableCopy]);
ASSIGN(_fetchSpecificationDictionary, tmpObject);
}
else
{
_fetchSpecificationDictionary = [NSDictionary new];
_fetchSpecificationDictionary = [NSMutableDictionary new];
EOFLOGObjectLevelArgs(@"EOEntity",
@"Entity %@ - _fetchSpecificationDictionary %p [RC=%d]:%@",
@ -331,7 +332,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
//NSLog(@"fetchSpecName:%@ fetchSpec:%@", fetchSpecName, fetchSpec);
[self addFetchSpecification: fetchSpec
named: fetchSpecName];
withName: fetchSpecName];
}
}
}
@ -519,6 +520,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
DESTROY(_externalQuery);
DESTROY(_userInfo);
DESTROY(_docComment);
DESTROY(_fetchSpecificationDictionary);
DESTROY(_primaryKeyAttributeNames);
DESTROY(_classPropertyNames);
DESTROY(_classDescription);
@ -2131,8 +2133,13 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
}
- (void)addFetchSpecification: (EOFetchSpecification *)fetchSpec
named: (NSString *)name
withName: (NSString *)name
{
if (_fetchSpecificationDictionary == nil)
{
_fetchSpecificationDictionary = [NSMutableDictionary new];
}
[_fetchSpecificationDictionary setObject: fetchSpec forKey: name];
ASSIGN(_fetchSpecificationNames, [[_fetchSpecificationDictionary allKeys]
sortedArrayUsingSelector: