mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOAccess/EOEntityPriv.h: Remove GDL2DestinationEntitiesAddRelationship, and
GDL2DestinationEntitiesRemoveRelationship. * EOAccess/EOEntity.m (+initialize, -dealloc): Remove usage and implementations of the above functions. * EOAccess/EORelationship.m (-initWithPropertyList:owner:): (-setDefinition:): Ditto. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@27908 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fe164e8ac2
commit
d1f4226c8e
4 changed files with 12 additions and 63 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2009-02-17 Matt Rice <ratmice@gmail.com>
|
||||
|
||||
* EOAccess/EOEntityPriv.h: Remove
|
||||
GDL2DestinationEntitiesAddRelationship, and
|
||||
GDL2DestinationEntitiesRemoveRelationship.
|
||||
* EOAccess/EOEntity.m (+initialize, -dealloc): Remove usage and
|
||||
implementations of the above functions.
|
||||
* EOAccess/EORelationship.m (-initWithPropertyList:owner:):
|
||||
(-setDefinition:): Ditto.
|
||||
|
||||
2009-02-17 David Ayers <ayers@fsfe.org>
|
||||
|
||||
* EOControl/gdl2.EOControl.make
|
||||
|
|
|
@ -88,56 +88,6 @@ RCS_ID("$Id$")
|
|||
#include "EOAttributePriv.h"
|
||||
#include "../EOControl/EOPrivate.h"
|
||||
|
||||
static NSMapTable *_destinationEntitiesRelationshipMap;
|
||||
|
||||
void GDL2DestinationEntitiesAddRelationship(EOEntity *entity, EORelationship *relationship);
|
||||
void GDL2DestinationEntitiesRemoveRelationship(EOEntity *entity, EORelationship *relationship);
|
||||
|
||||
static void GDL2DestinationEntitiesRemoveEntity(EOEntity *entity)
|
||||
{
|
||||
GDL2NonRetainingMutableArray *rels;
|
||||
|
||||
rels = NSMapGet(_destinationEntitiesRelationshipMap, entity);
|
||||
if (rels)
|
||||
{
|
||||
[rels makeObjectsPerformSelector:@selector(_joinsChanged)];
|
||||
}
|
||||
NSMapRemove(_destinationEntitiesRelationshipMap, entity);
|
||||
}
|
||||
|
||||
void GDL2DestinationEntitiesAddRelationship(EOEntity *entity, EORelationship *relationship)
|
||||
{
|
||||
GDL2NonRetainingMutableArray *rels;
|
||||
|
||||
if (!entity) return;
|
||||
|
||||
rels = NSMapGet(_destinationEntitiesRelationshipMap, entity);
|
||||
if (!rels)
|
||||
{
|
||||
rels = [[GDL2NonRetainingMutableArray alloc] init];
|
||||
NSMapInsert(_destinationEntitiesRelationshipMap, entity, rels);
|
||||
RELEASE(rels);
|
||||
}
|
||||
[rels addObject:relationship];
|
||||
}
|
||||
|
||||
void GDL2DestinationEntitiesRemoveRelationship(EOEntity *entity, EORelationship *relationship)
|
||||
{
|
||||
GDL2NonRetainingMutableArray *rels;
|
||||
|
||||
if (!entity) return;
|
||||
|
||||
rels = NSMapGet(_destinationEntitiesRelationshipMap, entity);
|
||||
|
||||
[rels removeObject:relationship];
|
||||
if ([rels count] == 0)
|
||||
{
|
||||
NSMapRemove(_destinationEntitiesRelationshipMap, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@interface EOModel (Privat)
|
||||
- (void)_updateCache;
|
||||
@end
|
||||
|
@ -157,9 +107,6 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
if (!initialized)
|
||||
{
|
||||
initialized=YES;
|
||||
_destinationEntitiesRelationshipMap =
|
||||
NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks, 0);
|
||||
GDL2_EOAccessPrivateInit();
|
||||
};
|
||||
};
|
||||
|
@ -618,8 +565,6 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
|
|||
nil, [EOAttribute class]);
|
||||
performSelectorOnArrayWithEachObjectOfClass(_relationships, @selector(setEntity:),
|
||||
nil, [EORelationship class]);
|
||||
// this must come after _attributes is cleared.
|
||||
GDL2DestinationEntitiesRemoveEntity(self);
|
||||
|
||||
DESTROY(_adaptorDictionaryInitializer);
|
||||
DESTROY(_instanceDictionaryInitializer);
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
@class EOExpressionArray;
|
||||
@class EOSQLExpression;
|
||||
|
||||
GDL2ACCESS_EXPORT void GDL2DestinationEntitiesAddRelationship(EOEntity *entity, EORelationship *relationship);
|
||||
GDL2ACCESS_EXPORT void GDL2DestinationEntitiesRemoveRelationship(EOEntity *entity, EORelationship *relationship);
|
||||
|
||||
@interface EOEntity (EOEntityPrivate)
|
||||
|
||||
- (BOOL)isPrototypeEntity;
|
||||
|
|
|
@ -168,8 +168,6 @@ RCS_ID("$Id$")
|
|||
{
|
||||
destinationEntity = [model entityNamed: destinationEntityName];
|
||||
|
||||
GDL2DestinationEntitiesRemoveRelationship(_destination, self);
|
||||
GDL2DestinationEntitiesAddRelationship(destinationEntity, self);
|
||||
_destination = destinationEntity;
|
||||
}
|
||||
|
||||
|
@ -1292,7 +1290,6 @@ relationships. Nil if none" **/
|
|||
EOFLOGObjectLevelArgs(@"EORelationship", @"_definitionArray=%@", _definitionArray);
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"[self definition]=%@", [self definition]);
|
||||
|
||||
GDL2DestinationEntitiesRemoveRelationship(_destination, self);
|
||||
_destination = nil;
|
||||
|
||||
{
|
||||
|
@ -2175,6 +2172,8 @@ dst entity primaryKeyAttributeNames
|
|||
DESTROY(_inverseRelationship);
|
||||
DESTROY(_hiddenInverseRelationship);
|
||||
DESTROY(_componentRelationships);
|
||||
_destination = nil;
|
||||
|
||||
}
|
||||
|
||||
- (EOExpressionArray*) _definitionArray
|
||||
|
@ -2334,8 +2333,6 @@ dst entity primaryKeyAttributeNames
|
|||
EOAttribute *destinationAttribute = [join destinationAttribute];
|
||||
EOEntity *destinationEntity = [destinationAttribute entity];
|
||||
|
||||
GDL2DestinationEntitiesRemoveRelationship(_destination, self);
|
||||
GDL2DestinationEntitiesAddRelationship(destinationEntity, self);
|
||||
_destination = destinationEntity;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue