| 
WebObjects 5.2.2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
  |
  +--com.webobjects.eoaccess.EOProperty
        |
        +--com.webobjects.eoaccess.EOAttribute
An EOAttribute represents a column, field, or property in a database and associates an internal name with an external name or expression by which the property is known to the database. The property an EOAttribute represents may be a meaningful value, such as a salary or a name, or it may be an arbitrary value used for identification but with no real-world applicability (ID numbers and foreign keys for relationships fall into this category). An EOAttribute also maintains type information for binding values to the instance variables of objects. In addition, EOAttributes are used to represent arguments for EOStoredProcedures.
You usually define attributes in the EOModel with the EOModeler application. Your code probably won't need to interact programmatically with EOAttribute unless you are working at the adaptor level.
An attribute may be simple, derived, or flattened. A simple attribute
 typically corresponds to a single column in the database, and may be read
 or updated directly from or to the database. A simple EOAttribute may also
 be set as read-only with the setReadOnly method. Read-only
 attributes of Enterprise Objects are never updated.
A derived attribute is an attribute that does not correspond to a single column or field in the database. A derived attribute is usually created by simply modifying a non-derived attribute, for example, by performing a mathematical operation or appending a string. Some examples of derived attribute external names are "commision / 2" or "salary + overtime". Derived attributes are read-only. Since they don't correspond to actual values in the database, it makes no sense to write a derived value.
Creating a Simple AttributeA simple attribute needs at least the following characteristics:
You also have to set whether the attribute is part of its entity's primary key, is a class property, or is used for locking. See the EOEntity class description for more information.
Creating a Derived AttributeA derived attribute depends on another attribute, so you base it on a definition including that attribute's name rather than on an external name. Because a derived attribute isn't mapped directly to anything in the database, you shouldn't include it in the entity's set of primary key attributes or attributes used for locking.
Creating a Flattened AttributeA flattened attribute depends on a relationship, so you base it on a definition including that relationship's name rather than on an external name. Because a flattened attribute doesn't correspond directly to anything in its entity's table, you don't have to specify an external name, and shouldn't include it in the entity's set of primary key attributes or attributes used for locking.
Instead of flattening attributes in your model, a better approach is often to directly traverse the object graph through relationships.
Every EOAttribute has an external type, which is the type used by the
 database to store its associated data, and a Java class used as the type
 for that data in the client application. The type used by the database is
 accessed with the setExternalType and externalType
 methods. You can map database types to a set of standard value classes, which includes:
java.math.BigDecimalDatabase-specific adaptors automatically handle value conversions for these classes. You can also create your own custom value class, so long as you define a format that it uses to interpret data.
The handling of dates assumes by default that both the database
 server and the client application are running in the local time
 zone. You can alter the time zone that is assumed for the database server
 with the setServerTimeZone method. If you alter the server time 
 zone, the adaptor automatically converts dates as they pass into and out of the server.
When you create a new model, EOModeler maps each attribute in the 
 model to one of the primitive data types that the adaptor knows how to
 manipulate: String, Number, java.math.BigDecimal, NSData, 
 and NSTimestamp. For example, suppose you have a photo attribute
 that is stored in the database as a LONG RAW. When you create a new 
 model, this attribute is mapped to NSData. However, NSData is just an 
 object wrapper for binary data. It doesn't have any methods for 
 operating on images, which would limit what you could do with the image
 in your application. In such a case, you would probably choose to use a
 custom data type, such as com.apple.cocoa.NSImage.
For a custom data type to be usable in Enterprise Objects Framework, it must supply methods for importing and exporting itself as one of the primitive types so that it can be read from and written to the database. Specifically, to use a custom data type you need to do the following:
setValueClassName.setValueFactoryMethodName.setFactoryMethodArgumentType.setAdaptorValueConversionMethodName. This enables 
         the data to be stored in the database.If an EOAttribute represents a binary column in the database, the
 factory method argument type can be either
 FactoryMethodArgumentIsData or
 FactoryMethodArgumentIsBytes, indicating that the method
 takes an NSData object or raw bytes as an argument. If the EOAttribute
 represents a string or character column, the factory method argument
 type can be either FactoryMethodArgumentIsString or
 FactoryMethodArgumentIsBytes, indicating that the method
 takes a String object or raw bytes as an argument. These types apply
 when fetching custom values.
