mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOAccess/EOAttribute.m: Remove usage of GCObject, and its
subclasses. * EOAccess/EOModelGroup.h: Ditto. * EOAccess/EOStoredProcedure.m: Ditto. * EOAccess/EOModelGroup.m: Ditto. * EOAccess/EOExpressionArray.h: Ditto. * EOAccess/EORelationship.h: Ditto. * EOAccess/EOExpressionArray.m: Ditto. * EOAccess/EOEntity.h: Ditto. * EOAccess/EOEntity.m: Ditto. * EOAccess/EOJoin.h: Ditto. * EOAccess/EOModel.h: Ditto. * EOAccess/EOAttribute.h: Ditto. * EOAccess/EOAttributePriv.h: Ditto. * EOAccess/EOJoin.m: Ditto. * EOAccess/EORelationship.m: Ditto, and don't retain source and * EOAccess/EOStoredProcedure.h: Ditto, and don't retain model. * EOAccess/EOModel.m: Ditto. (-addStoredProcedure:): Fix error when using non-mutable objects. (-dealloc): Add missing ivars. destination entities. * EOAccess/GNUmakefile: Remove slash on last header file. * EOControl/EOPrivate.m: Update comment. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23874 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
026bcaf9ed
commit
76628971bb
20 changed files with 314 additions and 695 deletions
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
|||
2006-10-14 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOAccess/EOAttribute.m: Remove usage of GCObject, and its subclasses.
|
||||
* EOAccess/EOModelGroup.h: Ditto.
|
||||
* EOAccess/EOStoredProcedure.m: Ditto.
|
||||
* EOAccess/EOModelGroup.m: Ditto.
|
||||
* EOAccess/EOExpressionArray.h: Ditto.
|
||||
* EOAccess/EORelationship.h: Ditto.
|
||||
* EOAccess/EOExpressionArray.m: Ditto.
|
||||
* EOAccess/EOEntity.h: Ditto.
|
||||
* EOAccess/EOEntity.m: Ditto.
|
||||
* EOAccess/EOJoin.h: Ditto.
|
||||
* EOAccess/EOModel.h: Ditto.
|
||||
* EOAccess/EOAttribute.h: Ditto.
|
||||
* EOAccess/EOAttributePriv.h: Ditto.
|
||||
* EOAccess/EOJoin.m: Ditto.
|
||||
* EOAccess/EORelationship.m: Ditto, and don't retain source and
|
||||
* EOAccess/EOStoredProcedure.h: Ditto, and don't retain model.
|
||||
* EOAccess/EOModel.m: Ditto.
|
||||
(-addStoredProcedure:): Fix error when using non-mutable objects.
|
||||
(-dealloc): Add missing ivars.
|
||||
destination entities.
|
||||
* EOAccess/GNUmakefile: Remove slash on last header file.
|
||||
* EOControl/EOPrivate.m: Update comment.
|
||||
|
||||
2006-10-14 David Ayers <ayers@fsfe.org>
|
||||
|
||||
* EOAccess/EOAdaptor.m (databaseEncoding): Use NSStringEncoding
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOAccess/EOPropertyListEncoding.h>
|
||||
|
||||
|
||||
|
@ -71,7 +69,7 @@ typedef enum {
|
|||
} EOParameterDirection;
|
||||
|
||||
|
||||
@interface EOAttribute : GCObject <EOPropertyListEncoding>
|
||||
@interface EOAttribute : NSObject <EOPropertyListEncoding>
|
||||
{
|
||||
NSString *_name;
|
||||
NSString *_columnName;
|
||||
|
|
|
@ -390,42 +390,6 @@ RCS_ID("$Id$")
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
[_parent gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"prototype gcDecrementRefCount");
|
||||
|
||||
[_prototype gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"definitionArray gcDecrementRefCount");
|
||||
|
||||
[(id)_definitionArray gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"realAttribute gcDecrementRefCount");
|
||||
|
||||
[_realAttribute gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
[_parent gcIncrementRefCount];
|
||||
[_prototype gcIncrementRefCount];
|
||||
[(id)_definitionArray gcIncrementRefCount];
|
||||
[_realAttribute gcIncrementRefCount];
|
||||
|
||||
[_parent gcIncrementRefCountOfContainedObjects];
|
||||
[_prototype gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_definitionArray gcIncrementRefCountOfContainedObjects];
|
||||
[_realAttribute gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (unsigned)hash
|
||||
{
|
||||
return [_name hash];
|
||||
|
@ -453,7 +417,7 @@ RCS_ID("$Id$")
|
|||
return dscr;
|
||||
}
|
||||
|
||||
/* We override GCObjects default implementation
|
||||
/* We override NSObjects default implementation
|
||||
as attributes cannot be copied */
|
||||
- (id)copyWithZone:(NSZone *)zone
|
||||
{
|
||||
|
@ -1890,7 +1854,7 @@ More details:
|
|||
return _realAttribute;
|
||||
}
|
||||
|
||||
- (GCMutableArray *)_definitionArray
|
||||
- (NSMutableArray *)_definitionArray
|
||||
{
|
||||
return _definitionArray;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define __EOAttributePriv_h__
|
||||
|
||||
@interface EOAttribute (EOAttributePrivate)
|
||||
- (GCMutableArray *)_definitionArray;
|
||||
- (NSMutableArray *)_definitionArray;
|
||||
|
||||
- (void)setParent: (id)parent;
|
||||
- (EOAttribute *)realAttribute;
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOControl/EOClassDescription.h>
|
||||
|
||||
#include <EOAccess/EODefines.h>
|
||||
|
@ -59,7 +57,7 @@
|
|||
@class EOMKKDSubsetMapping;
|
||||
|
||||
|
||||
@interface EOEntity : GCObject <EOPropertyListEncoding>
|
||||
@interface EOEntity : NSObject <EOPropertyListEncoding>
|
||||
{
|
||||
NSString *_name;
|
||||
NSString *_className;
|
||||
|
@ -92,19 +90,19 @@
|
|||
|
||||
/* Garbage collectable objects */
|
||||
EOModel *_model;
|
||||
GCMutableArray *_attributes;
|
||||
GCMutableDictionary *_attributesByName;
|
||||
GCMutableArray *_relationships;
|
||||
GCMutableDictionary *_relationshipsByName; // name/EORelationship
|
||||
GCMutableArray *_primaryKeyAttributes;
|
||||
GCMutableArray *_classProperties; // EOAttribute/EORelationship
|
||||
GCMutableArray *_attributesUsedForLocking;
|
||||
GCMutableArray *_attributesToFetch;
|
||||
GCMutableArray *_attributesToSave;
|
||||
GCMutableArray *_propertiesToFault;
|
||||
GCArray* _dbSnapshotKeys;
|
||||
NSMutableArray *_attributes;
|
||||
NSMutableDictionary *_attributesByName;
|
||||
NSMutableArray *_relationships;
|
||||
NSMutableDictionary *_relationshipsByName; // name/EORelationship
|
||||
NSMutableArray *_primaryKeyAttributes;
|
||||
NSMutableArray *_classProperties; // EOAttribute/EORelationship
|
||||
NSMutableArray *_attributesUsedForLocking;
|
||||
NSMutableArray *_attributesToFetch;
|
||||
NSMutableArray *_attributesToSave;
|
||||
NSMutableArray *_propertiesToFault;
|
||||
NSArray* _dbSnapshotKeys;
|
||||
|
||||
GCMutableArray *_subEntities;
|
||||
NSMutableArray *_subEntities;
|
||||
EOEntity *_parent;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -511,8 +511,8 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
//OK
|
||||
if ((self = [super init]))
|
||||
{
|
||||
_attributes = [GCMutableArray new];
|
||||
_subEntities = [GCMutableArray new];
|
||||
_attributes = [NSMutableArray new];
|
||||
_subEntities = [NSMutableArray new];
|
||||
[self setCreateMutableObjects: YES];
|
||||
}
|
||||
|
||||
|
@ -521,6 +521,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
DESTROY(_attributes);
|
||||
DESTROY(_name);
|
||||
DESTROY(_className);
|
||||
DESTROY(_externalName);
|
||||
|
@ -542,304 +543,6 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
int where = 0;
|
||||
NSProcessInfo *_processInfo = [NSProcessInfo processInfo];
|
||||
NSMutableSet *_debugSet = [_processInfo debugSet];
|
||||
|
||||
[_debugSet addObject: @"gsdb"];
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
where = 1;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"attributes gcDecrementRefCount");
|
||||
if (!_flags.attributesIsLazy)
|
||||
[(id)_attributes gcDecrementRefCount];
|
||||
|
||||
where = 2;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"propertiesToFault gcDecrementRefCount");
|
||||
[(id)_attributesByName gcDecrementRefCount];
|
||||
|
||||
where = 3;
|
||||
EOFLOGObjectLevelArgs(@"EOEntity",
|
||||
@"attributesToFetch gcDecrementRefCount class=%@",
|
||||
[_attributesToFetch class]);
|
||||
NSAssert3(!_attributesToFetch
|
||||
|| [_attributesToFetch isKindOfClass: [NSArray class]],
|
||||
@"entity %@ attributesToFetch is not an NSArray but a %@\n%@",
|
||||
[self name],
|
||||
[_attributesToFetch class],
|
||||
_attributesToFetch);
|
||||
|
||||
[(id)_attributesToFetch gcDecrementRefCount];
|
||||
|
||||
NSAssert3(!_attributesToFetch
|
||||
|| [_attributesToFetch isKindOfClass: [NSArray class]],
|
||||
@"entity %@ attributesToFetch is not an NSArray but a %@\n%@",
|
||||
[self name],
|
||||
[_attributesToFetch class],
|
||||
_attributesToFetch);
|
||||
|
||||
where = 4;
|
||||
EOFLOGObjectLevelArgs(@"EOEntity",
|
||||
@"attributesToSave gcDecrementRefCount (class=%@)",
|
||||
[_attributesToSave class]);
|
||||
[(id)_attributesToSave gcDecrementRefCount];
|
||||
|
||||
where = 5;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"propertiesToFault gcDecrementRefCount");
|
||||
[(id)_propertiesToFault gcDecrementRefCount];
|
||||
|
||||
where = 6;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"rrelationships gcDecrementRefCount");
|
||||
if (!_flags.relationshipsIsLazy)
|
||||
[(id)_relationships gcDecrementRefCount];
|
||||
|
||||
where = 7;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"relationshipsByName gcDecrementRefCount");
|
||||
[(id)_relationshipsByName gcDecrementRefCount];
|
||||
|
||||
where = 8;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"primaryKeyAttributes gcDecrementRefCount");
|
||||
if (!_flags.primaryKeyAttributesIsLazy)
|
||||
[(id)_primaryKeyAttributes gcDecrementRefCount];
|
||||
|
||||
where = 9;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"classProperties gcDecrementRefCount");
|
||||
if (!_flags.classPropertiesIsLazy)
|
||||
[(id)_classProperties gcDecrementRefCount];
|
||||
|
||||
where = 10;
|
||||
EOFLOGObjectLevelArgs(@"EOEntity",
|
||||
@"attributesUsedForLocking (%@) gcDecrementRefCount",
|
||||
[_attributesUsedForLocking class]);
|
||||
if (!_flags.attributesUsedForLockingIsLazy)
|
||||
[(id)_attributesUsedForLocking gcDecrementRefCount];
|
||||
|
||||
where = 11;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"subEntities gcDecrementRefCount");
|
||||
[(id)_subEntities gcDecrementRefCount];
|
||||
|
||||
where = 12;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"dbSnapshotKeys gcDecrementRefCount");
|
||||
[(id)_dbSnapshotKeys gcDecrementRefCount];
|
||||
|
||||
where = 13;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"_parent gcDecrementRefCount");
|
||||
[_parent gcDecrementRefCount];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"====>WHERE=%d %@ (%@)", where, localException,
|
||||
[localException reason]);
|
||||
NSDebugMLog(@"attributesToFetch gcDecrementRefCount class=%@",
|
||||
[_attributesToFetch class]);
|
||||
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
[_debugSet removeObject: @"gsdb"];
|
||||
}
|
||||
|
||||
- (BOOL) gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
int where = 0;
|
||||
NSProcessInfo *_processInfo = [NSProcessInfo processInfo];
|
||||
NSMutableSet *_debugSet = [_processInfo debugSet];
|
||||
|
||||
[_debugSet addObject: @"gsdb"];
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
{
|
||||
EOFLOGObjectFnStop();
|
||||
[_debugSet removeObject: @"gsdb"];
|
||||
|
||||
return NO;
|
||||
}
|
||||
NS_DURING
|
||||
{
|
||||
where = 1;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"model gcIncrementRefCount");
|
||||
[_model gcIncrementRefCount];
|
||||
|
||||
where = 2;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"attributes gcIncrementRefCount");
|
||||
if (!_flags.attributesIsLazy)
|
||||
[(id)_attributes gcIncrementRefCount];
|
||||
|
||||
where = 3;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"attributesByName gcIncrementRefCount");
|
||||
[(id)_attributesByName gcIncrementRefCount];
|
||||
|
||||
where = 4;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"attributesToFetch gcIncrementRefCount");
|
||||
NSAssert3(!_attributesToFetch
|
||||
|| [_attributesToFetch isKindOfClass: [NSArray class]],
|
||||
@"entity %@ attributesToFetch is not an NSArray but a %@\n%@",
|
||||
[self name],
|
||||
[_attributesToFetch class],
|
||||
_attributesToFetch);
|
||||
|
||||
[(id)_attributesToFetch gcIncrementRefCount];
|
||||
|
||||
NSAssert3(!_attributesToFetch
|
||||
|| [_attributesToFetch isKindOfClass: [NSArray class]],
|
||||
@"entity %@ attributesToFetch is not an NSArray but a %@\n%@",
|
||||
[self name],
|
||||
[_attributesToFetch class],
|
||||
_attributesToFetch);
|
||||
|
||||
where = 5;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"attributesToSave gcIncrementRefCount");
|
||||
[(id)_attributesToSave gcIncrementRefCount];
|
||||
|
||||
where = 6;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"propertiesToFault gcIncrementRefCount");
|
||||
[(id)_propertiesToFault gcIncrementRefCount];
|
||||
|
||||
where = 7;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"relationships gcIncrementRefCount");
|
||||
if (!_flags.relationshipsIsLazy)
|
||||
[(id)_relationships gcIncrementRefCount];
|
||||
|
||||
where = 8;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"relationshipsByName gcIncrementRefCount");
|
||||
[(id)_relationshipsByName gcIncrementRefCount];
|
||||
|
||||
where = 9;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"primaryKeyAttributes gcIncrementRefCount");
|
||||
if (!_flags.primaryKeyAttributesIsLazy)
|
||||
[(id)_primaryKeyAttributes gcIncrementRefCount];
|
||||
|
||||
where = 10;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"classProperties gcIncrementRefCount");
|
||||
if (!_flags.classPropertiesIsLazy)
|
||||
[(id)_classProperties gcIncrementRefCount];
|
||||
|
||||
where = 11;
|
||||
EOFLOGObjectLevel(@"EOEntity",
|
||||
@"attributesUsedForLocking gcIncrementRefCount");
|
||||
if (!_flags.attributesUsedForLockingIsLazy)
|
||||
[(id)_attributesUsedForLocking gcIncrementRefCount];
|
||||
|
||||
where = 12;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"subEntities gcIncrementRefCount");
|
||||
[(id)_subEntities gcIncrementRefCount];
|
||||
|
||||
where = 13;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"dbSnapshotKeys gcIncrementRefCount");
|
||||
[(id)_dbSnapshotKeys gcIncrementRefCount];
|
||||
|
||||
where = 14;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"parent gcIncrementRefCount");
|
||||
[_parent gcIncrementRefCount];
|
||||
|
||||
where = 15;
|
||||
[_model gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 16;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"attributes gcIncrementRefCountOfContainedObjects");
|
||||
if (!_flags.attributesIsLazy)
|
||||
[(id)_attributes gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 17;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"attributesByName gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_attributesByName gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 18;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"attributesToFetch gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_attributesToFetch gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 19;
|
||||
EOFLOGObjectLevelArgs(@"EOEntity", @"attributesToSave gcIncrementRefCountOfContainedObjects (class=%@)",
|
||||
[_attributesToSave class]);
|
||||
[(id)_attributesToSave gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 20;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"propertiesToFault gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_propertiesToFault gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 21;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"rrelationships gcIncrementRefCountOfContainedObjects");
|
||||
if (!_flags.relationshipsIsLazy)
|
||||
[(id)_relationships gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 22;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"relationshipsByName gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_relationshipsByName gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 23;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"primaryKeyAttributes gcIncrementRefCountOfContainedObjects");
|
||||
if (!_flags.primaryKeyAttributesIsLazy)
|
||||
[(id)_primaryKeyAttributes gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 24;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"classProperties gcIncrementRefCountOfContainedObjects");
|
||||
if (!_flags.classPropertiesIsLazy)
|
||||
[(id)_classProperties gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 25;
|
||||
EOFLOGObjectLevelArgs(@"EOEntity", @"attributesUsedForLocking (%@) gcIncrementRefCountOfContainedObjects",
|
||||
[_attributesUsedForLocking class]);
|
||||
if (!_flags.attributesUsedForLockingIsLazy)
|
||||
[(id)_attributesUsedForLocking gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 26;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"subEntities gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_subEntities gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 27;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"dbSnapshotKeys gcIncrementRefCountOfContainedObjects");
|
||||
[(id)_dbSnapshotKeys gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 28;
|
||||
EOFLOGObjectLevel(@"EOEntity", @"_parent gcIncrementRefCountOfContainedObjects");
|
||||
[_parent gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
where = 29;
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"====>WHERE=%d %@ (%@)", where, localException,
|
||||
[localException reason]);
|
||||
NSDebugMLog(@"attributes gcIncrementRefCountOfContainedObjects=%@",
|
||||
[_attributes class]);
|
||||
NSDebugMLog(@"_attributes classes %@",
|
||||
[_attributes resultsOfPerformingSelector: @selector(class)]);
|
||||
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
[_debugSet removeObject: @"gsdb"];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
NSMutableDictionary *plist;
|
||||
|
@ -952,8 +655,8 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
DESTROY(_attributes);
|
||||
DESTROY(_attributesByName);
|
||||
|
||||
_attributes = [GCMutableArray new];
|
||||
_attributesByName = [GCMutableDictionary new];
|
||||
_attributes = [NSMutableArray new];
|
||||
_attributesByName = [NSMutableDictionary new];
|
||||
|
||||
NSAssert2((!_attributesByName
|
||||
|| [_attributesByName isKindOfClass: GDL2_NSDictionaryClass]),
|
||||
|
@ -1209,8 +912,8 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
|
||||
DESTROY(_relationshipsByName);
|
||||
|
||||
_relationships = [GCMutableArray new];
|
||||
_relationshipsByName = [GCMutableDictionary new];
|
||||
_relationships = [NSMutableArray new];
|
||||
_relationshipsByName = [NSMutableDictionary new];
|
||||
|
||||
if (!_flags.attributesIsLazy)
|
||||
{
|
||||
|
@ -1409,7 +1112,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
NSArray *classPropertiesList = _classProperties;
|
||||
int i;
|
||||
|
||||
_classProperties = [GCMutableArray new];
|
||||
_classProperties = [NSMutableArray new];
|
||||
_flags.classPropertiesIsLazy = NO;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
|
@ -1523,7 +1226,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
int i = 0;
|
||||
NSArray *primaryKeyAttributes = _primaryKeyAttributes;
|
||||
|
||||
_primaryKeyAttributes = [GCMutableArray new];
|
||||
_primaryKeyAttributes = [NSMutableArray new];
|
||||
_flags.primaryKeyAttributesIsLazy = NO;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
|
@ -1589,7 +1292,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
|
|||
int i = 0;
|
||||
NSArray *attributesUsedForLocking = _attributesUsedForLocking;
|
||||
|
||||
_attributesUsedForLocking = [GCMutableArray new];
|
||||
_attributesUsedForLocking = [NSMutableArray new];
|
||||
_flags.attributesUsedForLockingIsLazy = NO;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
|
@ -1990,7 +1693,7 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
|
||||
if (_attributesByName == nil)
|
||||
{
|
||||
_attributesByName = [GCMutableDictionary new];
|
||||
_attributesByName = [NSMutableDictionary new];
|
||||
}
|
||||
[_attributesByName setObject: attribute forKey: attributeName];
|
||||
|
||||
|
@ -2024,29 +1727,29 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
else
|
||||
{
|
||||
_attributes
|
||||
= [[GCMutableArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
= [[NSMutableArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
copyItems:NO];
|
||||
[_attributes removeObject: attribute];
|
||||
_attributes
|
||||
= [[GCArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
= [[NSArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
copyItems:NO];
|
||||
if ([_classProperties containsObject:attribute])
|
||||
{
|
||||
_classProperties = [[GCMutableArray alloc]
|
||||
_classProperties = [[NSMutableArray alloc]
|
||||
initWithArray:AUTORELEASE(_classProperties)
|
||||
copyItems:NO];
|
||||
[_classProperties removeObject: attribute];
|
||||
_classProperties = [[GCArray alloc]
|
||||
_classProperties = [[NSArray alloc]
|
||||
initWithArray:AUTORELEASE(_classProperties)
|
||||
copyItems:NO];
|
||||
}
|
||||
if ([_primaryKeyAttributes containsObject:attribute])
|
||||
{
|
||||
_primaryKeyAttributes = [[GCMutableArray alloc]
|
||||
_primaryKeyAttributes = [[NSMutableArray alloc]
|
||||
initWithArray:AUTORELEASE(_primaryKeyAttributes)
|
||||
copyItems:NO];
|
||||
[_primaryKeyAttributes removeObject: attribute];
|
||||
_primaryKeyAttributes = [[GCArray alloc]
|
||||
_primaryKeyAttributes = [[NSArray alloc]
|
||||
initWithArray:AUTORELEASE(_primaryKeyAttributes)
|
||||
copyItems:NO];
|
||||
}
|
||||
|
@ -2089,7 +1792,7 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
|
||||
if (_relationshipsByName == nil)
|
||||
{
|
||||
_relationshipsByName = [GCMutableDictionary new];
|
||||
_relationshipsByName = [NSMutableDictionary new];
|
||||
}
|
||||
[_relationshipsByName setObject: relationship forKey: relationshipName];
|
||||
|
||||
|
@ -2124,17 +1827,17 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
else
|
||||
{
|
||||
_relationships
|
||||
= [[GCMutableArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
= [[NSMutableArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
copyItems:NO];
|
||||
[_relationships removeObject: relationship];
|
||||
_relationships
|
||||
= [[GCArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
= [[NSArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
copyItems:NO];
|
||||
_classProperties = [[GCMutableArray alloc]
|
||||
_classProperties = [[NSMutableArray alloc]
|
||||
initWithArray:AUTORELEASE(_classProperties)
|
||||
copyItems:NO];
|
||||
[_classProperties removeObject: relationship];
|
||||
_classProperties = [[GCArray alloc]
|
||||
_classProperties = [[NSArray alloc]
|
||||
initWithArray:AUTORELEASE(_classProperties)
|
||||
copyItems:NO];
|
||||
}
|
||||
|
@ -2215,11 +1918,8 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
|
||||
[self willChange];
|
||||
DESTROY(_classProperties);
|
||||
if ([properties isKindOfClass:[GCArray class]]
|
||||
|| [properties isKindOfClass: [GCMutableArray class]])
|
||||
_classProperties = [[GCMutableArray alloc] initWithArray: properties];
|
||||
else
|
||||
_classProperties = [[GCMutableArray alloc] initWithArray: properties]; //TODO
|
||||
|
||||
_classProperties = [[NSMutableArray alloc] initWithArray: properties]; //TODO
|
||||
|
||||
[self _setIsEdited]; //To clean cache
|
||||
|
||||
|
@ -2236,12 +1936,7 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
|
||||
[self willChange];
|
||||
DESTROY(_primaryKeyAttributes);
|
||||
|
||||
if ([keys isKindOfClass:[GCArray class]]
|
||||
|| [keys isKindOfClass: [GCMutableArray class]])
|
||||
_primaryKeyAttributes = [[GCMutableArray alloc] initWithArray: keys];
|
||||
else
|
||||
_primaryKeyAttributes = [[GCMutableArray alloc] initWithArray: keys]; // TODO
|
||||
_primaryKeyAttributes = [[NSMutableArray alloc] initWithArray: keys]; // TODO
|
||||
|
||||
[self _setIsEdited];//To clean cache
|
||||
|
||||
|
@ -2259,12 +1954,7 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
[self willChange];
|
||||
DESTROY(_attributesUsedForLocking);
|
||||
|
||||
if ([attributes isKindOfClass: [GCArray class]] // TODO
|
||||
|| [attributes isKindOfClass: [GCMutableArray class]])
|
||||
_attributesUsedForLocking = [[GCMutableArray alloc]
|
||||
initWithArray: attributes];
|
||||
else
|
||||
_attributesUsedForLocking = [[GCMutableArray alloc]
|
||||
_attributesUsedForLocking = [[NSMutableArray alloc]
|
||||
initWithArray: attributes];
|
||||
|
||||
[self _setIsEdited]; //To clean cache
|
||||
|
@ -2656,19 +2346,19 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
if (_flags.createsMutableObjects)
|
||||
{
|
||||
_attributes
|
||||
= [[GCMutableArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
= [[NSMutableArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
copyItems:NO];
|
||||
_relationships
|
||||
= [[GCMutableArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
= [[NSMutableArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
copyItems:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
_attributes
|
||||
= [[GCArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
= [[NSArray alloc] initWithArray:AUTORELEASE(_attributes)
|
||||
copyItems:NO];
|
||||
_relationships
|
||||
= [[GCArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
= [[NSArray alloc] initWithArray:AUTORELEASE(_relationships)
|
||||
copyItems:NO];
|
||||
}
|
||||
|
||||
|
@ -3403,7 +3093,7 @@ returns nil if there's no key in the instanceDictionaryInitializer
|
|||
{
|
||||
NSArray *attributesToFetch = [self _attributesToFetch];
|
||||
int i, count = [attributesToFetch count];
|
||||
NSMutableArray *attributesToSave = [GCMutableArray arrayWithCapacity:count];
|
||||
NSMutableArray *attributesToSave = [NSMutableArray arrayWithCapacity:count];
|
||||
|
||||
NSAssert3(!attributesToFetch
|
||||
|| [attributesToFetch isKindOfClass: [NSArray class]],
|
||||
|
@ -3458,7 +3148,7 @@ returns nil if there's no key in the instanceDictionaryInitializer
|
|||
[self classProperties],
|
||||
[self relationships] };
|
||||
|
||||
_attributesToFetch = RETAIN([GCMutableArray array]);
|
||||
_attributesToFetch = RETAIN([NSMutableArray array]);
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EOEntity", @"Entity %@ - _attributesToFetch %p [RC=%d]:%@",
|
||||
[self name],
|
||||
|
@ -3937,7 +3627,7 @@ toDestinationAttributeInLastComponentOfRelationshipPath: (NSString *)path
|
|||
NSArray *classProperties = [self classProperties];
|
||||
int count = [classProperties count];
|
||||
|
||||
_classPropertyAttributeNames = [NSMutableArray new]; //or GC ?
|
||||
_classPropertyAttributeNames = [NSMutableArray new];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -3964,7 +3654,7 @@ toDestinationAttributeInLastComponentOfRelationshipPath: (NSString *)path
|
|||
int i, count = [classProperties count];
|
||||
Class relClass = [EORelationship class];
|
||||
|
||||
_classPropertyToManyRelationshipNames = [NSMutableArray new]; //or GC ?
|
||||
_classPropertyToManyRelationshipNames = [NSMutableArray new];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -4069,7 +3759,7 @@ toDestinationAttributeInLastComponentOfRelationshipPath: (NSString *)path
|
|||
attributesToFetch);
|
||||
|
||||
ASSIGN(_dbSnapshotKeys,
|
||||
[GCArray arrayWithArray: [attributesToFetch
|
||||
[NSArray arrayWithArray: [attributesToFetch
|
||||
resultsOfPerformingSelector:
|
||||
@selector(name)]]);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
|
||||
@class NSArray;
|
||||
|
||||
@class EOAttribute;
|
||||
|
@ -52,13 +49,14 @@
|
|||
@end
|
||||
|
||||
|
||||
@interface EOExpressionArray : GCMutableArray
|
||||
@interface EOExpressionArray : NSMutableArray
|
||||
{
|
||||
NSString *_prefix;
|
||||
NSString *_infix;
|
||||
NSString *_suffix;
|
||||
// NSString *_definition; it's rebuilt
|
||||
EOAttribute *_realAttribute;
|
||||
void *_contents;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -57,6 +57,9 @@ RCS_ID("$Id$")
|
|||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#endif
|
||||
|
||||
#define GSI_ARRAY_TYPES GSUNION_OBJ
|
||||
#include <GNUstepBase/GSIArray.h>
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
||||
#include <EOAccess/EOEntity.h>
|
||||
|
@ -64,17 +67,18 @@ RCS_ID("$Id$")
|
|||
#include <EOAccess/EORelationship.h>
|
||||
|
||||
|
||||
static SEL eqSel;
|
||||
|
||||
@interface EOExpressionArray (PrivateExceptions)
|
||||
- (void) _raiseRangeExceptionWithIndex:(unsigned) index from:(SEL)selector;
|
||||
@end
|
||||
|
||||
|
||||
@implementation EOExpressionArray
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
static BOOL initialized = NO;
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = YES;
|
||||
GSObjCAddClassBehavior(self, [GCArray class]);
|
||||
}
|
||||
eqSel = NSSelectorFromString(@"isEqual:");
|
||||
}
|
||||
|
||||
+ (EOExpressionArray*)expressionArray
|
||||
|
@ -82,17 +86,48 @@ RCS_ID("$Id$")
|
|||
return [[self new] autorelease];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
DESTROY(_realAttribute); //TODO mettere nei metodi GC
|
||||
// DESTROY(_definition);
|
||||
DESTROY(_prefix);
|
||||
DESTROY(_infix);
|
||||
DESTROY(_suffix);
|
||||
GSIArrayEmpty(_contents);
|
||||
NSZoneFree([self zone], _contents);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
self = [super init];
|
||||
self = [self initWithCapacity:0];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* designated initializer */
|
||||
- (id) initWithCapacity:(unsigned)capacity
|
||||
{
|
||||
self = [super init];
|
||||
_contents = NSZoneMalloc([self zone], sizeof(GSIArray_t));
|
||||
_contents = GSIArrayInitWithZoneAndCapacity(_contents, [self zone], capacity);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithObjects:(id *)objects count:(unsigned)count
|
||||
{
|
||||
int i;
|
||||
self = [self initWithCapacity:count];
|
||||
for (i = 0; i < count; i++)
|
||||
GSIArrayAddItem(_contents, (GSIArrayItem)objects[i]);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
+ (EOExpressionArray*)expressionArrayWithPrefix: (NSString *)prefix
|
||||
infix: (NSString *)infix
|
||||
suffix: (NSString *)suffix
|
||||
|
@ -120,17 +155,6 @@ RCS_ID("$Id$")
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
DESTROY(_realAttribute); //TODO mettere nei metodi GC
|
||||
// DESTROY(_definition);
|
||||
DESTROY(_prefix);
|
||||
DESTROY(_infix);
|
||||
DESTROY(_suffix);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)referencesObject: (id)anObject
|
||||
{
|
||||
return [self indexOfObject: anObject] != NSNotFound;
|
||||
|
@ -358,6 +382,133 @@ if it's a string return NO
|
|||
|
||||
return value;
|
||||
}
|
||||
|
||||
/* These are *this* subclasses responsibility */
|
||||
- (unsigned) count
|
||||
{
|
||||
return GSIArrayCount(_contents);
|
||||
}
|
||||
|
||||
- (id) objectAtIndex:(unsigned) index
|
||||
{
|
||||
if (index >= GSIArrayCount(_contents))
|
||||
[self _raiseRangeExceptionWithIndex:index from:_cmd];
|
||||
|
||||
return GSIArrayItemAtIndex(_contents, index).obj;
|
||||
}
|
||||
|
||||
- (void) addObject:(id)object
|
||||
{
|
||||
if (object == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to add nil to an array"];
|
||||
return;
|
||||
}
|
||||
|
||||
GSIArrayAddItem(_contents, (GSIArrayItem)object);
|
||||
}
|
||||
|
||||
- (void) replaceObjectAtIndex:(unsigned)index withObject:(id)object
|
||||
{
|
||||
if (object == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to add nil to an array"];
|
||||
return;
|
||||
}
|
||||
else if (index >= GSIArrayCount(_contents))
|
||||
{
|
||||
[self _raiseRangeExceptionWithIndex:index from:_cmd];
|
||||
return;
|
||||
}
|
||||
|
||||
GSIArraySetItemAtIndex(_contents, (GSIArrayItem)object, index);
|
||||
}
|
||||
|
||||
- (void) insertObject:(id)object atIndex:(unsigned)index
|
||||
{
|
||||
if (object == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to add nil to an array"];
|
||||
return;
|
||||
}
|
||||
else if (index >= GSIArrayCount(_contents))
|
||||
{
|
||||
[self _raiseRangeExceptionWithIndex:index from:_cmd];
|
||||
}
|
||||
|
||||
GSIArrayInsertItem(_contents, (GSIArrayItem)object, index);
|
||||
}
|
||||
|
||||
- (void) removeObjectAtIndex:(unsigned)index
|
||||
{
|
||||
if (index >= GSIArrayCount(_contents))
|
||||
{
|
||||
[self _raiseRangeExceptionWithIndex:index from:_cmd];
|
||||
}
|
||||
GSIArrayRemoveItemAtIndex(_contents, index);
|
||||
}
|
||||
|
||||
- (void) removeAllObjects
|
||||
{
|
||||
GSIArrayRemoveAllItems(_contents);
|
||||
}
|
||||
|
||||
/* might as well also implement because we can do it faster */
|
||||
- (id) lastObject
|
||||
{
|
||||
return GSIArrayLastItem(_contents).obj;
|
||||
}
|
||||
|
||||
- (id) firstObject
|
||||
{
|
||||
if (GSIArrayCount(_contents) == 0)
|
||||
return nil;
|
||||
return GSIArrayItemAtIndex(_contents, 0).obj;
|
||||
}
|
||||
|
||||
/* not only make it faster but work around for old buggy implementations of
|
||||
* NSArray in gnustep with an extra release */
|
||||
- (void) removeObject:(id)anObject
|
||||
{
|
||||
int index = GSIArrayCount(_contents);
|
||||
BOOL (*eq)(id,SEL,id)
|
||||
= (BOOL (*)(id, SEL, id))[anObject methodForSelector:eqSel];
|
||||
|
||||
/* iterate backwards, so that all objects equal to 'anObject'
|
||||
* can safely be removed from the array while iterating. */
|
||||
while (index-- > 0)
|
||||
{
|
||||
if ((*eq)(anObject, eqSel, GSIArrayItemAtIndex(_contents, index).obj))
|
||||
{
|
||||
GSIArrayRemoveItemAtIndex(_contents, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* private methods. */
|
||||
- (void) _raiseRangeExceptionWithIndex: (unsigned)index from: (SEL)sel
|
||||
{
|
||||
NSDictionary *info;
|
||||
NSException *exception;
|
||||
NSString *reason;
|
||||
unsigned count = GSIArrayCount(_contents);
|
||||
|
||||
info = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithUnsignedInt: index], @"Index",
|
||||
[NSNumber numberWithUnsignedInt: count], @"Count",
|
||||
self, @"Array", nil, nil];
|
||||
|
||||
reason = [NSString stringWithFormat: @"Index %d is out of range %d (in '%@')", index, count, NSStringFromSelector(sel)];
|
||||
|
||||
exception = [NSException exceptionWithName: NSRangeException
|
||||
reason: reason
|
||||
userInfo: info];
|
||||
[exception raise];
|
||||
}
|
||||
|
||||
@end /* EOExpressionArray */
|
||||
|
||||
|
||||
|
|
|
@ -27,16 +27,13 @@
|
|||
#ifndef __EOJoin_h__
|
||||
#define __EOJoin_h__
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
|
||||
@class NSString;
|
||||
|
||||
@class EOEntity;
|
||||
@class EOAttribute;
|
||||
|
||||
|
||||
@interface EOJoin : GCObject
|
||||
@interface EOJoin : NSObject
|
||||
{
|
||||
/* Garbage collectable objects */
|
||||
EOAttribute *_sourceAttribute;
|
||||
|
|
|
@ -72,13 +72,8 @@ RCS_ID("$Id$")
|
|||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
if (!source || !destination)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ -- %@ 0x%x: source and destination attributes can't be nil",
|
||||
NSStringFromSelector(_cmd),
|
||||
NSStringFromClass([self class]),
|
||||
self];
|
||||
|
||||
NSAssert((source && destination),
|
||||
@"Source and destination attributes cannot be nil");
|
||||
ASSIGN(_sourceAttribute, source);
|
||||
ASSIGN(_destinationAttribute, destination);
|
||||
}
|
||||
|
@ -86,34 +81,6 @@ RCS_ID("$Id$")
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevel(@"gsdb", @"sourceAttribute gcDecrementRefCount");
|
||||
|
||||
[_sourceAttribute gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"destinationAttribute gcDecrementRefCount");
|
||||
|
||||
[_destinationAttribute gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
[_sourceAttribute gcIncrementRefCount];
|
||||
[_destinationAttribute gcIncrementRefCount];
|
||||
|
||||
[_sourceAttribute gcIncrementRefCountOfContainedObjects];
|
||||
[_destinationAttribute gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (unsigned)hash
|
||||
{
|
||||
return [_sourceAttribute hash];
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOAccess/EODefines.h>
|
||||
#include <EOAccess/EOPropertyListEncoding.h>
|
||||
|
@ -49,7 +48,7 @@
|
|||
@class EOStoredProcedure;
|
||||
|
||||
|
||||
@interface EOModel : GCObject
|
||||
@interface EOModel : NSObject
|
||||
{
|
||||
NSString *_name;
|
||||
NSString *_path;
|
||||
|
@ -65,11 +64,11 @@
|
|||
/* Garbage collectable objects */
|
||||
EOModelGroup *_group;
|
||||
|
||||
GCArray *_entities;
|
||||
GCMutableDictionary *_entitiesByName;
|
||||
GCMutableArray *_storedProcedures;
|
||||
GCMutableDictionary *_subEntitiesCache;
|
||||
//GCMutableDictionary *_prototypesByName;
|
||||
NSArray *_entities;
|
||||
NSMutableDictionary *_entitiesByName;
|
||||
NSMutableArray *_storedProcedures;
|
||||
NSMutableDictionary *_subEntitiesCache;
|
||||
//NSMutableDictionary *_prototypesByName;
|
||||
struct
|
||||
{
|
||||
BOOL createsMutableObjects:1;
|
||||
|
|
|
@ -211,12 +211,12 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
_version = DEFAULT_MODEL_VERSION;
|
||||
_flags.createsMutableObjects = YES;
|
||||
|
||||
_entitiesByName = [GCMutableDictionary new];
|
||||
_entitiesByName = [NSMutableDictionary new];
|
||||
_entitiesByClass = NSCreateMapTableWithZone(NSObjectMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks,
|
||||
8,
|
||||
[self zone]);
|
||||
_storedProcedures = [GCMutableArray new];
|
||||
_storedProcedures = [NSMutableArray new];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
|
@ -254,7 +254,9 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
NSFreeMapTable(_entitiesByClass);
|
||||
_entitiesByClass = NULL;
|
||||
}
|
||||
|
||||
DESTROY(_storedProcedures);
|
||||
DESTROY(_entitiesByName);
|
||||
DESTROY(_entities);
|
||||
DESTROY(_name);
|
||||
DESTROY(_path);
|
||||
DESTROY(_adaptorName);
|
||||
|
@ -266,47 +268,6 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
[(id)_group gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"entities gcDecrementRefCount");
|
||||
|
||||
[(id)_entities gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"entitiesByName gcDecrementRefCount");
|
||||
|
||||
[(id)_entitiesByName gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"storedProcedures gcDecrementRefCount");
|
||||
|
||||
[(id)_storedProcedures gcDecrementRefCount];
|
||||
EOFLOGObjectLevel(@"gsdb", @"subEntitiesCache gcDecrementRefCount");
|
||||
|
||||
[(id)_subEntitiesCache gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL) gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
[(id)_group gcIncrementRefCount];
|
||||
[(id)_entities gcIncrementRefCount];
|
||||
[(id)_entitiesByName gcIncrementRefCount];
|
||||
[(id)_storedProcedures gcIncrementRefCount];
|
||||
[(id)_subEntitiesCache gcIncrementRefCount];
|
||||
|
||||
[(id)_group gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_entities gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_entitiesByName gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_storedProcedures gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_subEntitiesCache gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSString*) path
|
||||
{
|
||||
return _path;
|
||||
|
@ -1482,10 +1443,10 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
[self willChange];
|
||||
/* Do not access _entities until cache is triggered */
|
||||
if ([self createsMutableObjects])
|
||||
[(GCMutableArray *)[self entities] addObject: entity];
|
||||
[(NSMutableArray *)[self entities] addObject: entity];
|
||||
else
|
||||
{
|
||||
id e = [GCMutableArray arrayWithArray: [self entities]];
|
||||
id e = [NSMutableArray arrayWithArray: [self entities]];
|
||||
|
||||
[e addObject: entity];
|
||||
ASSIGNCOPY(_entities, e);
|
||||
|
@ -1523,10 +1484,10 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
|
||||
/* Do not access _entities until cache is triggered */
|
||||
if ([self createsMutableObjects])
|
||||
[(GCMutableArray *)[self entities] removeObject: entity];
|
||||
[(NSMutableArray *)[self entities] removeObject: entity];
|
||||
else
|
||||
{
|
||||
id e = [GCMutableArray arrayWithArray: [self entities]];
|
||||
id e = [NSMutableArray arrayWithArray: [self entities]];
|
||||
|
||||
[e removeObject: entity];
|
||||
ASSIGNCOPY(_entities, e);
|
||||
|
@ -1551,14 +1512,10 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
NSAssert(_storedProcedures, @"Uninitialised _storedProcedures!");
|
||||
[self willChange];
|
||||
if ([self createsMutableObjects])
|
||||
[(GCMutableArray *)_storedProcedures addObject: storedProcedure];
|
||||
[(NSMutableArray *)_storedProcedures addObject: storedProcedure];
|
||||
else
|
||||
{
|
||||
NSMutableArray *mCopy = AUTORELEASE([_storedProcedures mutableCopy]);
|
||||
[mCopy removeObject: storedProcedure];
|
||||
mCopy = AUTORELEASE([[GCArray alloc] initWithArray: mCopy
|
||||
copyItems: NO]);
|
||||
ASSIGN(_storedProcedures, mCopy);
|
||||
_storedProcedures = RETAIN([AUTORELEASE(_storedProcedures) arrayByAddingObject:storedProcedure]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1568,12 +1525,12 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
|
||||
[self willChange];
|
||||
if ([self createsMutableObjects])
|
||||
[(GCMutableArray *)_storedProcedures removeObject: storedProcedure];
|
||||
[(NSMutableArray *)_storedProcedures removeObject: storedProcedure];
|
||||
else
|
||||
{
|
||||
NSMutableArray *mCopy = AUTORELEASE([_storedProcedures mutableCopy]);
|
||||
[mCopy removeObject: storedProcedure];
|
||||
mCopy = AUTORELEASE([[GCArray alloc] initWithArray: mCopy
|
||||
mCopy = AUTORELEASE([[NSArray alloc] initWithArray: mCopy
|
||||
copyItems: NO]);
|
||||
ASSIGN(_storedProcedures, mCopy);
|
||||
}
|
||||
|
@ -1792,12 +1749,12 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
/* Do not access _entities until cache is triggered */
|
||||
if (_flags.createsMutableObjects)
|
||||
{
|
||||
entityArray = [[GCMutableArray alloc] initWithArray: entityArray
|
||||
entityArray = [[NSMutableArray alloc] initWithArray: entityArray
|
||||
copyItems:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
entityArray = [[GCArray alloc] initWithArray: entityArray
|
||||
entityArray = [[NSArray alloc] initWithArray: entityArray
|
||||
copyItems:NO];
|
||||
}
|
||||
ASSIGN(_entities, entityArray);
|
||||
|
@ -1901,12 +1858,12 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
NSString *className;
|
||||
unsigned int i,c;
|
||||
|
||||
DESTROY(_entitiesByName);
|
||||
DESTROY(_subEntitiesCache);
|
||||
NSResetMapTable(_entitiesByClass);
|
||||
|
||||
names = [_entities valueForKey: @"name"];
|
||||
_entitiesByName = [[GCMutableDictionary alloc] initWithObjects: _entities
|
||||
DESTROY(_entitiesByName);
|
||||
_entitiesByName = [[NSMutableDictionary alloc] initWithObjects: _entities
|
||||
forKeys: names];
|
||||
for (i = 0, c = [_entities count]; i < c; i++)
|
||||
{
|
||||
|
@ -1916,3 +1873,4 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
}
|
||||
}
|
||||
@end /* EOModel (EOModelPrivate) */
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#ifndef __EOModelGroup_h__
|
||||
#define __EOModelGroup_h__
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOControl/EOObjectStoreCoordinator.h>
|
||||
|
||||
#include <EOAccess/EODefines.h>
|
||||
|
@ -48,7 +46,7 @@
|
|||
@class EOFetchSpecification;
|
||||
|
||||
|
||||
@interface EOModelGroup : GCObject
|
||||
@interface EOModelGroup : NSObject
|
||||
{
|
||||
NSMutableDictionary *_modelsByName;
|
||||
id _delegate;
|
||||
|
|
|
@ -202,20 +202,6 @@ of the mainBundle, and all bundles and frameworks loaded into the app.
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSArray *)models
|
||||
{
|
||||
return [_modelsByName allValues];
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#ifndef __EORelationship_h__
|
||||
#define __EORelationship_h__
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOControl/EOClassDescription.h>
|
||||
|
||||
#include <EOAccess/EOJoin.h>
|
||||
|
@ -58,7 +56,7 @@ typedef enum {
|
|||
} EOJoinSemantic;
|
||||
|
||||
|
||||
@interface EORelationship : GCObject <EOPropertyListEncoding>
|
||||
@interface EORelationship : NSObject <EOPropertyListEncoding>
|
||||
{
|
||||
NSString *_name;
|
||||
EOQualifier *_qualifier;
|
||||
|
@ -90,14 +88,14 @@ typedef enum {
|
|||
EORelationship *_inverseRelationship;
|
||||
EORelationship *_hiddenInverseRelationship;
|
||||
|
||||
EOEntity *_entity;
|
||||
EOEntity *_destination;
|
||||
GCMutableArray *_joins;
|
||||
EOEntity *_entity; // unretained
|
||||
EOEntity *_destination; // unretained
|
||||
NSMutableArray *_joins;
|
||||
|
||||
/* Computed values */
|
||||
GCArray *_sourceAttributes;
|
||||
GCArray *_destinationAttributes;
|
||||
GCMutableArray *_componentRelationships;//Used ????
|
||||
NSArray *_sourceAttributes;
|
||||
NSArray *_destinationAttributes;
|
||||
NSMutableArray *_componentRelationships;//Used ????
|
||||
}
|
||||
|
||||
+ (id)relationshipWithPropertyList: (NSDictionary *)propertyList
|
||||
|
|
|
@ -122,82 +122,6 @@ RCS_ID("$Id$")
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"self=%@", self);
|
||||
|
||||
EOFLOGObjectLevel(@"EORelationship",
|
||||
@"definitionArray gcDecrementRefCount");
|
||||
[(id)_definitionArray gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevel(@"EORelationship",
|
||||
@"_inverseRelationship gcDecrementRefCount");
|
||||
[_inverseRelationship gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevel(@"EORelationship",
|
||||
@"_hiddenInverseRelationship gcDecrementRefCount");
|
||||
[_hiddenInverseRelationship gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevel(@"EORelationship", @"_entity gcDecrementRefCount");
|
||||
[_entity gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevel(@"EORelationship",
|
||||
@"_destination gcDecrementRefCount");
|
||||
[_destination gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship",
|
||||
@"_joins %p gcDecrementRefCount (class=%@)",
|
||||
_joins, [_joins class]);
|
||||
[(id)_joins gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship",
|
||||
@"_sourceAttributes gcDecrementRefCount (class=%@)",
|
||||
[_sourceAttributes class]);
|
||||
[(id)_sourceAttributes gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship",
|
||||
@"_destinationAttributes gcDecrementRefCount (class=%@)",
|
||||
[_destinationAttributes class]);
|
||||
[(id)_destinationAttributes gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship",
|
||||
@"_componentRelationships gcDecrementRefCount (class=%@)",
|
||||
[_componentRelationships class]);
|
||||
[(id)_componentRelationships gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
[(id)_definitionArray gcIncrementRefCount];
|
||||
[_inverseRelationship gcIncrementRefCount];
|
||||
[_hiddenInverseRelationship gcIncrementRefCount];
|
||||
[_entity gcIncrementRefCount];
|
||||
[_destination gcIncrementRefCount];
|
||||
[(id)_joins gcIncrementRefCount];
|
||||
[(id)_sourceAttributes gcIncrementRefCount];
|
||||
[(id)_destinationAttributes gcIncrementRefCount];
|
||||
[(id)_componentRelationships gcIncrementRefCount];
|
||||
|
||||
[(id)_definitionArray gcIncrementRefCountOfContainedObjects];
|
||||
[_inverseRelationship gcIncrementRefCountOfContainedObjects];
|
||||
[_hiddenInverseRelationship gcIncrementRefCountOfContainedObjects];
|
||||
[_entity gcIncrementRefCountOfContainedObjects];
|
||||
[_destination gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_joins gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_sourceAttributes gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_destinationAttributes gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_componentRelationships gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (unsigned)hash
|
||||
{
|
||||
return [_name hash];
|
||||
|
@ -230,7 +154,7 @@ RCS_ID("$Id$")
|
|||
if (destinationEntityName) //If not, this is because it's a definition
|
||||
{
|
||||
destinationEntity = [model entityNamed: destinationEntityName];
|
||||
ASSIGN(_destination, destinationEntity);
|
||||
_destination = destinationEntity;
|
||||
}
|
||||
|
||||
[self setToMany: [[propertyList objectForKey: @"isToMany"]
|
||||
|
@ -683,12 +607,12 @@ to know what to-many mean :-) **/
|
|||
{
|
||||
int i, count = [_joins count];
|
||||
|
||||
_sourceAttributes = [GCMutableArray new];
|
||||
_sourceAttributes = [NSMutableArray new];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
EOJoin *join = [_joins objectAtIndex: i];
|
||||
[(GCMutableArray*)_sourceAttributes addObject:
|
||||
[(NSMutableArray*)_sourceAttributes addObject:
|
||||
[join sourceAttribute]];
|
||||
}
|
||||
}
|
||||
|
@ -703,13 +627,13 @@ to know what to-many mean :-) **/
|
|||
{
|
||||
int i, count = [_joins count];
|
||||
|
||||
_destinationAttributes = [GCMutableArray new];
|
||||
_destinationAttributes = [NSMutableArray new];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
EOJoin *join = [_joins objectAtIndex: i];
|
||||
|
||||
[(GCMutableArray*)_destinationAttributes addObject:
|
||||
[(NSMutableArray *)_destinationAttributes addObject:
|
||||
[join destinationAttribute]];
|
||||
}
|
||||
}
|
||||
|
@ -1340,7 +1264,7 @@ relationships. Nil if none" **/
|
|||
EOFLOGObjectLevelArgs(@"EORelationship", @"_definitionArray=%@", _definitionArray);
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"[self definition]=%@", [self definition]);
|
||||
|
||||
DESTROY(_destination); //No ? Assign destination ?
|
||||
_destination = nil;
|
||||
|
||||
{
|
||||
//TODO VERIFY
|
||||
|
@ -1382,9 +1306,12 @@ relationships. Nil if none" **/
|
|||
{
|
||||
[self _flushCache];
|
||||
[self willChange];
|
||||
/* FIXME docs say we should... but currently -removeRelationship
|
||||
* calls us, so it would cause an infinite loop */
|
||||
// [_entity removeRelationship:self];
|
||||
[_entity _setIsEdited];
|
||||
[entity _setIsEdited];
|
||||
ASSIGN(_entity, entity);
|
||||
_entity = entity;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1559,15 +1486,13 @@ relationships. Nil if none" **/
|
|||
if ([self createsMutableObjects])
|
||||
{
|
||||
if (!_joins)
|
||||
_joins = [GCMutableArray new];
|
||||
_joins = [NSMutableArray new];
|
||||
|
||||
[(GCMutableArray *)_joins addObject: join];
|
||||
[(NSMutableArray *)_joins addObject: join];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"XXjoins %p class%@",
|
||||
_joins, [_joins class]);
|
||||
|
||||
//NO: will be recomputed [(GCMutableArray *)_sourceAttributes addObject:[join sourceAttribute]];
|
||||
//NO: will be recomputed [(GCMutableArray *)_destinationAttributes addObject:[join destinationAttribute]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1575,7 +1500,7 @@ relationships. Nil if none" **/
|
|||
_joins = RETAIN([[_joins autorelease]
|
||||
arrayByAddingObject: join]);
|
||||
else
|
||||
_joins = RETAIN([GCArray arrayWithObject: join]);
|
||||
_joins = RETAIN([NSArray arrayWithObject: join]);
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"XXjoins %p class%@",
|
||||
_joins, [_joins class]);
|
||||
|
@ -1619,7 +1544,7 @@ relationships. Nil if none" **/
|
|||
[self willChange];
|
||||
if ([self createsMutableObjects])
|
||||
{
|
||||
[(GCMutableArray *)_joins removeObject: join];
|
||||
[(NSMutableArray *)_joins removeObject: join];
|
||||
|
||||
/*NO: will be recomputed [(GCMutableArray *)_sourceAttributes
|
||||
removeObject:[join sourceAttribute]];
|
||||
|
@ -1632,9 +1557,9 @@ relationships. Nil if none" **/
|
|||
}
|
||||
else
|
||||
{
|
||||
GCMutableArray *ma = [_joins mutableCopy];
|
||||
GCArray *a = (GCArray *)_joins;
|
||||
|
||||
NSMutableArray *ma = [_joins mutableCopy];
|
||||
NSArray *a = _joins;
|
||||
|
||||
[ma removeObject: join];
|
||||
_joins = ma;
|
||||
[a release];
|
||||
|
@ -1810,7 +1735,7 @@ becomes "name", and "FIRST_NAME" becomes "firstName".*/
|
|||
}
|
||||
else
|
||||
{
|
||||
_joins = [[GCArray alloc] initWithArray:[_joins autorelease] copyItems:NO];
|
||||
_joins = [[NSArray alloc] initWithArray:[_joins autorelease] copyItems:NO];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship", @"XXjoins %p class%@",
|
||||
_joins, [_joins class]);
|
||||
|
@ -2445,12 +2370,12 @@ dst entity primaryKeyAttributeNames
|
|||
EOAttribute *destinationAttribute = [join destinationAttribute];
|
||||
EOEntity *destinationEntity = [destinationAttribute entity];
|
||||
|
||||
ASSIGN(_destination, destinationEntity);
|
||||
_destination = destinationEntity;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DESTROY(_destination);
|
||||
_destination = nil;
|
||||
}
|
||||
//_joins count
|
||||
//[self notImplemented:_cmd]; // TODO-NOW
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#ifndef __EOStoredProcedure_h__
|
||||
#define __EOStoredProcedure_h__
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOAccess/EOPropertyListEncoding.h>
|
||||
|
||||
|
||||
|
@ -39,7 +37,7 @@
|
|||
@class EOStoredProcedure;
|
||||
|
||||
|
||||
@interface EOStoredProcedure : GCObject <EOPropertyListEncoding>
|
||||
@interface EOStoredProcedure : NSObject <EOPropertyListEncoding>
|
||||
{
|
||||
NSString *_name;
|
||||
NSString *_externalName;
|
||||
|
@ -48,7 +46,7 @@
|
|||
|
||||
/* Garbage collectable objects */
|
||||
EOModel *_model;
|
||||
GCArray *_arguments;
|
||||
NSArray *_arguments;
|
||||
}
|
||||
|
||||
+ (EOStoredProcedure *)storedProcedureWithPropertyList: (NSDictionary *)propertyList
|
||||
|
|
|
@ -39,6 +39,7 @@ RCS_ID("$Id$")
|
|||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
@ -47,8 +48,6 @@ RCS_ID("$Id$")
|
|||
#include <GNUstepBase/GNUstep.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
#include <EOControl/EOObserver.h>
|
||||
|
||||
|
@ -70,32 +69,6 @@ RCS_ID("$Id$")
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
EOFLOGObjectLevel(@"gsdb", @"model gcDecrementRefCount");
|
||||
|
||||
[(id)_model gcDecrementRefCount];
|
||||
[(id)_arguments gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
[(id)_model gcIncrementRefCount];
|
||||
[(id)_arguments gcIncrementRefCount];
|
||||
|
||||
[(id)_model gcIncrementRefCountOfContainedObjects];
|
||||
[(id)_arguments gcIncrementRefCountOfContainedObjects];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
+ (EOStoredProcedure *)storedProcedureWithPropertyList: (NSDictionary *)propertyList
|
||||
owner: (id)owner
|
||||
{
|
||||
|
@ -109,7 +82,7 @@ RCS_ID("$Id$")
|
|||
NSEnumerator *enumerator;
|
||||
id attributePList;
|
||||
|
||||
_model = RETAIN(owner);
|
||||
_model = owner;
|
||||
|
||||
[self setName: [propertyList objectForKey: @"name"]];
|
||||
[self setExternalName: [propertyList objectForKey: @"externalName"]];
|
||||
|
@ -121,7 +94,7 @@ RCS_ID("$Id$")
|
|||
array = [propertyList objectForKey:@"attributes"];
|
||||
if ([array count])
|
||||
{
|
||||
_arguments = [[GCMutableArray alloc] initWithCapacity: [array count]];
|
||||
_arguments = [[NSMutableArray alloc] initWithCapacity: [array count]];
|
||||
|
||||
enumerator = [array objectEnumerator];
|
||||
while ((attributePList = [enumerator nextObject]))
|
||||
|
@ -130,7 +103,7 @@ RCS_ID("$Id$")
|
|||
= [EOAttribute attributeWithPropertyList: attributePList
|
||||
owner: self];
|
||||
[attribute awakeWithPropertyList: attributePList];
|
||||
[(GCMutableArray *)_arguments addObject: attribute];
|
||||
[(NSMutableArray *)_arguments addObject: attribute];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,11 +209,7 @@ RCS_ID("$Id$")
|
|||
- (void)setArguments: (NSArray *)arguments
|
||||
{
|
||||
[self willChange];
|
||||
if ([arguments isKindOfClass: [GCArray class]]
|
||||
|| [arguments isKindOfClass: [GCMutableArray class]])
|
||||
ASSIGN(_arguments, arguments);
|
||||
else
|
||||
_arguments = [[GCArray alloc] initWithArray: arguments];
|
||||
ASSIGNCOPY(_arguments, arguments);
|
||||
}
|
||||
|
||||
- (void)setUserInfo: (NSDictionary *)dictionary
|
||||
|
|
|
@ -84,7 +84,7 @@ EOSchemaGeneration.h \
|
|||
EOUtilities.h \
|
||||
EODefines.h \
|
||||
EODeprecated.h \
|
||||
EOAccess.h \
|
||||
EOAccess.h
|
||||
|
||||
|
||||
DOCUMENT_NAME = EOAccess
|
||||
|
|
|
@ -588,8 +588,8 @@ static SEL eqSel;
|
|||
return GSIArrayItemAtIndex(_contents, 0).obj;
|
||||
}
|
||||
|
||||
/* not only make it faster but work around buggy implementations in gnustep
|
||||
* with an extra release */
|
||||
/* not only make it faster but work around for old buggy implementations of
|
||||
* NSArray in gnustep with an extra release */
|
||||
- (void) removeObject:(id)anObject
|
||||
{
|
||||
int index = GSIArrayCount(_contents);
|
||||
|
|
Loading…
Reference in a new issue