# EOAttribute Class

mirko.viviani@gmail.com
mguesdon@orange-concept.com
Generated at 2026-02-03 22:13:20 +0000

2000-2002,2003,2004,2005 Free Software Foundation, Inc.
Software documentation for the EOAttribute class
EOAccess/EOAttribute.h
EOPropertyListEncoding
Description forthcoming.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
First char of _valueType or \0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Description forthcoming.
attributeWithParent:
parent
definition:
def
returns an autoreleased attribute
attributeWithPropertyList:
propertyList
owner:
owner
returns an autoreleased attribute owned by onwer and built from propertyList
allowsNull
Description forthcoming.
columnName
Description forthcoming.
definition
Description forthcoming.
docComment
Description forthcoming.
entity
4.5 Docs say: Returns the entity that owns the attribute, or `nil` if this attribute is acting as an argument for a stored procedure. 5.x returns the parent
externalType

Returns the adaptor specific name of externalType. This is the name use during SQL generation.

If the externalType has not been set explicitly and the reciever -isFlattened , the valueClassName of the flattened attribute is returned.

Otherwise, if the reciever has a prototype then the externalType of the prototype is returned.

If all that fails, this method returns `nil`.

isDerived
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.
isFlattened
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.
isReadOnly
Description forthcoming.
name
Description forthcoming.
parameterDirection
Description forthcoming.
parent
Description forthcoming.
precision
Description forthcoming.
prototype
Description forthcoming.
prototypeName
Description forthcoming.
readFormat
Description forthcoming.
referencesProperty:
aProperty
Returns `YES` if the attribute references aProperty, `NO` otherwise.
relationshipPath
Description forthcoming.
scale
Description forthcoming.
setEntity:
entity
Description forthcoming.
setParent:
parent
Description forthcoming.
storedProcedure
Description forthcoming.
targetAttribute
Description forthcoming.
userInfo
Description forthcoming.
valueClassName

Returns the name of the class values of this attribute are represented by. The standard classes are NSNumber, NSString, NSData and NSDate for the corresponding -adaptorValueType . A model can define more specific classes like NSDecimalNumber, NSCalendarDate and NSImage or custom classes which implement a factory method specified by [-valueFactoryMethodName] to create instances with the data supplied by the data source.

If the valueClassName has not been set explicitly and the reciever -isFlattened , the valueClassName of the flattened attribute is returned.

Otherwise, if the reciever has a prototype then the valueClassName of the prototype is returned.

If all that fails, this method returns `nil`.

See also:[setValueClassName:]

valueType

Returns a one character string identifiying the underlying C type of an NSNumber -valueType . The legal values in GDL2 are:

@"c": char
@"C": unsigned char
@"s": short
@"S": unsigned short
@"i": int
@"I": unsigned int
@"l": long
@"L": unsigned long
@"u": long long
@"U": unsigned long long
@"f": float
@"d": double

If the valueType has not been set explicitly and the reciever -isFlattened , the valueClassName of the flattened attribute is returned.

Otherwise, if the reciever has a prototype then the valueType of the prototype is returned.

If all that fails, this method returns `nil`.

width
Description forthcoming.
writeFormat
Description forthcoming.
Software documentation for the EOAttribute(EOAttributeEditing) category
EOAccess/EOAttribute.h
Description forthcoming.
_normalizeDefinition:
definition
path:
path
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
setAllowsNull:
allowsNull
Description forthcoming.
setColumnName:
columnName
Description forthcoming.
setDefinition:
definition

Sets the definition of a derived attribute.

An EOAttribute can either reference column from the entites external representation or define a derived attribute such a cacluclated value or a key path. The values to these attributes are cached in memory.

To set the definition of an attribute, the attribute must already be contained by its parent entity.

Setting the the definition clears the column name.

setDocComment:
docComment
Description forthcoming.
setExternalType:
type
Description forthcoming.
setInternalInfo:
dictionary
Description forthcoming.
setName:
name
Description forthcoming.
setParameterDirection:
parameterDirection
Description forthcoming.
setPrecision:
precision
Description forthcoming.
setPrototype:
prototype
Description forthcoming.
setReadFormat:
string
Description forthcoming.
setReadOnly:
yn
Description forthcoming.
setScale:
scale
Description forthcoming.
setUserInfo:
dictionary
Description forthcoming.
setValueClassName:
name
Description forthcoming.
setValueType:
type
Description forthcoming.
setWidth:
length
Description forthcoming.
setWriteFormat:
string
Description forthcoming.
validateName:
name
Description forthcoming.
Software documentation for the EOAttribute(EOAttributeValueCreation) category
EOAccess/EOAttribute.h
Description forthcoming.
adaptorValueByConvertingAttributeValue:
value
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.
adaptorValueConversionMethod

Returns selector of the method to use to convert value of a class different than attribute adaptor value type.

The default implementation returns the selector corresponding to [-adaptorValueConversionMethodName] or NULL if there's not selector for the method.

See also: -adaptorValueByConvertingAttributeValue:, [-adaptorValueConversionMethodName]
adaptorValueConversionMethodName

Returns method name to use to convert value of a class different than attribute adaptor value type.

See also: -adaptorValueByConvertingAttributeValue:, [-adaptorValueConversionMethod]
adaptorValueType

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)
factoryMethodArgumentType
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:
newDateForYear:
year
month:
month
day:
day
hour:
hour
minute:
minute
second:
second
millisecond:
millisecond
timezone:
timezone
zone:
zone
Returns an NSCalendarDate object 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. Milliseconds are dropped since they cannot be easily be stored in NSCalendarDate.
newValueForBytes:
bytes
length:
length
Returns an NSData or a custom-class value object 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. NB: The documentation of the reference implementation mistakenly claims that it returns an NSString.
newValueForBytes:
bytes
length:
length
encoding:
encoding
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.
valueFactoryMethod

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:]
valueFactoryMethodName

Returns the name of the method to use for creating a custom class value for this attribute.

See Also: -valueFactoryMethod , [-newValueForBytes:length:]
Software documentation for the EOAttribute(EOAttributeValueCreationEditing) category
EOAccess/EOAttribute.h
Description forthcoming.
setAdaptorValueConversionMethodName:
conversionMethodName

Set method name to use to convert value of a class different than attribute adaptor value type.

See also: -adaptorValueByConvertingAttributeValue:, -adaptorValueConversionMethod, [-adaptorValueConversionMethodName]
setFactoryMethodArgumentType:
argumentType
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
setValueFactoryMethodName:
factoryMethodName
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:
Software documentation for the EOAttribute(EOAttributeValueMapping) category
EOAccess/EOAttribute.h
Description forthcoming.
validateValue:
valueP
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.
Software documentation for the EOAttribute(EOModelBeautifier) category
EOAccess/EOAttribute.h
Description forthcoming.
beautifyName
Description forthcoming.
Software documentation for the EOAttribute(NSCalendarDateSupport) category
EOAccess/EOAttribute.h
Description forthcoming.
serverTimeZone
Description forthcoming.
Software documentation for the EOAttribute(NSCalendarDateSupportEditing) category
EOAccess/EOAttribute.h
Description forthcoming.
setServerTimeZone:
tz
Description forthcoming.
Software documentation for the NSObject(EOCustomClassArchiving) category
EOAccess/EOAttribute.h
Description forthcoming.
objectWithArchiveData:
data
Description forthcoming.
archiveData
Description forthcoming.
EOAttribute types

Description forthcoming. Description forthcoming. Description forthcoming.