Instead of setting the class information programmatically, you can
 use the Attributes Inspector in EOModeler, which is the more common approach.
 
 
Custom values are created during fetching in EOAdaptorChannel's
 fetchRow method. This method fetches data in the external (server) type and
 converts it to a value object, applying the custom value factory method,
 valueFactoryMethod, to convert the value into the custom class if necessary.
 Once the value is converted, the EOAdaptorChannel puts it into the
 dictionary for the row being fetched.
Custom values are converted back to binary or character data in
 EOAdaptorChannel's evaluateExpression method. For each value in the
 EOSQLExpression to be evaluated, the EOAdaptorChannel sends the
 appropriate EOAttribute an adaptorValueByConvertingAttributeValue
 message to convert it. If the value is any of the standard value
 classes, it is returned unchanged. If the value is of a custom class,
 it is converted by applying the conversion method adaptorValueConversionMethod
 specified in the EOAttribute.
In addition to mapping database values to object values, an EOAttribute
 can alter the way values are selected, inserted, and updated in the database
 by defining special format strings. These format strings allow a client
 application to extend its reach right down to the server for certain
 operations. For example, you might want to view an employee's salary on
 a yearly basis, without defining a derived attribute as in a previous
 example. In this case, you could set the salary attribute's SELECT statement
 format to "salary *  12" using setReadFormat and the INSERT and
 UPDATE statement formats to "salary / 12" using setWriteFormat.
 Whenever the application retrieves values for the salary attribute, the fetched values
 are multiplied by 12, and when it writes values back to the database, the values are
 divided by 12.
Your application can use any legal SQL value expression in a format string,
 and can even access server-specific features such as functions and stored
 procedures (see EOEntity's setStoredProcedure method description for more
 information). Accessing server-specific features can offer the application
 great flexibility in dealing with its server, but does limit its portability.
 You are responsible for ensuring that the SQL is well-formed and will be
 understood by the database server.
Format strings for setReadFormat should use "%P" as the 
 substitution character for the value that is being formatted; format strings for
 setWriteFormat should use "%V" as the substitution character
 for the value that is being formatted. The "%@" character will not work. 
 For example:
     myAttribute.setReadFormat("TO_UPPER(%P)");
     myAttribute.setWriteFormat("TO_LOWER(%V)");
 
 Instead of setting the read and write formats programmatically, you can set them in EOModeler, which is the more common approach.
FactoryMethodArgumentIsData, 
FactoryMethodArgumentIsBytes, 
FactoryMethodArgumentIsString, 
setReadOnly(boolean flag), 
setExternalType(String typeName), 
externalType(), 
valueClassName(), 
setServerTimeZone(TimeZone tz), 
setValueClassName(String name), 
setValueFactoryMethodName(String factoryMethodName), 
setFactoryMethodArgumentType(int argumentType), 
setAdaptorValueConversionMethodName(String conversionMethodName), 
setReadFormat(String string), 
setWriteFormat(String string), 
EOEntity.setStoredProcedure(EOStoredProcedure storedProcedure
    , String operation)| Field Summary | |
static int | 
AdaptorBytesType
Integer constant returned by the method adaptorValueType. | 
static int | 
AdaptorCharactersType
Integer constant returned by the method adaptorValueType. | 
static int | 
AdaptorDateType
Integer constant returned by the method adaptorValueType. | 
static int | 
AdaptorNumberType
Integer constant returned by the method adaptorValueType. | 
static int | 
FactoryMethodArgumentIsBytes
Integer constant used with the methods factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, an array of bytes. | 
static int | 
FactoryMethodArgumentIsData
Integer constant used with the methods factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, a binary (NSData) argument. | 
static int | 
FactoryMethodArgumentIsString
Integer constant used with the methods factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, a String argument. | 
static int | 
InOutParameter
Integer constant representing one of four possible parameter directions for EOAttributes that represent arguments to a stored procedure.  | 
static int | 
InParameter
Integer constant representing one of four possible parameter directions for EOAttributes that represent arguments to a stored procedure.  | 
static int | 
OutParameter
Integer constant representing one of four possible parameter directions for EOAttributes that represent arguments to a stored procedure.  | 
static int | 
Void
Integer constant representing one of four possible parameter directions for EOAttributes that represent arguments to a stored procedure.  | 
| Constructor Summary | |
  | 
