2002-11-15 22:57:05 +00:00
|
|
|
|
/**
|
|
|
|
|
EOAttribute.m <title>EOAttribute Class</title>
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
Author: Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
|
|
|
|
Date: February 2000
|
|
|
|
|
|
|
|
|
|
Author: Manuel Guesdon <mguesdon@orange-concept.com>
|
|
|
|
|
Date: October 2000
|
|
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
$Date$
|
|
|
|
|
|
|
|
|
|
<abstract></abstract>
|
|
|
|
|
|
|
|
|
|
This file is part of the GNUstep Database Library.
|
|
|
|
|
|
|
|
|
|
<license>
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
</license>
|
|
|
|
|
**/
|
|
|
|
|
|
2002-12-31 16:25:21 +00:00
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
RCS_ID("$Id$")
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2002-12-30 22:10:43 +00:00
|
|
|
|
#include <ctype.h>
|
2003-02-03 14:53:03 +00:00
|
|
|
|
#include <string.h>
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2004-03-19 16:41:21 +00:00
|
|
|
|
#ifdef GNUSTEP
|
2003-03-31 00:24:15 +00:00
|
|
|
|
#include <Foundation/NSUtilities.h>
|
|
|
|
|
#include <Foundation/NSArchiver.h>
|
|
|
|
|
#include <Foundation/NSObjCRuntime.h>
|
|
|
|
|
#include <Foundation/NSException.h>
|
|
|
|
|
#include <Foundation/NSTimeZone.h>
|
|
|
|
|
#include <Foundation/NSData.h>
|
|
|
|
|
#include <Foundation/NSInvocation.h>
|
|
|
|
|
#include <Foundation/NSDecimalNumber.h>
|
|
|
|
|
#include <Foundation/NSValue.h>
|
|
|
|
|
#include <Foundation/NSCalendarDate.h>
|
|
|
|
|
#include <Foundation/NSDebug.h>
|
|
|
|
|
#else
|
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-07-11 19:04:05 +00:00
|
|
|
|
#ifndef GNUSTEP
|
2003-08-25 20:01:59 +00:00
|
|
|
|
#include <GNUstepBase/GNUstep.h>
|
2004-01-31 13:57:38 +00:00
|
|
|
|
#include <GNUstepBase/GSObjCRuntime.h>
|
2004-01-29 13:23:22 +00:00
|
|
|
|
#include <GNUstepBase/GSCategories.h>
|
2003-07-11 19:04:05 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2003-03-31 00:24:15 +00:00
|
|
|
|
#include <EOControl/EONull.h>
|
|
|
|
|
#include <EOControl/EOObserver.h>
|
|
|
|
|
#include <EOControl/EODebug.h>
|
|
|
|
|
|
|
|
|
|
#include <EOAccess/EOModel.h>
|
|
|
|
|
#include <EOAccess/EOEntity.h>
|
|
|
|
|
#include <EOAccess/EOAttribute.h>
|
|
|
|
|
#include <EOAccess/EOStoredProcedure.h>
|
|
|
|
|
#include <EOAccess/EORelationship.h>
|
|
|
|
|
#include <EOAccess/EOExpressionArray.h>
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2002-12-31 16:25:21 +00:00
|
|
|
|
#include <string.h>
|
|
|
|
|
|
* EOControl/EOPriv.h/m: Split into...
* EOControl/EOPrivat.h/m: ... and ...
* EOAccess/EOPrivat.h/m: ... files.
* EOAccess/EOAdaptorChannel.m: Include new privat header.
* EOAccess/EOAttribute.m, EOAccess/EODatabase.m,
* EOAccess/EODatabaseChannel.m, EOAccess/EOEntity.m,
* EOAccess/EORelationship.m, EOAccess/EOSQLExpression.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m: Ditto.
(+initialize): Call new private function.
* EOAccess/EODatabaseContext.m: Ditto.
(EODatabaseContext_snapshotForGlobalIDWithImpPtr)
(EODatabaseContext_globalIDForObjectWithImpPtr): Move to
EOPrivate.m.
* EOAccess/EODatabaseContextPriv.h:
(EODatabaseContext_snapshotForGlobalIDWithImpPtr)
(EODatabaseContext_globalIDForObjectWithImpPtr): Move to
EOPrivate.h.
* EOAccess/GNUmakefile: Compile EOPrivate.m.
* EOControl/EOClassDescription.m, EOControl/EOGenericRecord.m
* EOControl/EOKeyGlobalID.m, EOControl/EOKeyValueCoding.m
* EOControl/EOKeyValueQualifier.m, EOControl/EONSAddOns.m
* EOControl/EOSortOrdering.m: Include new private header.
* EOControl/EOEditingContext.h/m: Ditto.
(EOEditingContext_objectForGlobalIDWithImpPtr)
(EOEditingContext_recordObjectGlobalIDWithImpPtr): Move to
EOPrivate.h/m.
* EOControl/EOMutableKnownKeyDictionary.h/m: Include new
private header.
(EOMKKD_objectForKeyWithImpPtr, EOMKKD_setObjectForKeyWithImpPtr)
(EOMKKD_removeObjectForKeyWithImpPtr, EOMKKD_hasKeyWithImpPtr)
(EOMKKD_indexForKeyWithImpPtr)
(EOMKKDInitializer_indexForKeyWithImpPtr): Move to EOPrivate.m
* EOControl/EOFault.m: (+isFault:): Update comment.
* EOControl/GNUmakefile: Build EOPrivate.m instead of EOPriv.m.
Do not install private header.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20759 72102866-910b-0410-8b05-ffd578937521
2005-02-20 10:52:57 +00:00
|
|
|
|
#include "EOPrivate.h"
|
2004-07-23 18:33:29 +00:00
|
|
|
|
#include "EOEntityPriv.h"
|
|
|
|
|
#include "EOAttributePriv.h"
|
|
|
|
|
|
2002-12-30 22:10:43 +00:00
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
@implementation EOAttribute
|
|
|
|
|
|
2004-05-15 12:52:48 +00:00
|
|
|
|
+ (void)initialize
|
|
|
|
|
{
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
static BOOL initialized=NO;
|
|
|
|
|
if (!initialized)
|
2004-05-15 12:52:48 +00:00
|
|
|
|
{
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
initialized=YES;
|
|
|
|
|
|
* EOControl/EOPriv.h/m: Split into...
* EOControl/EOPrivat.h/m: ... and ...
* EOAccess/EOPrivat.h/m: ... files.
* EOAccess/EOAdaptorChannel.m: Include new privat header.
* EOAccess/EOAttribute.m, EOAccess/EODatabase.m,
* EOAccess/EODatabaseChannel.m, EOAccess/EOEntity.m,
* EOAccess/EORelationship.m, EOAccess/EOSQLExpression.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m: Ditto.
(+initialize): Call new private function.
* EOAccess/EODatabaseContext.m: Ditto.
(EODatabaseContext_snapshotForGlobalIDWithImpPtr)
(EODatabaseContext_globalIDForObjectWithImpPtr): Move to
EOPrivate.m.
* EOAccess/EODatabaseContextPriv.h:
(EODatabaseContext_snapshotForGlobalIDWithImpPtr)
(EODatabaseContext_globalIDForObjectWithImpPtr): Move to
EOPrivate.h.
* EOAccess/GNUmakefile: Compile EOPrivate.m.
* EOControl/EOClassDescription.m, EOControl/EOGenericRecord.m
* EOControl/EOKeyGlobalID.m, EOControl/EOKeyValueCoding.m
* EOControl/EOKeyValueQualifier.m, EOControl/EONSAddOns.m
* EOControl/EOSortOrdering.m: Include new private header.
* EOControl/EOEditingContext.h/m: Ditto.
(EOEditingContext_objectForGlobalIDWithImpPtr)
(EOEditingContext_recordObjectGlobalIDWithImpPtr): Move to
EOPrivate.h/m.
* EOControl/EOMutableKnownKeyDictionary.h/m: Include new
private header.
(EOMKKD_objectForKeyWithImpPtr, EOMKKD_setObjectForKeyWithImpPtr)
(EOMKKD_removeObjectForKeyWithImpPtr, EOMKKD_hasKeyWithImpPtr)
(EOMKKD_indexForKeyWithImpPtr)
(EOMKKDInitializer_indexForKeyWithImpPtr): Move to EOPrivate.m
* EOControl/EOFault.m: (+isFault:): Update comment.
* EOControl/GNUmakefile: Build EOPrivate.m instead of EOPriv.m.
Do not install private header.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20759 72102866-910b-0410-8b05-ffd578937521
2005-02-20 10:52:57 +00:00
|
|
|
|
GDL2_EOAccessPrivateInit();
|
2004-05-15 12:52:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
+ (id) attributeWithPropertyList: (NSDictionary *)propertyList
|
|
|
|
|
owner: (id)owner
|
|
|
|
|
{
|
|
|
|
|
return [[[self alloc] initWithPropertyList: propertyList
|
|
|
|
|
owner: owner] autorelease];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id) initWithPropertyList: (NSDictionary *)propertyList
|
|
|
|
|
owner: (id)owner
|
|
|
|
|
{
|
|
|
|
|
if ((self = [self init]))
|
|
|
|
|
{
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
NSString *tmpString = nil;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
id tmpObject = nil;
|
|
|
|
|
|
|
|
|
|
[self setName: [propertyList objectForKey: @"name"]];
|
|
|
|
|
|
2003-02-01 15:19:56 +00:00
|
|
|
|
EOFLOGObjectLevelArgs(@"gsdb", @"Attribute parent=%p %@",
|
2002-11-15 22:57:05 +00:00
|
|
|
|
owner, [(EOEntity *)owner name]);
|
|
|
|
|
|
|
|
|
|
[self setParent: owner];
|
2003-02-01 15:19:56 +00:00
|
|
|
|
// EOFLOGObjectLevel(@"gsdb", @"Attribute Entity=%@", [self entity]);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
[self setExternalType: [propertyList objectForKey: @"externalType"]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"allowsNull"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setAllowsNull: [tmpString isEqual: @"Y"]];
|
|
|
|
|
|
|
|
|
|
[self setValueType: [propertyList objectForKey: @"valueType"]];
|
|
|
|
|
[self setValueClassName: [propertyList objectForKey: @"valueClassName"]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"writeFormat"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setWriteFormat: tmpString];
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmpString = [propertyList objectForKey: @"updateFormat"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setWriteFormat: tmpString];
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmpString = [propertyList objectForKey: @"insertFormat"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setWriteFormat: tmpString];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"readFormat"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setReadFormat: tmpString];
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmpString = [propertyList objectForKey: @"selectFormat"];
|
|
|
|
|
[self setReadFormat: tmpString];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
tmpString = [propertyList objectForKey: @"maximumLength"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setMaximumLength: [tmpString intValue]];
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"width"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setWidth: [tmpString intValue]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"valueFactoryMethodName"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setValueFactoryMethodName: tmpString];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"adaptorValueConversionMethodName"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setAdaptorValueConversionMethodName: tmpString];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"factoryMethodArgumentType"];
|
|
|
|
|
if(tmpString)
|
|
|
|
|
{
|
|
|
|
|
EOFactoryMethodArgumentType argType = EOFactoryMethodArgumentIsBytes;
|
|
|
|
|
|
|
|
|
|
if ([tmpString isEqual: @"EOFactoryMethodArgumentIsNSData"])
|
|
|
|
|
argType = EOFactoryMethodArgumentIsNSData;
|
|
|
|
|
else if ([tmpString isEqual: @"EOFactoryMethodArgumentIsNSString"])
|
|
|
|
|
argType = EOFactoryMethodArgumentIsNSString;
|
|
|
|
|
|
|
|
|
|
[self setFactoryMethodArgumentType: argType];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"precision"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setPrecision: [tmpString intValue]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"scale"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setScale: [tmpString intValue]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"serverTimeZone"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setServerTimeZone: [NSTimeZone timeZoneWithName: tmpString]];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"parameterDirection"];
|
|
|
|
|
if (tmpString)
|
|
|
|
|
{
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
if ([tmpString isKindOfClass: GDL2_NSNumberClass])
|
2003-05-16 20:21:56 +00:00
|
|
|
|
{
|
|
|
|
|
[self setParameterDirection: [tmpString intValue]];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
EOParameterDirection eDirection = EOVoid;
|
|
|
|
|
|
|
|
|
|
if ([tmpString isEqual: @"in"])
|
|
|
|
|
eDirection = EOInParameter;
|
|
|
|
|
else if ([tmpString isEqual: @"out"])
|
|
|
|
|
eDirection = EOOutParameter;
|
|
|
|
|
else if ([tmpString isEqual: @"inout"])
|
|
|
|
|
eDirection = EOInOutParameter;
|
|
|
|
|
|
|
|
|
|
[self setParameterDirection: eDirection];
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmpObject = [propertyList objectForKey: @"userInfo"];
|
|
|
|
|
|
|
|
|
|
if (tmpObject)
|
|
|
|
|
[self setUserInfo: tmpObject];
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmpObject = [propertyList objectForKey: @"userDictionary"];
|
|
|
|
|
|
|
|
|
|
if (tmpObject)
|
|
|
|
|
[self setUserInfo: tmpObject];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmpObject = [propertyList objectForKey: @"internalInfo"];
|
|
|
|
|
|
|
|
|
|
if (tmpObject)
|
|
|
|
|
[self setInternalInfo: tmpObject];
|
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"docComment"];
|
|
|
|
|
|
|
|
|
|
if (tmpString)
|
|
|
|
|
[self setDocComment: tmpString];
|
|
|
|
|
|
2003-02-01 15:19:56 +00:00
|
|
|
|
EOFLOGObjectLevelArgs(@"gsdb", @"Attribute name=%@", _name);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
tmpString = [propertyList objectForKey: @"isReadOnly"];
|
2003-02-01 15:19:56 +00:00
|
|
|
|
EOFLOGObjectLevelArgs(@"gsdb", @"tmpString=%@", tmpString);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
[self setReadOnly: [tmpString isEqual: @"Y"]];
|
2003-02-01 15:19:56 +00:00
|
|
|
|
EOFLOGObjectLevelArgs(@"gsdb", @"tmpString=%@", tmpString);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)awakeWithPropertyList: (NSDictionary *)propertyList
|
|
|
|
|
{
|
|
|
|
|
//Seems OK
|
2003-04-18 19:01:06 +00:00
|
|
|
|
NSString *definition;
|
|
|
|
|
NSString *columnName;
|
|
|
|
|
NSString *tmpString;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
definition = [propertyList objectForKey: @"definition"];
|
|
|
|
|
|
|
|
|
|
if (definition)
|
|
|
|
|
[self setDefinition: definition];
|
|
|
|
|
|
|
|
|
|
columnName = [propertyList objectForKey: @"columnName"];
|
|
|
|
|
|
|
|
|
|
if (columnName)
|
|
|
|
|
[self setColumnName: columnName];
|
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
tmpString = [propertyList objectForKey: @"prototypeName"];
|
|
|
|
|
|
|
|
|
|
if (tmpString)
|
|
|
|
|
{
|
|
|
|
|
EOAttribute *attr = [[_parent model] prototypeAttributeNamed: tmpString];
|
|
|
|
|
|
|
|
|
|
if (attr)
|
|
|
|
|
[self setPrototype: attr];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EOFLOGObjectLevelArgs(@"gsdb", @"Attribute %@ awakeWithPropertyList:%@",
|
2003-02-01 15:19:56 +00:00
|
|
|
|
self, propertyList);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)encodeIntoPropertyList: (NSMutableDictionary *)propertyList
|
|
|
|
|
{
|
|
|
|
|
if (_name)
|
|
|
|
|
[propertyList setObject: _name forKey: @"name"];
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_prototype)
|
|
|
|
|
[propertyList setObject: [_prototype name] forKey: @"prototypeName"];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
if (_serverTimeZone)
|
2003-02-03 14:53:03 +00:00
|
|
|
|
[propertyList setObject: [_serverTimeZone name]
|
2002-11-15 22:57:05 +00:00
|
|
|
|
forKey: @"serverTimeZone"];
|
|
|
|
|
if (_columnName)
|
|
|
|
|
[propertyList setObject: _columnName forKey: @"columnName"];
|
|
|
|
|
if (_definitionArray)
|
|
|
|
|
[propertyList setObject: [_definitionArray definition]
|
|
|
|
|
forKey: @"definition"];
|
|
|
|
|
if (_externalType)
|
|
|
|
|
[propertyList setObject: _externalType forKey: @"externalType"];
|
|
|
|
|
if (_valueClassName)
|
|
|
|
|
[propertyList setObject: _valueClassName forKey: @"valueClassName"];
|
|
|
|
|
if (_valueType)
|
|
|
|
|
[propertyList setObject: _valueType forKey: @"valueType"];
|
2003-05-16 20:21:56 +00:00
|
|
|
|
|
|
|
|
|
if (_valueFactoryMethodName)
|
|
|
|
|
{
|
|
|
|
|
NSString *methodArg;
|
|
|
|
|
|
|
|
|
|
[propertyList setObject: _valueFactoryMethodName
|
|
|
|
|
forKey: @"valueFactoryMethodName"];
|
|
|
|
|
|
|
|
|
|
switch (_argumentType)
|
|
|
|
|
{
|
|
|
|
|
case EOFactoryMethodArgumentIsNSData:
|
|
|
|
|
methodArg = @"EOFactoryMethodArgumentIsNSData";
|
|
|
|
|
break;
|
|
|
|
|
case EOFactoryMethodArgumentIsNSString:
|
|
|
|
|
methodArg = @"EOFactoryMethodArgumentIsNSString";
|
|
|
|
|
break;
|
|
|
|
|
case EOFactoryMethodArgumentIsBytes:
|
|
|
|
|
methodArg = @"EOFactoryMethodArgumentIsBytes";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
methodArg = nil;
|
|
|
|
|
[NSException raise: NSInternalInconsistencyException
|
|
|
|
|
format: @"%@ -- %@ 0x%x: Invalid value for _argumentType:%d",
|
|
|
|
|
NSStringFromSelector(_cmd),
|
|
|
|
|
NSStringFromClass([self class]),
|
|
|
|
|
self, _argumentType];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[propertyList setObject: methodArg
|
|
|
|
|
forKey: @"factoryMethodArgumentType"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_adaptorValueConversionMethodName)
|
|
|
|
|
[propertyList setObject: _adaptorValueConversionMethodName
|
|
|
|
|
forKey: @"adaptorValueConversionMethodName"];
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
if (_readFormat)
|
|
|
|
|
[propertyList setObject: _readFormat forKey: @"readFormat"];
|
|
|
|
|
if (_writeFormat)
|
|
|
|
|
[propertyList setObject: _writeFormat forKey: @"writeFormat"];
|
2003-05-16 20:21:56 +00:00
|
|
|
|
if (_width > 0)
|
2004-10-06 22:45:21 +00:00
|
|
|
|
[propertyList setObject: [NSString stringWithFormat:@"%u", _width]
|
2003-05-16 20:21:56 +00:00
|
|
|
|
forKey: @"width"];
|
|
|
|
|
if (_precision > 0)
|
2004-10-06 22:45:21 +00:00
|
|
|
|
[propertyList setObject: [NSString stringWithFormat:@"%hu", _precision]
|
2003-05-16 20:21:56 +00:00
|
|
|
|
forKey: @"precision"];
|
|
|
|
|
if (_scale != 0)
|
2004-10-07 14:13:05 +00:00
|
|
|
|
[propertyList setObject: [NSString stringWithFormat:@"%hi", _scale]
|
2003-05-16 20:21:56 +00:00
|
|
|
|
forKey: @"scale"];
|
|
|
|
|
|
|
|
|
|
if (_parameterDirection != 0)
|
2004-10-06 22:45:21 +00:00
|
|
|
|
[propertyList setObject: [NSString stringWithFormat:@"%d",
|
|
|
|
|
(int)_parameterDirection]
|
2003-05-16 20:21:56 +00:00
|
|
|
|
forKey: @"parameterDirection"];
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
if (_userInfo)
|
|
|
|
|
[propertyList setObject: _userInfo forKey: @"userInfo"];
|
|
|
|
|
if (_docComment)
|
|
|
|
|
[propertyList setObject: _docComment forKey: @"docComment"];
|
|
|
|
|
|
|
|
|
|
if (_flags.isReadOnly)
|
2003-05-16 20:21:56 +00:00
|
|
|
|
[propertyList setObject: @"Y"
|
2002-11-15 22:57:05 +00:00
|
|
|
|
forKey: @"isReadOnly"];
|
2003-05-16 20:21:56 +00:00
|
|
|
|
if (_flags.allowsNull)
|
|
|
|
|
[propertyList setObject: @"Y"
|
|
|
|
|
forKey: @"allowsNull"];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
|
{
|
|
|
|
|
DESTROY(_name);
|
2003-04-18 19:01:06 +00:00
|
|
|
|
DESTROY(_prototype);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
DESTROY(_columnName);
|
|
|
|
|
DESTROY(_externalType);
|
|
|
|
|
DESTROY(_valueType);
|
|
|
|
|
DESTROY(_valueClassName);
|
|
|
|
|
DESTROY(_readFormat);
|
|
|
|
|
DESTROY(_writeFormat);
|
|
|
|
|
DESTROY(_serverTimeZone);
|
|
|
|
|
DESTROY(_valueFactoryMethodName);
|
|
|
|
|
DESTROY(_adaptorValueConversionMethodName);
|
|
|
|
|
DESTROY(_sourceToDestinationKeyMap);
|
|
|
|
|
DESTROY(_userInfo);
|
|
|
|
|
DESTROY(_internalInfo);
|
|
|
|
|
DESTROY(_docComment);
|
|
|
|
|
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)gcDecrementRefCountOfContainedObjects
|
|
|
|
|
{
|
|
|
|
|
EOFLOGObjectFnStart();
|
|
|
|
|
|
|
|
|
|
[_parent gcDecrementRefCount];
|
2002-12-30 22:10:43 +00:00
|
|
|
|
EOFLOGObjectLevel(@"gsdb", @"prototype gcDecrementRefCount");
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
[_prototype gcDecrementRefCount];
|
2002-12-30 22:10:43 +00:00
|
|
|
|
EOFLOGObjectLevel(@"gsdb", @"definitionArray gcDecrementRefCount");
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
[(id)_definitionArray gcDecrementRefCount];
|
2002-12-30 22:10:43 +00:00
|
|
|
|
EOFLOGObjectLevel(@"gsdb", @"realAttribute gcDecrementRefCount");
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
[_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];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)description
|
|
|
|
|
{
|
|
|
|
|
NSString *dscr = [NSString stringWithFormat: @"<%s %p - name=%@ entity=%@ columnName=%@ definition=%@ ",
|
|
|
|
|
object_get_class_name(self),
|
|
|
|
|
(void*)self,
|
|
|
|
|
[self name],
|
|
|
|
|
[[self entity] name],
|
|
|
|
|
[self columnName],
|
|
|
|
|
[self definition]];
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
dscr = [dscr stringByAppendingFormat: @"valueClassName=%@ valueType=%@ externalType=%@ allowsNull=%s isReadOnly=%s isDerived=%s isFlattened=%s>",
|
2002-11-15 22:57:05 +00:00
|
|
|
|
[self valueClassName],
|
|
|
|
|
[self valueType],
|
|
|
|
|
[self externalType],
|
2005-04-24 11:28:15 +00:00
|
|
|
|
([self allowsNull] ? "YES" : "NO"),
|
2002-11-15 22:57:05 +00:00
|
|
|
|
([self isReadOnly] ? "YES" : "NO"),
|
|
|
|
|
([self isDerived] ? "YES" : "NO"),
|
|
|
|
|
([self isFlattened] ? "YES" : "NO")];
|
|
|
|
|
|
|
|
|
|
return dscr;
|
|
|
|
|
}
|
2004-09-08 13:05:25 +00:00
|
|
|
|
|
|
|
|
|
/* We override GCObjects default implementation
|
|
|
|
|
as attributes cannot be copied */
|
|
|
|
|
- (id)copyWithZone:(NSZone *)zone
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd];
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
- (EOEntity *)entity
|
|
|
|
|
{
|
|
|
|
|
if (_flags.isParentAnEOEntity)
|
|
|
|
|
return _parent;
|
|
|
|
|
else
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)name
|
|
|
|
|
{
|
|
|
|
|
return _name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)columnName
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_columnName)
|
|
|
|
|
return _columnName;
|
|
|
|
|
|
|
|
|
|
return [_prototype columnName];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)definition
|
|
|
|
|
{
|
|
|
|
|
NSString *definition = nil;
|
|
|
|
|
|
|
|
|
|
// EOFLOGObjectFnStart();
|
2003-02-01 15:19:56 +00:00
|
|
|
|
// EOFLOGObjectLevel(@"gsdb",@"_definitionArray:%@",_definitionArray);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
definition = [_definitionArray valueForSQLExpression: nil];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2003-02-01 15:19:56 +00:00
|
|
|
|
// EOFLOGObjectLevel(@"gsdb",@"definition:%@",definition);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
// EOFLOGObjectFnStop();
|
|
|
|
|
|
|
|
|
|
return definition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)readFormat
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_readFormat)
|
|
|
|
|
return _readFormat;
|
|
|
|
|
|
|
|
|
|
return [_prototype readFormat];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)writeFormat
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_writeFormat)
|
|
|
|
|
return _writeFormat;
|
|
|
|
|
|
|
|
|
|
return [_prototype writeFormat];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSDictionary *)userInfo
|
|
|
|
|
{
|
|
|
|
|
return _userInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)docComment
|
|
|
|
|
{
|
|
|
|
|
return _docComment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (int)scale
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_scale)
|
|
|
|
|
return _scale;
|
|
|
|
|
|
|
|
|
|
if (_prototype)
|
|
|
|
|
return [_prototype scale];
|
|
|
|
|
|
|
|
|
|
return 0;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (unsigned)precision
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_precision)
|
|
|
|
|
return _precision;
|
|
|
|
|
|
|
|
|
|
if (_prototype)
|
|
|
|
|
return [_prototype precision];
|
|
|
|
|
|
|
|
|
|
return 0;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (unsigned)width
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_width)
|
|
|
|
|
return _width;
|
|
|
|
|
|
|
|
|
|
if (_prototype)
|
|
|
|
|
return [_prototype width];
|
|
|
|
|
|
|
|
|
|
return 0;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id)parent
|
|
|
|
|
{
|
|
|
|
|
return _parent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (EOAttribute *)prototype
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
return _prototype;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)prototypeName
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
return [_prototype name];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (EOParameterDirection)parameterDirection
|
|
|
|
|
{
|
|
|
|
|
return _parameterDirection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)allowsNull
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_flags.allowsNull)
|
|
|
|
|
return _flags.allowsNull;
|
|
|
|
|
|
|
|
|
|
if (_prototype)
|
|
|
|
|
return [_prototype allowsNull];
|
|
|
|
|
|
|
|
|
|
return NO;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)isKeyDefinedByPrototype:(NSString *)key
|
|
|
|
|
{
|
|
|
|
|
return NO; // TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (EOStoredProcedure *)storedProcedure
|
|
|
|
|
{
|
|
|
|
|
if ([_parent isKindOfClass: [EOStoredProcedure class]])
|
|
|
|
|
return _parent;
|
|
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)isReadOnly
|
|
|
|
|
{
|
|
|
|
|
//call isDerived
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_flags.isReadOnly)
|
|
|
|
|
return _flags.isReadOnly;
|
|
|
|
|
|
|
|
|
|
if (_prototype)
|
|
|
|
|
return [_prototype isReadOnly];
|
|
|
|
|
|
|
|
|
|
return NO;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* Return NO when the attribute corresponds to one SQL column in its entity
|
|
|
|
|
* associated table return YES otherwise.
|
|
|
|
|
* An attribute with a definition such as
|
|
|
|
|
* "anotherAttributeName * 2" is derived.
|
|
|
|
|
* A Flattened attribute is also a derived attributes.
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (BOOL)isDerived
|
|
|
|
|
{
|
|
|
|
|
//Seems OK
|
|
|
|
|
if(_definitionArray)
|
|
|
|
|
return YES;
|
2003-04-18 19:01:06 +00:00
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* Returns YES if the attribute is flattened, NO otherwise.
|
|
|
|
|
* A flattened attribute is an attribute with a definition
|
|
|
|
|
* using a relationship to another entity.
|
|
|
|
|
* A Flattened attribute is also a derived attribute.
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (BOOL)isFlattened
|
|
|
|
|
{
|
|
|
|
|
BOOL isFlattened = NO;
|
|
|
|
|
// Seems OK
|
|
|
|
|
|
|
|
|
|
if(_definitionArray)
|
|
|
|
|
isFlattened = [_definitionArray isFlattened];
|
|
|
|
|
|
|
|
|
|
return isFlattened;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)valueClassName
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_valueClassName)
|
|
|
|
|
return _valueClassName;
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
if ([self isFlattened])
|
|
|
|
|
return [[_definitionArray realAttribute] valueClassName];
|
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
return [_prototype valueClassName];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
- (NSString *)externalType
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_externalType)
|
|
|
|
|
return _externalType;
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
if ([self isFlattened])
|
|
|
|
|
return [[_definitionArray realAttribute] externalType];
|
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
return [_prototype externalType];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)valueType
|
|
|
|
|
{
|
2003-04-18 19:01:06 +00:00
|
|
|
|
if (_valueType)
|
|
|
|
|
return _valueType;
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
else if([self isFlattened])
|
2003-10-23 15:06:51 +00:00
|
|
|
|
return [[_definitionArray realAttribute] valueType];
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
else
|
|
|
|
|
return [_prototype valueType];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributeSQLExpression)
|
2003-10-23 15:06:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* Returns the value to use in an EOSQLExpression.
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (NSString *) valueForSQLExpression: (EOSQLExpression *)sqlExpression
|
|
|
|
|
{
|
|
|
|
|
NSString *value=nil;
|
|
|
|
|
|
2003-02-01 15:19:56 +00:00
|
|
|
|
// EOFLOGObjectLevel(@"gsdb",@"EOAttribute %p",self);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
NSEmitTODO(); //TODO
|
|
|
|
|
|
|
|
|
|
if (_definitionArray)
|
|
|
|
|
value = [_definitionArray valueForSQLExpression: sqlExpression];
|
|
|
|
|
else
|
|
|
|
|
value = [self name];
|
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
@implementation EOAttribute (EOAttributeEditing)
|
|
|
|
|
|
|
|
|
|
- (NSException *)validateName:(NSString *)name
|
|
|
|
|
{
|
|
|
|
|
NSArray *storedProcedures;
|
|
|
|
|
const char *p, *s = [name cString];
|
|
|
|
|
int exc = 0;
|
|
|
|
|
|
|
|
|
|
if (!name || ![name length]) exc++;
|
|
|
|
|
|
|
|
|
|
if (!exc)
|
|
|
|
|
{
|
|
|
|
|
p = s;
|
|
|
|
|
|
|
|
|
|
while (*p)
|
|
|
|
|
{
|
|
|
|
|
if (!isalnum(*p) &&
|
|
|
|
|
*p != '@' && *p != '#' && *p != '_' && *p != '$')
|
|
|
|
|
{
|
|
|
|
|
exc++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!exc && *s == '$')
|
|
|
|
|
exc++;
|
|
|
|
|
|
2005-02-03 13:09:50 +00:00
|
|
|
|
if (exc)
|
|
|
|
|
return [NSException exceptionWithName: NSInvalidArgumentException
|
|
|
|
|
reason: [NSString stringWithFormat:@"%@ -- %@ 0x%x: argument \"%@\" contains invalid char '%c'",
|
|
|
|
|
NSStringFromSelector(_cmd),
|
|
|
|
|
NSStringFromClass([self class]),
|
|
|
|
|
self,
|
|
|
|
|
name,
|
|
|
|
|
*p]
|
|
|
|
|
userInfo: nil];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
if ([[self entity] attributeNamed:name])
|
|
|
|
|
exc++;
|
|
|
|
|
else if ((storedProcedures = [[[self entity] model] storedProcedures]))
|
|
|
|
|
{
|
|
|
|
|
NSEnumerator *stEnum = [storedProcedures objectEnumerator];
|
|
|
|
|
EOStoredProcedure *st;
|
|
|
|
|
|
|
|
|
|
while ((st = [stEnum nextObject]))
|
|
|
|
|
{
|
|
|
|
|
NSEnumerator *attrEnum;
|
|
|
|
|
EOAttribute *attr;
|
|
|
|
|
|
|
|
|
|
attrEnum = [[st arguments] objectEnumerator];
|
|
|
|
|
|
|
|
|
|
while ((attr = [attrEnum nextObject]))
|
|
|
|
|
{
|
|
|
|
|
if ([name isEqualToString: [attr name]])
|
|
|
|
|
{
|
|
|
|
|
exc++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (exc) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-03 13:09:50 +00:00
|
|
|
|
if (exc)
|
|
|
|
|
{
|
|
|
|
|
return [NSException exceptionWithName: NSInvalidArgumentException
|
|
|
|
|
reason: [NSString stringWithFormat: @"%@ -- %@ 0x%x: \"%@\" already used in the model",
|
|
|
|
|
NSStringFromSelector(_cmd),
|
|
|
|
|
NSStringFromClass([self class]),
|
|
|
|
|
self,
|
|
|
|
|
name]
|
|
|
|
|
userInfo: nil];
|
|
|
|
|
}
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setName: (NSString *)name
|
|
|
|
|
{
|
2005-03-03 12:17:57 +00:00
|
|
|
|
if ([_name isEqual: name]==NO)
|
2004-09-07 15:57:21 +00:00
|
|
|
|
{
|
2005-03-03 12:17:57 +00:00
|
|
|
|
NSString *oldName = nil;
|
|
|
|
|
[[self validateName: name] raise];
|
|
|
|
|
|
|
|
|
|
oldName = AUTORELEASE(RETAIN(_name));
|
|
|
|
|
[self willChange];
|
|
|
|
|
ASSIGN(_name, name);
|
|
|
|
|
if (_flags.isParentAnEOEntity)
|
|
|
|
|
{
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
[_parent _attributeNameChangedFrom: oldName to: name];
|
|
|
|
|
}
|
2004-09-07 15:57:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-04-18 19:01:06 +00:00
|
|
|
|
- (void)setPrototype: (EOAttribute *)prototype
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2003-04-18 19:01:06 +00:00
|
|
|
|
ASSIGN(_prototype, prototype);
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setColumnName: (NSString *)columnName
|
|
|
|
|
{
|
|
|
|
|
//seems OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
ASSIGN(_columnName, columnName);
|
|
|
|
|
DESTROY(_definitionArray);
|
|
|
|
|
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
[self _setOverrideForKeyEnum:1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)_setDefinitionWithoutFlushingCaches: (NSString *)definition
|
|
|
|
|
{
|
|
|
|
|
EOExpressionArray *expressionArray=nil;
|
|
|
|
|
|
|
|
|
|
[self willChange];
|
|
|
|
|
expressionArray = [_parent _parseDescription: definition
|
|
|
|
|
isFormat: NO
|
|
|
|
|
arguments: NULL];
|
|
|
|
|
|
|
|
|
|
expressionArray = [self _normalizeDefinition: expressionArray
|
|
|
|
|
path: nil];
|
|
|
|
|
/*
|
|
|
|
|
//TODO finish
|
|
|
|
|
l un est code
|
|
|
|
|
|
|
|
|
|
entity primaryKeyAttributes (code)
|
|
|
|
|
??
|
|
|
|
|
|
|
|
|
|
[self _removeFromEntityArray:code selector:setPrimaryKeyAttributes:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
ASSIGN(_definitionArray, expressionArray);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-(id)_normalizeDefinition: (EOExpressionArray*)definition
|
|
|
|
|
path: (id)path
|
|
|
|
|
{
|
|
|
|
|
//TODO
|
|
|
|
|
/*
|
|
|
|
|
definition _isPropertyPath //NO
|
|
|
|
|
count
|
|
|
|
|
object atindex
|
|
|
|
|
self _normalizeDefinition:ret path:NSArray()
|
|
|
|
|
adddobject
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if attribute
|
|
|
|
|
if isderived //NO
|
|
|
|
|
??
|
|
|
|
|
ret attr
|
|
|
|
|
|
|
|
|
|
return nexexp
|
|
|
|
|
*/
|
|
|
|
|
return definition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setDefinition:(NSString *)definition
|
|
|
|
|
{
|
|
|
|
|
if(definition)
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
[self _setDefinitionWithoutFlushingCaches: definition];
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
DESTROY(_columnName);//??
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setReadOnly: (BOOL)yn
|
|
|
|
|
{
|
|
|
|
|
if(!yn && ([self isDerived] && ![self isFlattened]))
|
|
|
|
|
[NSException raise: NSInvalidArgumentException
|
|
|
|
|
format: @"%@ -- %@ 0x%x: cannot set to NO while the attribute is derived but not flattened.",
|
|
|
|
|
NSStringFromSelector(_cmd),
|
|
|
|
|
NSStringFromClass([self class]),
|
|
|
|
|
self];
|
|
|
|
|
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_flags.isReadOnly = yn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setExternalType: (NSString *)type
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
ASSIGN(_externalType, type);
|
|
|
|
|
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
[self _setOverrideForKeyEnum: 0];//TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setValueType: (NSString *)type
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
ASSIGN(_valueType, type);
|
|
|
|
|
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
if ([_valueType length]==1)
|
|
|
|
|
_valueTypeChar=(char)[_valueType characterAtIndex:0];
|
|
|
|
|
else
|
|
|
|
|
_valueTypeChar='\0';
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
[self _setOverrideForKeyEnum: 4];//TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setValueClassName: (NSString *)name
|
|
|
|
|
{
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
ASSIGN(_valueClassName, name);
|
|
|
|
|
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
_valueClass = NSClassFromString(_valueClassName);
|
|
|
|
|
|
2005-02-15 21:29:24 +00:00
|
|
|
|
_flags.isAttributeValueInitialized = NO;
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
[self _setOverrideForKeyEnum: 3];//TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setWidth: (unsigned)length
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_width = length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setPrecision: (unsigned)precision
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_precision = precision;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setScale: (int)scale
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_scale = scale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setAllowsNull: (BOOL)allowsNull
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
_flags.allowsNull = allowsNull;
|
|
|
|
|
|
|
|
|
|
[self _setOverrideForKeyEnum: 15];//TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setWriteFormat: (NSString *)string
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
ASSIGN(_writeFormat, string);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setReadFormat: (NSString *)string
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
ASSIGN(_readFormat, string);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setParameterDirection: (EOParameterDirection)parameterDirection
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_parameterDirection = parameterDirection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setUserInfo: (NSDictionary *)dictionary
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
|
|
|
|
|
ASSIGN(_userInfo, dictionary);
|
|
|
|
|
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
[self _setOverrideForKeyEnum: 10];//TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setInternalInfo: (NSDictionary *)dictionary
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
ASSIGN(_internalInfo, dictionary);
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
[self _setOverrideForKeyEnum: 10]; //TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setDocComment: (NSString *)docComment
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
|
|
|
|
ASSIGN(_docComment, docComment);
|
|
|
|
|
[_parent _setIsEdited];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOBeautifier)
|
|
|
|
|
|
|
|
|
|
/*+ Make the name conform to the Next naming style
|
|
|
|
|
NAME -> name, FIRST_NAME -> firstName +*/
|
|
|
|
|
- (void)beautifyName
|
|
|
|
|
{
|
|
|
|
|
NSArray *listItems;
|
|
|
|
|
NSString *newString=[NSMutableString string];
|
|
|
|
|
int anz,i;
|
|
|
|
|
|
|
|
|
|
EOFLOGObjectFnStartOrCond2(@"ModelingClasses", @"EOAttribute");
|
|
|
|
|
|
|
|
|
|
// Makes the receiver's name conform to a standard convention. Names that conform to this style are all lower-case except for the initial letter of each embedded word other than the first, which is upper case. Thus, "NAME" becomes "name", and "FIRST_NAME" becomes "firstName".
|
|
|
|
|
|
|
|
|
|
if ((_name) && ([_name length]>0))
|
|
|
|
|
{
|
|
|
|
|
listItems = [_name componentsSeparatedByString: @"_"];
|
|
|
|
|
newString = [newString stringByAppendingString:
|
|
|
|
|
[[listItems objectAtIndex: 0] lowercaseString]];
|
|
|
|
|
anz = [listItems count];
|
|
|
|
|
|
|
|
|
|
for(i = 1; i < anz; i++)
|
|
|
|
|
{
|
|
|
|
|
newString = [newString stringByAppendingString:
|
|
|
|
|
[[listItems objectAtIndex: i]
|
|
|
|
|
capitalizedString]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#warning erg<EFBFBD>nzen um alle components (attributes, ...)
|
|
|
|
|
|
|
|
|
|
// Exception abfangen
|
|
|
|
|
NS_DURING
|
|
|
|
|
{
|
|
|
|
|
[self setName: newString];
|
|
|
|
|
}
|
|
|
|
|
NS_HANDLER
|
|
|
|
|
{
|
|
|
|
|
NSLog(@"%@ in Class: EOAttribute , Method: beautifyName >> error : %@",
|
|
|
|
|
[localException name], [localException reason]);
|
|
|
|
|
}
|
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EOFLOGObjectFnStopOrCond2(@"ModelingClasses", @"EOAttribute");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOCalendarDateSupport)
|
|
|
|
|
|
|
|
|
|
- (NSTimeZone *)serverTimeZone
|
|
|
|
|
{
|
2003-10-23 15:06:51 +00:00
|
|
|
|
if (_serverTimeZone)
|
|
|
|
|
return _serverTimeZone;
|
|
|
|
|
|
|
|
|
|
return [_prototype serverTimeZone];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOCalendarDateSupportEditing)
|
|
|
|
|
|
|
|
|
|
- (void)setServerTimeZone: (NSTimeZone *)tz
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
ASSIGN(_serverTimeZone, tz);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributeValueCreation)
|
|
|
|
|
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
/**
|
2005-04-24 11:28:15 +00:00
|
|
|
|
* Returns an NSData or a custom-class value object
|
2003-10-23 15:06:51 +00:00
|
|
|
|
* from the supplied set of bytes.
|
|
|
|
|
* The Adaptor calls this method during value creation
|
|
|
|
|
* when fetching objects from the database.
|
|
|
|
|
* For efficiency, the returned value is NOT autoreleased.
|
2005-04-24 11:28:15 +00:00
|
|
|
|
*
|
|
|
|
|
* NB: The documentation of the reference implementation
|
|
|
|
|
* mistakenly claims that it returns an NSString.
|
2003-10-23 15:06:51 +00:00
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (id)newValueForBytes: (const void *)bytes
|
|
|
|
|
length: (int)length
|
|
|
|
|
{
|
|
|
|
|
NSData *value = nil;
|
2003-10-23 15:06:51 +00:00
|
|
|
|
Class valueClass = [self _valueClass];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
if (valueClass != Nil && valueClass != GDL2_NSDataClass)
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
|
|
|
|
switch (_argumentType)
|
|
|
|
|
{
|
|
|
|
|
case EOFactoryMethodArgumentIsNSData:
|
2005-04-24 11:28:15 +00:00
|
|
|
|
{
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
value = [GDL2_alloc(NSData) initWithBytes: bytes length: length];
|
|
|
|
|
|
|
|
|
|
// If we have a value factiry method, call it to get the final value
|
|
|
|
|
if(_valueFactoryMethod != NULL)
|
|
|
|
|
{
|
|
|
|
|
NSData* tmp = value;
|
|
|
|
|
// valueFactoryMethod returns an autoreleased value
|
|
|
|
|
value = [(id)valueClass performSelector: _valueFactoryMethod
|
|
|
|
|
withObject: value];
|
|
|
|
|
if (value != value)
|
|
|
|
|
{
|
|
|
|
|
RETAIN(value);
|
|
|
|
|
RELEASE(tmp);
|
|
|
|
|
};
|
|
|
|
|
};
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
case EOFactoryMethodArgumentIsBytes:
|
|
|
|
|
{
|
|
|
|
|
NSMethodSignature *aSignature = nil;
|
|
|
|
|
NSInvocation *anInvocation = nil;
|
|
|
|
|
|
|
|
|
|
// TODO: verify with WO
|
|
|
|
|
NSAssert2(_valueFactoryMethod,
|
|
|
|
|
@"No _valueFactoryMethod (valueFactoryMethodName=%@) in attribute %@",
|
|
|
|
|
_valueFactoryMethodName,self);
|
|
|
|
|
|
|
|
|
|
// First find signature for method
|
|
|
|
|
aSignature =
|
|
|
|
|
[valueClass
|
|
|
|
|
methodSignatureForSelector: _valueFactoryMethod];
|
|
|
|
|
|
|
|
|
|
// Create the invocation object
|
|
|
|
|
anInvocation
|
|
|
|
|
= [NSInvocation invocationWithMethodSignature: aSignature];
|
|
|
|
|
|
|
|
|
|
// Put the selector
|
|
|
|
|
[anInvocation setSelector: _valueFactoryMethod];
|
|
|
|
|
|
|
|
|
|
// The target is the custom value class
|
|
|
|
|
[anInvocation setTarget: valueClass];
|
|
|
|
|
|
|
|
|
|
// arguments are buffer pointer and length
|
|
|
|
|
[anInvocation setArgument: &bytes atIndex: 2];
|
|
|
|
|
[anInvocation setArgument: &length atIndex: 3];
|
|
|
|
|
|
|
|
|
|
// Let's invoke the method
|
|
|
|
|
[anInvocation invoke];
|
|
|
|
|
|
|
|
|
|
// Get the returned value
|
|
|
|
|
[anInvocation getReturnValue: &value];
|
|
|
|
|
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
// valueFactoryMethod returns an autoreleased value
|
|
|
|
|
RETAIN(value);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
case EOFactoryMethodArgumentIsNSString:
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// TODO: verify with WO
|
2002-11-15 22:57:05 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!value)
|
2005-04-24 11:28:15 +00:00
|
|
|
|
{
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
value = [GDL2_alloc(NSData) initWithBytes: bytes length: length];
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* Returns a NSString or a custom-class value object
|
|
|
|
|
* from the supplied set of bytes using encoding.
|
|
|
|
|
* The Adaptor calls this method during value creation
|
|
|
|
|
* when fetching objects from the database.
|
|
|
|
|
* For efficiency, the returned value is NOT autoreleased.
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (id)newValueForBytes: (const void *)bytes
|
|
|
|
|
length: (int)length
|
|
|
|
|
encoding: (NSStringEncoding)encoding
|
|
|
|
|
{
|
2005-04-24 11:28:15 +00:00
|
|
|
|
NSString* value = nil;
|
2003-10-23 15:06:51 +00:00
|
|
|
|
Class valueClass = [self _valueClass];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
if (valueClass != Nil && valueClass != GDL2_NSStringClass)
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
|
|
|
|
switch (_argumentType)
|
|
|
|
|
{
|
|
|
|
|
case EOFactoryMethodArgumentIsNSString:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
{
|
2005-04-24 11:28:15 +00:00
|
|
|
|
NSData *data = nil;
|
|
|
|
|
NSString *string = nil;
|
|
|
|
|
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
data = AUTORELEASE([(GDL2_alloc(NSData)) initWithBytes: bytes
|
|
|
|
|
length: length]);
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
string = [(GDL2_alloc(NSString)) initWithData: data
|
|
|
|
|
encoding: encoding];
|
|
|
|
|
|
|
|
|
|
// If we have a value factiry method, call it to get the final value
|
|
|
|
|
if(_valueFactoryMethod != NULL)
|
|
|
|
|
{
|
|
|
|
|
value = [((id)valueClass) performSelector: _valueFactoryMethod
|
|
|
|
|
withObject: string];
|
|
|
|
|
if ( value != string)
|
|
|
|
|
{
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
RETAIN(value);
|
|
|
|
|
RELEASE(string);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
value = string;
|
|
|
|
|
};
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
case EOFactoryMethodArgumentIsBytes:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
{
|
2005-04-24 11:28:15 +00:00
|
|
|
|
NSMethodSignature *aSignature = nil;
|
|
|
|
|
NSInvocation *anInvocation = nil;
|
|
|
|
|
|
|
|
|
|
// TODO: verify with WO
|
|
|
|
|
NSAssert2(_valueFactoryMethod,
|
|
|
|
|
@"No _valueFactoryMethod (valueFactoryMethodName=%@) in attribute %@",
|
|
|
|
|
_valueFactoryMethodName,self);
|
|
|
|
|
|
|
|
|
|
// First find signature for method
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
aSignature
|
2005-04-24 11:28:15 +00:00
|
|
|
|
= [valueClass methodSignatureForSelector: _valueFactoryMethod];
|
|
|
|
|
|
|
|
|
|
// Create the invocation object
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
anInvocation
|
|
|
|
|
= [NSInvocation invocationWithMethodSignature: aSignature];
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
// Put the selector
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
[anInvocation setSelector: _valueFactoryMethod];
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
// The target is the custom value class
|
|
|
|
|
[anInvocation setTarget: valueClass];
|
|
|
|
|
|
|
|
|
|
// arguments are buffer pointer, length and encoding
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
[anInvocation setArgument: &bytes atIndex: 2];
|
|
|
|
|
[anInvocation setArgument: &length atIndex: 3];
|
|
|
|
|
[anInvocation setArgument: &encoding atIndex: 4];
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
// Let's invoke the method
|
|
|
|
|
[anInvocation invoke];
|
|
|
|
|
|
|
|
|
|
// Get the returned value
|
|
|
|
|
[anInvocation getReturnValue: &value];
|
|
|
|
|
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
// valueFactoryMethod returns an autoreleased value
|
|
|
|
|
RETAIN(value);
|
|
|
|
|
|
|
|
|
|
break;
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
case EOFactoryMethodArgumentIsNSData:
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// TODO: verify with WO
|
2002-11-15 22:57:05 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!value)
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
{
|
|
|
|
|
NSData *data;
|
|
|
|
|
data = AUTORELEASE([(GDL2_alloc(NSData)) initWithBytes: bytes
|
|
|
|
|
length: length]);
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
value = [(GDL2_alloc(NSString)) initWithData: data
|
|
|
|
|
encoding: encoding];
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2004-05-15 12:52:48 +00:00
|
|
|
|
* Returns an NSCalendarDate object
|
2003-10-23 15:06:51 +00:00
|
|
|
|
* from the supplied time information.
|
|
|
|
|
* The Adaptor calls this method during value creation
|
|
|
|
|
* when fetching objects from the database.
|
|
|
|
|
* For efficiency, the returned value is NOT autoreleased.
|
2005-04-24 11:28:15 +00:00
|
|
|
|
* Milliseconds are dropped since they cannot be easily be stored in
|
|
|
|
|
* NSCalendarDate.
|
2003-10-23 15:06:51 +00:00
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (NSCalendarDate *)newDateForYear: (int)year
|
|
|
|
|
month: (unsigned)month
|
|
|
|
|
day: (unsigned)day
|
|
|
|
|
hour: (unsigned)hour
|
|
|
|
|
minute: (unsigned)minute
|
|
|
|
|
second: (unsigned)second
|
|
|
|
|
millisecond: (unsigned)millisecond
|
|
|
|
|
timezone: (NSTimeZone *)timezone
|
|
|
|
|
zone: (NSZone *)zone
|
|
|
|
|
{
|
2005-04-24 11:28:15 +00:00
|
|
|
|
NSCalendarDate *date = nil;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// FIXME: extend initializer to include Milliseconds
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
//For efficiency reasons, the returned value is NOT autoreleased !
|
|
|
|
|
date = [(GDL2_allocWithZone(NSCalendarDate,zone))
|
|
|
|
|
initWithYear: year
|
|
|
|
|
month: month
|
|
|
|
|
day: day
|
|
|
|
|
hour: hour
|
|
|
|
|
minute: minute
|
|
|
|
|
second: second
|
|
|
|
|
timeZone: timezone];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
return date;
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Returns the name of the method to use for creating a custom class
|
|
|
|
|
value for this attribute.
|
|
|
|
|
|
|
|
|
|
See Also: - valueFactoryMethod, -newValueForBytes:length:
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (NSString *)valueFactoryMethodName
|
|
|
|
|
{
|
|
|
|
|
return _valueFactoryMethodName;
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Returns the selector of the method to use for creating a custom class
|
|
|
|
|
value for this attribute.
|
|
|
|
|
Default implementation returns selector for name returned by
|
|
|
|
|
-valueFactoryMethodName or NULL if no selector is found.
|
|
|
|
|
|
|
|
|
|
See Also: - valueFactoryMethodName, -newValueForBytes:length:
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (SEL)valueFactoryMethod
|
|
|
|
|
{
|
|
|
|
|
return _valueFactoryMethod;
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-15 12:52:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* Depending on -adaptorValueType this method checks whether the value
|
|
|
|
|
* is a NSNumber, NSString, NSData or NSDate instance respectively.
|
|
|
|
|
* If not, it attempts to retrieve the -adaptorValueConversionMethod
|
|
|
|
|
* which should be used to convert the value accordingly. If none
|
|
|
|
|
* has been specified and the -adaptorValueType is EOAdaptorBytesType,
|
|
|
|
|
* it tries to convert the value by invoking -archiveData.
|
|
|
|
|
* The EONull instance is not converted.
|
|
|
|
|
* Returns the converted value.
|
|
|
|
|
* Note: This implementation currently raises if -adaptorValueType is of
|
|
|
|
|
* an unknown type or if conversion is necessary but not possible. This
|
|
|
|
|
* maybe contrary to the reference implementation but it seems like useful
|
|
|
|
|
* behavior. If this is causing problems please submit a bug report.
|
|
|
|
|
*/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (id)adaptorValueByConvertingAttributeValue: (id)value
|
|
|
|
|
{
|
2004-05-15 12:52:48 +00:00
|
|
|
|
EOAdaptorValueType adaptorValueType = [self adaptorValueType];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
// No conversion for an EONull value
|
|
|
|
|
if (value != GDL2_EONull)
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
2005-04-19 10:44:49 +00:00
|
|
|
|
BOOL convert = NO;
|
|
|
|
|
|
|
|
|
|
// Find if we need a conversion
|
|
|
|
|
switch (adaptorValueType)
|
|
|
|
|
{
|
2004-05-15 12:52:48 +00:00
|
|
|
|
case EOAdaptorNumberType:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
convert = [value isKindOfClass: GDL2_NSNumberClass] ? NO : YES;
|
2004-05-15 17:57:54 +00:00
|
|
|
|
break;
|
2004-05-15 12:52:48 +00:00
|
|
|
|
case EOAdaptorCharactersType:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
convert = [value isKindOfClass: GDL2_NSStringClass] ? NO : YES;
|
2004-05-15 17:57:54 +00:00
|
|
|
|
break;
|
2004-05-15 12:52:48 +00:00
|
|
|
|
case EOAdaptorBytesType:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
convert = [value isKindOfClass: GDL2_NSDataClass] ? NO : YES;
|
2004-05-15 17:57:54 +00:00
|
|
|
|
break;
|
2004-05-15 12:52:48 +00:00
|
|
|
|
case EOAdaptorDateType:
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
convert = [value isKindOfClass: GDL2_NSDateClass] ? NO : YES;
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
break;
|
2004-05-15 12:52:48 +00:00
|
|
|
|
default:
|
|
|
|
|
[NSException raise: NSInvalidArgumentException
|
|
|
|
|
format: @"Illegal adaptorValueType: %d",
|
|
|
|
|
adaptorValueType];
|
2005-04-19 10:44:49 +00:00
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
// Do value need conversion ?
|
|
|
|
|
if (convert)
|
|
|
|
|
{
|
|
|
|
|
SEL sel;
|
|
|
|
|
sel = [self adaptorValueConversionMethod];
|
|
|
|
|
|
|
|
|
|
if (sel == 0)
|
|
|
|
|
{
|
|
|
|
|
if (adaptorValueType == EOAdaptorBytesType)
|
|
|
|
|
{
|
|
|
|
|
value = [value archiveData];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* This exception might not be conformant, but seems helpful. */
|
|
|
|
|
[NSException raise: NSInvalidArgumentException
|
|
|
|
|
format: @"Value of class: %@ needs conversion "
|
|
|
|
|
@"yet no conversion method specified. "
|
|
|
|
|
@"Attribute is %@. adaptorValueType=%d",
|
|
|
|
|
NSStringFromClass([value class]),
|
|
|
|
|
self,adaptorValueType];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
value = [value performSelector: sel];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2004-05-15 12:52:48 +00:00
|
|
|
|
return value;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Returns method name to use to convert value of a class
|
|
|
|
|
different than attribute adaptor value type.
|
|
|
|
|
|
|
|
|
|
See also: -adaptorValueByConvertingAttributeValue, -adaptorValueConversionMethod
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (NSString *)adaptorValueConversionMethodName
|
|
|
|
|
{
|
|
|
|
|
return _adaptorValueConversionMethodName;
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Returns selector of the method to use to convert value of a class
|
|
|
|
|
different than attribute adaptor value type.
|
|
|
|
|
Default implementation returns selector of method returned by
|
|
|
|
|
adaptorValueConversionMethodName or NULL if there's not selector for the method
|
|
|
|
|
|
|
|
|
|
See also: -adaptorValueByConvertingAttributeValue, -adaptorValueConversionMethodName
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (SEL)adaptorValueConversionMethod
|
|
|
|
|
{
|
|
|
|
|
return _adaptorValueConversionMethod;
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Returns an EOAdaptorValueType describing the adaptor
|
|
|
|
|
(i.e. database) type of data for this attribute.
|
|
|
|
|
|
|
|
|
|
Returned value can be:
|
|
|
|
|
EOAdaptorBytesType Raw bytes (default type)
|
|
|
|
|
EOAdaptorNumberType Number value (attribute valueClass is kind of NSNumber)
|
|
|
|
|
EOAdaptorCharactersType String value (attribute valueClass is kind of NSString)
|
|
|
|
|
EOAdaptorDateType Date value (attribute valueClass is kind of NSDate)
|
|
|
|
|
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (EOAdaptorValueType)adaptorValueType
|
|
|
|
|
{
|
2005-02-15 21:29:24 +00:00
|
|
|
|
if (!_flags.isAttributeValueInitialized)
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
* EOAccess/EOAttribute.m, EOAccess/EODatabaseContext.m,
* EOAccess/EOEntity.m, EOAccess/EOSQLExpression.m
* EOAccess/EOPrivate.h, EOAccess/EOPrivate.m,
* EOAccess/EOSQLQualifier.m, EOAccess/EOUtilities.m
* EOControl/EOClassDescription.m, EOControl/EOEditingContext.m
* EOControl/EOGenericRecord.m, EOControl/EOKeyGlobalID.m
* EOControl/EOKeyValueCoding.m,
* EOControl/EOKeyValueQualifier.m
* EOControl/EOMutableKnownKeyDictionary.m,
* EOControl/EOPrivate.h, EOControl/EOPrivate.m
Unify GDL2 identifiers with GDL2_ prefix. Replace
GDL2NSClass_alloc with GDL2_alloc(NSClass). Replace
GDL2NSClassWith* calls with
AUTORELEASE([GDL2_alloc(NSCLass) initWith* calls]).
Rename GDL2PrivInit to GDL2_PrivateInit.
(GDL2_NSArray, GDL2_NSMutableArray_allocWithZoneIMP)
(GDL2_NSMutableDictionary_allocWithZoneIMP): New globals.
(GDL2_alloc): New macro.
(GDL2NSString_alloc, GDL2NSDecimalNumber_alloc)
(GDL2NSNumber_alloc, GDL2NSCalendarDate_alloc, GDL2NSData_alloc)
(GDL2DataWithBytesAndLength, GDL2MutableArrayWithCapacity)
(GDL2MutableArrayWithArray, GDL2MutableArray, GDL2Array)
(GDL2MutableDictionaryWithCapacity): Remove.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20779 72102866-910b-0410-8b05-ffd578937521
2005-02-22 16:14:03 +00:00
|
|
|
|
Class adaptorClasses[] = { GDL2_NSNumberClass,
|
|
|
|
|
GDL2_NSStringClass,
|
|
|
|
|
GDL2_NSDateClass };
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
EOAdaptorValueType values[] = { EOAdaptorNumberType,
|
|
|
|
|
EOAdaptorCharactersType,
|
|
|
|
|
EOAdaptorDateType };
|
|
|
|
|
Class valueClass = Nil;
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
2005-02-15 21:29:24 +00:00
|
|
|
|
_adaptorValueType = EOAdaptorBytesType;
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < 3 && !_flags.isAttributeValueInitialized; i++)
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
{
|
|
|
|
|
for ( valueClass = [self _valueClass];
|
|
|
|
|
valueClass != Nil;
|
|
|
|
|
valueClass = GSObjCSuper(valueClass))
|
|
|
|
|
{
|
|
|
|
|
if (valueClass == adaptorClasses[i])
|
2005-02-15 21:29:24 +00:00
|
|
|
|
{
|
|
|
|
|
_adaptorValueType=values[i];
|
|
|
|
|
_flags.isAttributeValueInitialized = YES;
|
|
|
|
|
break;
|
|
|
|
|
}
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-15 21:29:24 +00:00
|
|
|
|
_flags.isAttributeValueInitialized = YES;
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
};
|
|
|
|
|
return _adaptorValueType;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
/** Returns the type of argument needed by the factoryMethod.
|
|
|
|
|
|
|
|
|
|
Type can be:
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsNSData
|
|
|
|
|
method need one parameter: a NSData
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsNSString
|
|
|
|
|
method need one parameter: a NSString
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsBytes
|
|
|
|
|
method need 2 parameters (for data type valueClass): a raw bytes buffer and its length
|
|
|
|
|
or 3 parameters (for string type valueClass): a raw bytes buffer, its length and the encoding
|
|
|
|
|
|
|
|
|
|
See also: -valueFactoryMethod, -setFactoryMethodArgumentType:
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (EOFactoryMethodArgumentType)factoryMethodArgumentType
|
|
|
|
|
{
|
|
|
|
|
return _argumentType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributeValueCreationEditing)
|
|
|
|
|
|
2005-04-19 10:44:49 +00:00
|
|
|
|
/** Set the "factory method" name (the method to invoke to create custom class attribute value).
|
|
|
|
|
This method must be a class method returning an autoreleased value of attribute valueClass.
|
|
|
|
|
|
|
|
|
|
See also: -setFactoryMethodArgumentType:
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (void)setValueFactoryMethodName: (NSString *)factoryMethodName
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
ASSIGN(_valueFactoryMethodName, factoryMethodName);
|
|
|
|
|
_valueFactoryMethod = NSSelectorFromString(_valueFactoryMethodName);
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
/** Set method name to use to convert value of a class
|
|
|
|
|
different than attribute adaptor value type.
|
|
|
|
|
|
|
|
|
|
See also: -adaptorValueByConvertingAttributeValue, -adaptorValueConversionMethod,
|
|
|
|
|
-adaptorValueConversionMethodName
|
|
|
|
|
**/
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (void)setAdaptorValueConversionMethodName: (NSString *)conversionMethodName
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
ASSIGN(_adaptorValueConversionMethodName, conversionMethodName);
|
|
|
|
|
|
|
|
|
|
_adaptorValueConversionMethod = NSSelectorFromString(_adaptorValueConversionMethodName);
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
/** Set the type of argument needed by the factoryMethod.
|
|
|
|
|
|
|
|
|
|
Type can be:
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsNSData
|
|
|
|
|
method need one parameter: a NSData
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsNSString
|
|
|
|
|
method need one parameter: a NSString
|
|
|
|
|
|
|
|
|
|
EOFactoryMethodArgumentIsBytes
|
|
|
|
|
method need 2 parameters (for data type valueClass): a raw bytes buffer and its length
|
|
|
|
|
or 3 parameters (for string type valueClass): a raw bytes buffer, its length and the encoding
|
|
|
|
|
|
|
|
|
|
See also: -setValueFactoryMethodName:, -factoryMethodArgumentType
|
|
|
|
|
**/
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (void)setFactoryMethodArgumentType: (EOFactoryMethodArgumentType)argumentType
|
|
|
|
|
{
|
2005-02-18 16:46:38 +00:00
|
|
|
|
[self willChange];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
_argumentType = argumentType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributeValueMapping)
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
/** Validates value pointed by valueP, may set changed validated value in
|
|
|
|
|
valueP and return an validation exception if constraints validation fails.
|
|
|
|
|
valueP must not be NULL.
|
|
|
|
|
|
|
|
|
|
More details:
|
|
|
|
|
1. raise an exception if [self allowsNull] == NO but *valueP is nil or EONull
|
|
|
|
|
except if attribute is a primaryKey attribute (reason of this process
|
|
|
|
|
exception is currently unknown).
|
|
|
|
|
|
|
|
|
|
2. if valueClassName isn't set, return nil and leave *valueP unchanged
|
|
|
|
|
|
|
|
|
|
3. if it can't find the class by name, log message, return nil and
|
|
|
|
|
leave *valueP unchanged
|
|
|
|
|
|
|
|
|
|
4. do the fancy type conversions as necessary (Pretty much the current
|
|
|
|
|
handling we have)
|
|
|
|
|
|
|
|
|
|
5. THEN if width is not 0 call adaptorValueByConvertingAttributeValue:
|
|
|
|
|
on the new value and the if returned value is NSString or NSData
|
|
|
|
|
validate length with width and return a corresponding exception
|
|
|
|
|
if it's longer than allowed.
|
|
|
|
|
**/
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
- (NSException *)validateValue: (id*)valueP
|
|
|
|
|
{
|
|
|
|
|
NSException *exception=nil;
|
|
|
|
|
|
|
|
|
|
NSAssert(valueP, @"No value pointer");
|
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
NSDebugMLog(@"In EOAttribute validateValue: value (class=%@) = %@ attribute = %@",
|
|
|
|
|
[*valueP class],*valueP,self);
|
|
|
|
|
|
|
|
|
|
// First check if value is nil or EONull
|
|
|
|
|
if (_isNilOrEONull(*valueP))
|
2002-11-15 22:57:05 +00:00
|
|
|
|
{
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// Check if this is not allowed
|
|
|
|
|
if ([self allowsNull] == NO)
|
|
|
|
|
{
|
|
|
|
|
NSArray *pkAttributes = [[self entity] primaryKeyAttributes];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// "Primary key attributes are ignored when enforcing allowsNull
|
|
|
|
|
// property for attributes. The values could be handled later
|
|
|
|
|
// by automatic PK-generation later
|
|
|
|
|
if ([pkAttributes indexOfObjectIdenticalTo: self] == NSNotFound)
|
|
|
|
|
{
|
|
|
|
|
exception =
|
|
|
|
|
[NSException
|
|
|
|
|
validationExceptionWithFormat:
|
|
|
|
|
@"attribute '%@' of entity '%@' cannot be nil or EONull ",
|
|
|
|
|
[self name],[[self entity] name]];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else // There's a value.
|
|
|
|
|
{
|
|
|
|
|
NSString* valueClassName=[self valueClassName];
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
2005-04-24 11:28:15 +00:00
|
|
|
|
// if there's no valueClassName, leave the value unchanged
|
|
|
|
|
// and don't return an exception
|
|
|
|
|
|
|
|
|
|
if (valueClassName)
|
|
|
|
|
{
|
|
|
|
|
Class valueClass=[self _valueClass];
|
|
|
|
|
|
|
|
|
|
// There's a className but no class !
|
|
|
|
|
if (!valueClass)
|
|
|
|
|
{
|
|
|
|
|
//Log this problem, leave the value unchanged
|
|
|
|
|
// and don't return an exception
|
|
|
|
|
NSLog(@"No valueClass for valueClassName '%@' in attribute %@",
|
|
|
|
|
valueClassName,self);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
unsigned int width = 0;
|
|
|
|
|
IMP isKindOfClassIMP=[*valueP methodForSelector:@selector(isKindOfClass:)];
|
|
|
|
|
|
|
|
|
|
// If the value has not the good class we'll try to convert it
|
|
|
|
|
if ((*isKindOfClassIMP)(*valueP,@selector(isKindOfClass:),
|
|
|
|
|
valueClass) == NO)
|
|
|
|
|
{
|
|
|
|
|
// Is it a string ?
|
|
|
|
|
if ((*isKindOfClassIMP)(*valueP,@selector(isKindOfClass:),
|
|
|
|
|
GDL2_NSStringClass))
|
|
|
|
|
{
|
|
|
|
|
if (valueClass == GDL2_NSNumberClass)
|
|
|
|
|
{
|
|
|
|
|
char valueTypeChar=[self _valueTypeChar];
|
|
|
|
|
switch(valueTypeChar)
|
|
|
|
|
{
|
|
|
|
|
case 'i':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithInt:
|
|
|
|
|
[*valueP intValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
2003-10-23 15:06:51 +00:00
|
|
|
|
|
2005-02-13 13:04:19 +00:00
|
|
|
|
case 'I':
|
2005-04-24 11:28:15 +00:00
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithUnsignedInt:
|
2005-02-13 13:04:19 +00:00
|
|
|
|
[*valueP unsignedIntValue]];
|
2005-04-24 11:28:15 +00:00
|
|
|
|
AUTORELEASE(*valueP);
|
2005-02-13 13:04:19 +00:00
|
|
|
|
break;
|
2005-04-24 11:28:15 +00:00
|
|
|
|
|
|
|
|
|
case 'c':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithChar:
|
|
|
|
|
[*valueP intValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'C':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithUnsignedChar:
|
|
|
|
|
[*valueP unsignedIntValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithShort:
|
|
|
|
|
[*valueP shortValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'S':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithUnsignedShort:
|
|
|
|
|
[*valueP unsignedShortValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'l':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithLong:
|
|
|
|
|
[*valueP longValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'L':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithUnsignedLong:
|
|
|
|
|
[*valueP unsignedLongValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'u':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithLongLong:
|
|
|
|
|
[*valueP longLongValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'U':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithUnsignedLongLong:
|
|
|
|
|
[*valueP unsignedLongLongValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'f':
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithFloat:
|
|
|
|
|
[*valueP floatValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
*valueP = [GDL2_alloc(NSNumber)
|
|
|
|
|
initWithDouble:
|
|
|
|
|
[*valueP doubleValue]];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
break;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (valueClass == GDL2_NSDecimalNumberClass)
|
|
|
|
|
{
|
|
|
|
|
*valueP = [GDL2_alloc(NSDecimalNumber)
|
|
|
|
|
initWithString: *valueP];
|
|
|
|
|
AUTORELEASE(*valueP);
|
|
|
|
|
}
|
|
|
|
|
else if (valueClass == GDL2_NSDataClass)
|
|
|
|
|
{
|
|
|
|
|
//TODO Verify here.
|
|
|
|
|
*valueP = [*valueP
|
|
|
|
|
dataUsingEncoding:
|
|
|
|
|
[NSString defaultCStringEncoding]];
|
|
|
|
|
}
|
|
|
|
|
else if (valueClass == GDL2_NSCalendarDateClass)
|
|
|
|
|
{
|
|
|
|
|
*valueP = AUTORELEASE([(GDL2_alloc(NSCalendarDate))
|
|
|
|
|
initWithString: *valueP]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Now, test width if any
|
|
|
|
|
width = [self width];
|
|
|
|
|
|
|
|
|
|
if (width>0)
|
|
|
|
|
{
|
|
|
|
|
// First convert value to adaptor value
|
|
|
|
|
id testValue = [self adaptorValueByConvertingAttributeValue: *valueP];
|
|
|
|
|
|
|
|
|
|
if (testValue)
|
|
|
|
|
{
|
|
|
|
|
IMP testIsKindOfClassIMP=[testValue methodForSelector:@selector(isKindOfClass:)];
|
|
|
|
|
|
|
|
|
|
// We can test NSString and NSData type only
|
|
|
|
|
if ((*testIsKindOfClassIMP)(testValue,@selector(isKindOfClass:),
|
|
|
|
|
GDL2_NSStringClass)
|
|
|
|
|
|| (*testIsKindOfClassIMP)(testValue,@selector(isKindOfClass:),
|
|
|
|
|
GDL2_NSDataClass))
|
|
|
|
|
{
|
|
|
|
|
unsigned int testValueLength = [testValue length];
|
|
|
|
|
if (testValueLength > width)
|
|
|
|
|
{
|
|
|
|
|
exception = [NSException validationExceptionWithFormat:
|
|
|
|
|
@"Value %@ for attribute '%@' is too large",
|
|
|
|
|
testValue,[self name]];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-11-15 22:57:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return exception;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation NSObject (EOCustomClassArchiving)
|
|
|
|
|
|
|
|
|
|
+ objectWithArchiveData: (NSData *)data
|
|
|
|
|
{
|
|
|
|
|
return [NSUnarchiver unarchiveObjectWithData:data];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSData *)archiveData
|
|
|
|
|
{
|
|
|
|
|
return [NSArchiver archivedDataWithRootObject:self];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributePrivate)
|
|
|
|
|
|
|
|
|
|
- (void)setParent: (id)parent
|
|
|
|
|
{
|
|
|
|
|
//OK
|
|
|
|
|
[self willChange];
|
2004-09-07 15:57:21 +00:00
|
|
|
|
_parent = parent;
|
2002-11-15 22:57:05 +00:00
|
|
|
|
|
|
|
|
|
_flags.isParentAnEOEntity = [_parent isKindOfClass: [EOEntity class]];//??
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (EOAttribute *)realAttribute
|
|
|
|
|
{
|
|
|
|
|
return _realAttribute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (GCMutableArray *)_definitionArray
|
|
|
|
|
{
|
|
|
|
|
return _definitionArray;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-23 15:06:51 +00:00
|
|
|
|
- (Class)_valueClass
|
|
|
|
|
{
|
|
|
|
|
if (_valueClass)
|
|
|
|
|
return _valueClass;
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
else if ([self isFlattened])
|
2003-10-23 15:06:51 +00:00
|
|
|
|
return [[_definitionArray realAttribute] _valueClass];
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
else
|
|
|
|
|
return [_prototype _valueClass];
|
2003-10-23 15:06:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
COmmit Part 2
* EOAccess/EOAdaptor.m:
o optimization in 'for' loops
* EOAccess/EODatabase.m:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAccess/EODatabaseContext.h:
o added _snapshotForGlobalIDIMP
* EOAccess/EODatabaseContext.m:
o commented NSEmitTODO in
-objectsForSourceGlobalID:relationshipName:editingContext:
o added beter exception format in
qualifierForLockingAttributes:primaryKeyAttributes:entity:snapshot:
o fix compiler warning in -relayPrimaryKey:object:entity:
o logs
o optimizations in -objectsWithFetchSpecification:editingContext:
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o use _snapshotForGlobalIDIMP
o IMP usage optimization
* EOAccess/EOAttribute.[hm]:
o added EOAdaptorUnknownType
o added _adaptorValueType and avoid recomputing it each time
o added _valueTypeChar to avoid string comparaisons
o use EOPriv classes declarations
o Temporary reverted David changes in
-adaptorValueByConvertingAttributeValue
* EOAccess/EOAttributePriv.h:
o added _valueTypeChar to avoid string comparaisons
* EOAccess/EOEntityPriv.h:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.h:
o moved private -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
* EOAccess/EOEntity.m:
o better exception in classProperties
o fix compiler warning in -setClassProperties:,
-setPrimaryKeyAttributes:,
-setAttributesUsedForLocking:
o moved -attributeForPath: and -relationshipForPath: to
EOEntityGDL2Additions category
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLExpression.m:
o optimization in -tableListWithRootEntity:
o optimization in -formatSQLString:format:
o optimization in +sqlPatternFromShellPattern:
o optimization in +sqlPatternFromShellPattern:withEscapeCharacter:
o fix in -sqlStringForKeyValueQualifier:
o added log in -sqlStringForKeyValueQualifier: for not handled
readFormat
o added log -addInsertListAttribute:value: for not handled
writeFormat
o added log -addUpdateListAttribute:value: for not handled
writeFormat
o changed EOFLOGObjectFnStart to EOFLOGObjectFnStartCond
o changed EOFLOGObjectFnStop to EOFLOGObjectFnStopCond
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAccess/EOSQLQualifier.m:
o implemented EOKeyComparisonQualifier
-schemaBasedQualifierWithRootEntity
* EOAccess/EOUtilities.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOControl/EOPriv.[hm]:
o added. Contains various classes/selectors/IMPs
* EOControl/EOClassDescription.m:
o handle EONull case in -propagateDeleteForObject:editingContext:,
-addObject:toPropertyWithKey:, -snapshot,
-removeObject:fromPropertyWithKey:,
_setObject:forBothSidesOfRelationshipWithKey:,
addObject:toBothSidesOfRelationshipWithKey:,
-removeObject:fromBothSidesOfRelationshipWithKey:
o fix compiler warning in
-dictionaryForInstanceProperties, -shallowCopy,
-updateFromSnapshot:, -snapshot
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o replaced isNilOrEONull() by _isNilOrEONull()
o fix in -validateForSave
o rewritten -validateValue:forKey: selector build
* EOControl/EOEditingContext.h:
o added -hasUnprocessedChanges
* EOControl/EOEditingContext.m:
o added -hasUnprocessedChanges
o added NS_DURING,... to catch exceptions
o replace [EOFault isFault:] by _isFault()
o IMP usage optimization
* EOControl/EOKeyGlobalID.m:
o replaced isNilOrEONull() by _isNilOrEONull()
o include <EOCOntrol/EOPriv.h>
* EOControl/EOGenericRecord.m:
o partially rewritten -description
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
o replace [EOFault isFault:] by _isFault()
o changed variable name type of
_infoForInstanceVariableNamed:retType:retSize:retOffset:
o rewritten valueForKey:,... to use cString NSKeyValueCoding
* EOControl/EOKeyValueCoding.m:
o changed NSAssert in NSArray -valueForKey:
o optimization in NSDictionary -takeValue:forKeyPath:isSmart:
o optimization in NSDictionary -takeStoredValue:forKeyPath:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOKeyValueQualifier.m:
o fixes for EONull/nil in -evaluateWithObject:
o replaced [EONull null] by GDL2EONull
o include <EOCOntrol/EOPriv.h>
* EOControl/EOSortOrdering.m:
o include <EOCOntrol/EOPriv.h>
o replaced [EONull null] by GDL2EONull
* EOAdaptors/Postgres95SQLExpression.m:
o float formatting in +formatValue:forAttribute:
o added -externalNameQuoteCharacter
o added +sqlPatternFromShellPattern:
o added +sqlPatternFromShellPattern:withEscapeCharacter:
o replaced isNilOrEONull() by _isNilOrEONull()
* EOAdaptors/Postgres95Channel.m:
o logs
* EOAdaptors/Postgres95Values.m:
o logs
o fix in +setPostgres95Format:
o fix calendard format to handle timezone (%z)
o optimizations
* EOControl/EOMutableKnownKeyDictionary.m
o removed EOMKKDArrayMapping
+dictionaryFromDictionary:subsetMapping:
o include <EOCOntrol/EOPriv.h>
o replaced isNilOrEONull() by _isNilOrEONull()
* EOControl/EONSAddOns.[hm]:
o added NSString(ShellPattern)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20688 72102866-910b-0410-8b05-ffd578937521
2005-02-11 17:37:23 +00:00
|
|
|
|
- (char)_valueTypeChar
|
|
|
|
|
{
|
|
|
|
|
char valueTypeChar=_valueTypeChar;
|
|
|
|
|
if (valueTypeChar=='\0')
|
|
|
|
|
{
|
|
|
|
|
// Compute it
|
|
|
|
|
NSString* valueType=[self valueType];
|
|
|
|
|
if ([valueType length]==1)
|
|
|
|
|
valueTypeChar=(char)[valueType characterAtIndex:0];
|
|
|
|
|
}
|
|
|
|
|
return valueTypeChar;
|
|
|
|
|
};
|
|
|
|
|
|
2002-11-15 22:57:05 +00:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation EOAttribute (EOAttributePrivate2)
|
|
|
|
|
|
|
|
|
|
- (BOOL) _hasAnyOverrides
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd]; //TODO
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) _resetPrototype
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd]; //TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) _updateFromPrototype
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd]; //TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) _setOverrideForKeyEnum: (int)keyEnum
|
|
|
|
|
{
|
|
|
|
|
//[self notImplemented:_cmd]; //TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) _isKeyEnumOverriden: (int)param0
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd]; //TODO
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) _isKeyEnumDefinedByPrototype: (int)param0
|
|
|
|
|
{
|
|
|
|
|
[self notImplemented: _cmd]; //TODO
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
2003-10-23 15:06:51 +00:00
|
|
|
|
|