EOAttribute()
 | 
protected  | 
EOAttribute(EOEntity entity,
            String definition)
 | 
  | 
EOAttribute(NSDictionary plist,
            Object owner)
Creates an EOAttribute object with the state specified in plist whose parent is owner. | 
| Method Summary | |
 Object | 
adaptorValueByConvertingAttributeValue(Object value)
Checks that the type of value is one of the following 
 primitive adaptor types:  String, Number, NSData, or NSTimestamp. | 
 NSSelector | 
adaptorValueConversionMethod()
Returns the method used to convert a custom class into one of the primitive types that the adaptor knows how to manipulate: String, Number, NSData, or NSTimestamp.  | 
 String | 
adaptorValueConversionMethodName()
Returns the name of the method used to convert a custom class into one of the primitive types that the adaptor knows how to manipulate: String, Number, NSData, or NSTimestamp.  | 
 int | 
adaptorValueType()
Returns a constant that indicates the data type that will be fetched from the database.  | 
 boolean | 
allowsNull()
Returns true if the attribute can have a
 null value, false otherwise. | 
 void | 
awakeWithPropertyList(NSDictionary plist)
Finishes initializing the receiver from plist. | 
 void | 
beautifyName()
Makes the attribute's name conform to the Enterprise Objects Framework's naming convention.  | 
 String | 
className()
Returns the fully qualified Java class name of the attribute, for example "java.lang.String".  | 
 String | 
columnName()
Returns the name of the column in the database that corresponds to this attribute, or null if the attribute isn't simple (that is,
 if it's a derived or flattened attribute). | 
 String | 
definition()
Returns the definition of a derived or flattened attribute or null if the attribute is simple. | 
 void | 
encodeIntoPropertyList(NSMutableDictionary result)
Encodes the receiver as a property list.  | 
 EOEntity | 
entity()
Returns the entity that owns the attribute, or null
 if this attribute is acting as an argument for a stored procedure. | 
 String | 
externalType()
Returns the attribute's type as understood by the database.  | 
 int | 
factoryMethodArgumentType()
Returns the type of argument that should be passed to the "factory method" which is invoked by the attribute to create an attribute value for a custom class.  | 
 boolean | 
isDerived()
Returns true if the attribute does not correspond 
 exactly to one column in a table, false otherwise. | 
 boolean | 
isFlattened()
Returns true if the attribute is flattened,
 false otherwise. | 
 boolean | 
isReadOnly()
Returns true if the value of the attribute can not be
 modified, false if it can. | 
 String | 
name()
Returns the internal name of the attribute.  | 
 Object | 
newValueForBytes(byte[] bytes,
                 int length)
Called by the adaptor during value creation while fetching from the database.  | 
 Object | 
newValueForBytesString(byte[] bytes,
                       int length)
Deprecated.  | 
 Object | 
newValueForImmutableBytes(byte[] bytes)
Called by the adaptor during value creation while fetching from the database.  | 
 Object | 
newValueForString(String str)
Called by the adaptor during value creation while fetching from the database.  | 
 boolean | 
overridesPrototypeDefinitionForKey(String key)
Returns true if the attribute has an override,
 false if the requested key gets its value from the
 prototype attribute. | 
 int | 
parameterDirection()
Returns the parameter direction for attributes that are arguments to a stored procedure.  | 
 Object | 
parent()
Returns the attribute's parent, which is either an EOEntity or an EOStoredProcedure.  | 
 int | 
precision()
Returns the precision of the database representation of attributes with a numeric type, i.e., Number or java.math.BigDecimal.  | 
 EOAttribute | 
prototype()
Returns the prototype attribute that is used to define default settings for the receiver, or null
 | 
 String | 
prototypeName()
Returns the name of the prototype attribute of the receiver, or null if there is none. | 
 String | 
readFormat()
Returns a format string used to appropriately format the attribute's value when it is read from the database.  | 
 String | 
relationshipPath()
Returns the relationship path for flattened attributes, or null if the receiver is not a flattened attribute. | 
 int | 
scale()
Returns the scale of the database representation for attributes with a numeric type, i.e., Number or java.math.BigDecimal.  | 
 TimeZone | 
serverTimeZone()
Returns the time zone assumed for dates in the database server, or the local time zone if one hasn't been set.  | 
 void | 
setAdaptorValueConversionMethodName(String conversionMethodName)
Sets the name of the method used to convert a custom class to a primitive type to conversionMethodName. | 
 void | 
setAllowsNull(boolean allowsNull)
Sets whether or not the attribute can have a null value
 to allowsNull. | 
 void | 
setClassName(String name)
Sets the name of the attribute's class to name. | 
 void | 
setColumnName(String columnName)
Sets the name of the database column that corresponds with this attribute to columnName. | 
 void | 
setDefinition(String definition)
Sets the attribute's definition to definition. | 
 void | 
setExternalType(String string)
Sets the type of the attribute, as recognized by the database adaptor and the database server, to string. | 
 void | 
setFactoryMethodArgumentType(int argumentType)
Sets the type of argument that should be passed to the factory method, which is invoked by the attribute to create a value for a custom class.  | 
 void | 
setName(String name)
Sets the attribute's name to name, which can not
 be a name that is already in use by an attribute or relationship
 belonging to the same entity as the receiver. | 
 void | 
setParameterDirection(int parameterDirection)
Sets the parameter direction for attributes that are arguments to a stored procedure.  | 
 void | 
setPrecision(int precision)
Sets the precision of the database representation for numeric attributes to precision. | 
 void | 
setPrototype(EOAttribute prototype)
Sets the prototype attribute.  | 
 void | 
setReadFormat(String string)
Sets the format string that is used to generate the expression value for the attribute for SELECT statements.  | 
 void | 
setReadOnly(boolean yn)
Sets whether the value of the attribute can be modified.  | 
 void | 
setScale(int scale)
Sets the scale of the database representation of the attribute to scale, which may be negative. | 
 void | 
setServerTimeZone(TimeZone tz)
Sets the time zone used for dates provided by the database server to tz. | 
 void | 
setUserInfo(NSDictionary dictionary)
Sets the dictionary of auxiliary data associated with the attribute to dictionary. | 
 void | 
setValueClassName(String name)
Deprecated.  | 
 void | 
setValueFactoryMethodName(String factoryMethodName)
Sets the name of the factory method which is invoked by the attribute to create a value for a custom class to factoryMethodName. | 
 void | 
setValueType(String string)
Sets the format for custom value types, such as "TIFF" or "RTF", to string. | 
 void | 
setWidth(int length)
Sets the maximum number of bytes that the attribute's value may contain to length. | 
 void | 
setWriteFormat(String string)
Sets the format string that is used to generate the expression value for the attribute for INSERT or UPDATE statements.  | 
 EOStoredProcedure | 
storedProcedure()
Returns the stored procedure for which this attribute is an argument.  | 
 String | 
toString()
Returns a string representation of the receiver.  | 
 NSDictionary | 
userInfo()
Returns a dictionary of user data.  | 
 Object | 
validateValue(Object valueP)
Validates valueP by attempting to convert it to the
 attribute's value type and by testing other attribute validation 
 constraints (such as allowsNull, width, 
 and so on). | 
 String | 
valueClassName()
Deprecated.  | 
 NSSelector | 
valueFactoryMethod()
Returns the factory method invoked by the attribute when creating an attribute value that's of a custom class.  | 
 String | 
valueFactoryMethodName()
Returns the name of the factory method used for creating a custom class value.  | 
 String | 
valueForSQLExpression(EOSQLExpression context)
If the context parameter is not null,
 returns the SQL expression for the receiver. | 
 String | 
valueType()
Returns the format for custom value types, such as "TIFF" or "RTF".  | 
 int | 
width()
Returns the maximum length (in bytes) for values that are mapped to this attribute.  | 
 String | 
writeFormat()
Returns the format string used to format the attribute's value for INSERT or UPDATE expressions.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
public static final int AdaptorBytesType
adaptorValueType.
 Represents one of four possible value types to be fetched
 from a database, in this case, raw byte data.
public static final int AdaptorCharactersType
adaptorValueType.
 Represents one of four possible value types to be fetched
 from a database, in this case, character (string) data.
public static final int AdaptorDateType
adaptorValueType.
 Represents one of four possible value types to be fetched
 from a database, in this case, date data.
public static final int AdaptorNumberType
adaptorValueType.
 Represents one of four possible value types to be fetched
 from a database, in this case, numeric data.
public static final int FactoryMethodArgumentIsBytes
factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, an array of bytes.
public static final int FactoryMethodArgumentIsData
factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, a binary (NSData) argument.
public static final int FactoryMethodArgumentIsString
factoryMethodArgumentType
 and setFactoryMethodArgumentType to specify the type of
 argument that should be passed to the attribute's factory method,
 in this case, a String argument.
public static final int InOutParameter
public static final int InParameter
public static final int OutParameter
public static final int Void
| Constructor Detail | 
public EOAttribute()
public EOAttribute(NSDictionary plist,
                   Object owner)
plist whose parent is owner.  The 
 possible keys for plist are: 
prototypeNameexternalTypeisReadOnlyallowsNullvalueTypewriteFormatreadFormatwidthfactoryMethodArgumentTypeadaptorValueConversionMethodNamevalueFactoryMethodNameprecisionscaleserverTimeZoneparameterDirectionuserInfointernalInfo
plist - A dictionary whose keys are attribute names and whose values
              are the attribute values for the new EOAttribute object.owner - The parent object for the new EOAttribute.
protected EOAttribute(EOEntity entity,
                      String definition)
| Method Detail | 
public Object adaptorValueByConvertingAttributeValue(Object value)
value is one of the following 
 primitive adaptor types:  String, Number, NSData, or NSTimestamp. 
 If not, this method attempts to convert value to a
 primitive type by invoking the method returned by 
 adaptorValueConversionMethod. Throws an exception if
 unable to convert value.
value - The value whose type is to be checked.
value, or the converted object.
IllegalArgumentException - if unable to convert 
              value to a primitive adaptor type.adaptorValueConversionMethod(), 
adaptorValueType()public NSSelector adaptorValueConversionMethod()
null is returned.
null.adaptorValueByConvertingAttributeValue(Object value), 
adaptorValueConversionMethodName(), 
NSSelectorpublic String adaptorValueConversionMethodName()
adaptorValueByConvertingAttributeValue(Object value)public int adaptorValueType()
 
| Constant | Description | 
AdaptorNumberType | 
 A numeric value | 
AdaptorCharactersType | 
 A string of characters | 
AdaptorBytesType | 
 An array of raw bytes | 
AdaptorDateType | 
 A date | 
Throws an exception if the attribute uses a custom class and has
 not specified a FactoryMethodArgumentType.
IllegalStateException - if the attribute uses a custom 
             class and has not specified a 
             FactoryMethodArgumentType.factoryMethodArgumentType()public boolean allowsNull()
true if the attribute can have a
 null value, false otherwise. If the 
 attribute maps directly to a column in the database, 
 allowsNull also specifies whether the database column
 can have a null value.
true if the attribute can have a
         null value.setAllowsNull(boolean allowsNull)public void awakeWithPropertyList(NSDictionary plist)
plist. 
 awakeWithPropertyList is responsible for
 restoring references to other objects. Consequently, it should not
 be invoked until all other objects that the receiver might reference
 have been created from plist.
awakeWithPropertyList in interface EOPropertyListEncodingplist - A dictionary of attribute keys and values with which to
              complete initialization of an EOAttribute object.public void beautifyName()
This method is used in reverse-engineering an EOModel.
EOEntity.nameForExternalName(String name, String separatorString
      , boolean initialCaps ), 
EOModel.beautifyNames()public String className()
setClassName(String name)public String columnName()
null if the attribute isn't simple (that is,
 if it's a derived or flattened attribute). An adaptor uses this name to identify
 the column corresponding to the attribute. The application should never
 need to use the column name. 
 Note that columnName and definition are mutually
 exclusive; if one returns a value, the other returns null.
null.externalType(), 
definition()public String definition()
null if the attribute is simple. An attribute's definition
 is either a value expression defining a derived attribute, such as
 "salary  * 12", or a data path for a flattened attribute, such as
 "toAuthor.name". 
 Note that columnName and definition
 are mutually exclusive; if one returns a value, the other returns
 null.
null.externalType(), 
setDefinition(String definition), 
columnName()public void encodeIntoPropertyList(NSMutableDictionary result)
encodeIntoPropertyList in interface EOPropertyListEncodingresult - A mutable dictionary into which the keys and values
               of the EOAttribute object's state are encoded.EOAttribute(NSDictionary plist, Object owner)public EOEntity entity()
null
 if this attribute is acting as an argument for a stored procedure.
null.storedProcedure()public String externalType()
columnName(), 
setExternalType(String typeName)public int factoryMethodArgumentType()
 
| Constant | Argument Type | 
FactoryMethodArgumentIsData | 
 NSData | 
FactoryMethodArgumentIsString | 
 String | 
FactoryMethodArgumentIsBytes | 
 an array of bytes | 
valueFactoryMethod(), 
setFactoryMethodArgumentType(int argumentType)public boolean isDerived()
true if the attribute does not correspond 
 exactly to one column in a table, false otherwise. 
 For example, an attribute with a definition of "attributeName
 + 1" is a derived attribute.
true if the attribute does not correspond 
         exactly to one column in a table, false
         otherwise.isFlattened(), 
definition()public boolean isFlattened()
true if the attribute is flattened,
 false otherwise. A flattened attribute is one that is accessed
 through an entity's relationships but belongs to another entity. 
 For example, if a Book entity has the relationship toAuthor and
 the Author entity has the attribute name, you can assign the name 
 of the author as an attribute of your Book entity by creating flattened attribute
 with an external name "toAuthor.name".
true if the attribute is flattened, false
         otherwise.isDerived(), 
definition()public boolean isReadOnly()
true if the value of the attribute can not be
 modified, false if it can.
true if the value of the attribute can not be
         modified.setReadOnly(boolean flag)public String name()
name in class EOPropertycolumnName(), 
definition(), 
setName(String name)
public Object newValueForBytes(byte[] bytes,
                               int length)
You should not need to use this method unless you are implementing a subclass of EOAdaptor. Clients of the model should not call this method.
bytes - The bytes from which to create the new value.length - Unused.
bytes.
public Object newValueForBytesString(byte[] bytes,
                                     int length)
public Object newValueForImmutableBytes(byte[] bytes)
You should not need to use this method unless you are 
 implementing a subclass of EOAdaptor.  Clients of the model should 
 not call this method. Callers of this method must guarantee 
 that bytes can not be modified after this call.
bytes - The bytes from which to create the new value.
bytes.public Object newValueForString(String str)
You should not need to use this method unless you are implementing a subclass of EOAdaptor. Clients of the model should not call this method.
public boolean overridesPrototypeDefinitionForKey(String key)
true if the attribute has an override,
 false if the requested key gets its value from the
 prototype attribute. Valid keys include "columnName",
 "externalType", and so on.
key - An attribute key.
true if the value for the requested key
              is overridden, false otherwise.prototype()public int parameterDirection()
 
| Constant | Description | 
Void | No parameters | 
InParameter | Input only parameters | 
OutParameter | Output only parameters | 
InOutParameter | Bi-directional parameters (both input and output) | 
storedProcedure(), 
setParameterDirection(int parameterDirection), 
EOEntity.storedProcedureForOperation(String operation)public Object parent()
entity(), 
storedProcedure(), 
EOEntity, 
EOStoredProcedurepublic int precision()
setPrecision(int precision), 
scale()public EOAttribute prototype()
null
 
- Returns:
 - The prototype attribute for the receiver, or 
null. - See Also:
 overridesPrototypeDefinitionForKey(String key)
 
public String prototypeName()
null if there is none.
prototype()public String readFormat()
setReadFormat(String string), 
writeFormat()public String relationshipPath()
null if the receiver is not a flattened attribute.
relationshipPath in class EOPropertynull.isFlattened()public int scale()
setScale(int scale), 
precision()public TimeZone serverTimeZone()
setServerTimeZone(TimeZone tz)public void setAdaptorValueConversionMethodName(String conversionMethodName)
conversionMethodName.
conversionMethodName - The name of the method used to convert a
                             custom class.adaptorValueConversionMethodName()public void setAllowsNull(boolean allowsNull)
null value
 to allowsNull. If the attribute maps directly to a 
 column in the database, it also determines whether the database 
 column can have a null value.
allowsNull - Specifies whether the attribute can be
                   null.allowsNull()public void setClassName(String name)
name.
 The name argument should be a fully qualified Java 
 class name, such as "java.lang.String".
name - The fully qualified Java class name for the 
                 attribute.public void setColumnName(String columnName)
columnName.  An adaptor uses this name to
 identify the column corresponding to the attribute; 
 columnName must match the name of a column in the 
 database table corresponding to the attribute's entity.
 Setting the column name has the effect of making a derived or flattened attribute simple. The column name takes the place of the model path (for flattened attributes) or expression (for derived attributes) used to obtain the value of the attribute from the database server.
 Note: setColumnName and 
 setDefinition are mutually exclusive. Only one can be
 set at any given time. Invoking either of these methods causes the
 other value to be set to null.
columnName - The name of the database column corresponding to
 this attribute.setDefinition(String definition), 
columnName(), 
definition()public void setDefinition(String definition)
definition. 
 definition should be either a value expression
 defining a derived attribute, such as "salary  * 12", 
 or a data path for a flattened attribute, such as 
 "toAuthor.name".
 Prior to invoking this method, the attribute's entity must have been set by adding the attribute to an entity. This method will not function correctly if the attribute's entity has not been set.
This method converts a simple attribute into a derived or 
 flattened attribute. The columnName is set to null and
 the definition  takes its place for use with the database 
 server.
 Note: setColumnName and 
 setDefinition are mutually exclusive. Only one can be 
 set at any given time. Invoking either of these methods causes the 
 other value to be set to null.
definition - The attribute's definition.setColumnName(String columnName), 
definition(), 
columnName()public void setExternalType(String string)
string.  Each
 adaptor defines the set of types that can be supplied to 
 setExternalType. The external type you specify for a 
 given attribute must correspond to the type used in the database 
server to store the value of the attribute.
string - The type used by the database server to store the 
               attribute.externalType()public void setFactoryMethodArgumentType(int argumentType)
argumentType must be one of the following 
 constants:
FactoryMethodArgumentIsStringFactoryMethodArgumentIsDataFactoryMethodArgumentIsData
argumentType - Constant representing the type of argument 
                      that should be passed to the factory method.setValueFactoryMethodName(String factoryMethodName), 
factoryMethodArgumentType()public void setName(String name)
name, which can not
 be a name that is already in use by an attribute or relationship
 belonging to the same entity as the receiver.
name - The name to set for the attribute.name(), 
entity()public void setParameterDirection(int parameterDirection)
parameterDirection must be one 
 of the following constants:
 Void
      InParameter
      OutParameter
      InOutParameter
 
parameterDirection - The parameter direction of arguments to 
                           a stored procedure.parameterDirection(), 
EOEntity.setStoredProcedure(
                           EOStoredProcedure storedProcedure, String operation)public void setPrecision(int precision)
precision.
precision - The precision of the database representation for
                  the attribute.precision(), 
setScale(int scale)public void setPrototype(EOAttribute prototype)
prototype - The protytpe attribute to set for the receiver.prototype()public void setReadFormat(String string)
     myAttribute.setReadFormat("TO_UPPER(%P)");
 
 
 %P in string is replaced by the attribute's external
 name at runtime. The read format string is used whenever the 
 attribute is referenced in a select list or qualifier.
string - A string to format the attribute's value when reading
               from the database.setWriteFormat(String string), 
readFormat()public void setReadOnly(boolean yn)
yn is false
 and the attribute is derived but not flattened.
yn - Boolean flag that specifies whether the attribute can be
 modified.
IllegalArgumentException - if yn is 
           false  
           and the attribute is derived but not flattened.isDerived(), 
isFlattened(), 
isReadOnly()public void setScale(int scale)
scale, which may be negative.
scale - The scale of the database representation of the 
              attribute.scale(), 
setPrecision(int precision)public void setServerTimeZone(TimeZone tz)
tz. If tz is null, the 
 local time zone is used. An EOAdaptorChannel automatically converts
 dates between the time zones used by the server and the client when
 fetching and saving values. Applies only to attributes that 
 represent dates.
tz - The time zone to assume for dates from the database 
           server.serverTimeZone()public void setUserInfo(NSDictionary dictionary)
dictionary.  The application can use the 
 userInfo
 dictionary for whatever it needs. dictionary can only
 contain property list data types (that is, NSDictionary, NSArray, 
 NSData, and java.lang.String).
dictionary - A dictionary of arbitrary auxiliary data for the
                   attribute.userInfo()public void setValueClassName(String name)
public void setValueFactoryMethodName(String factoryMethodName)
factoryMethodName. The factory method should be a 
 static method returning an object of the custom value class. Use 
 setFactoryMethodArgumentType to specify
 the type of argument to pass to the factory method.
factoryMethodName - The name of the factory method.valueFactoryMethodName(), 
setFactoryMethodArgumentType(int
                           argumentType)public void setValueType(String string)
string.
string - A string identifying the format for a custom 
                    value type.setValueClassName(String name), 
valueType()public void setWidth(int length)
length. Adaptors may use this information 
 to allocate space for fetch buffers.
length - The maximum number of bytes the attribute's value may
               contain.width()public void setWriteFormat(String string)
     myAttribute.setWriteFormat("TO_LOWER(%V)");
 
 
 %V in string is replaced by the attribute's value 
 at runtime.
string - A string to format the attribute's value when
               writing to the database.setReadFormat(String string), 
writeFormat()public EOStoredProcedure storedProcedure()
null.
null.entity()public String toString()
toString in class Objectpublic NSDictionary userInfo()
setUserInfo(NSDictionary dictionary)
public Object validateValue(Object valueP)
                     throws NSValidation.ValidationException
valueP by attempting to convert it to the
 attribute's value type and by testing other attribute validation 
 constraints (such as allowsNull, width, 
 and so on). Throws an exception if any errors occur during 
 validation.  On success, returns either the converted
 value or, if no conversion was performed, returns the original 
 value.
valueP - The object to be validated.
valueP, the converted value, or 
               null.
NSValidation.ValidationException - if validation fails.adaptorValueByConvertingAttributeValue(Object value)public String valueClassName()
public NSSelector valueFactoryMethod()
valueFactoryMethodName. 
 If valueFactoryMethodName does not map to a valid 
 selector at runtime, this method returns null.
nullSee Also:valueFactoryMethodName(), 
NSSelectorpublic String valueFactoryMethodName()
valueFactoryMethod(), 
setValueFactoryMethodName(String factoryMethodName)public String valueForSQLExpression(EOSQLExpression context)
context parameter is not null,
 returns the SQL expression for the receiver. If context
 is null and the receiver has a definition
 set, returns the SQL expression that corresponds to the receiver's 
 definition. If both context and 
 definition are null, returns the 
 receiver's name.
valueForSQLExpression in interface EOSQLExpression.SQLValuecontext - An EOSQLExpression object.
public String valueType()
setValueType(String typeName)public int width()
setWidth(int length)public String writeFormat()
readFormat(), 
setWriteFormat(String string)
  | 
Last updated Mon Oct 13 15:42:52 PDT 2003. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||