EOModeler provides three mechanisms for viewing and modifying an entitys attributes: the table mode of the model editor, the diagram view of the model editor, and the Attribute Inspector. You can use any of the mechanisms to examine the characteristics of your models attributes and to make refinements. Each has advantages over the other and is useful in different circumstances.
To display an entitys attributes in table mode, select an entity in the tree view. Figure 4-1 shows the attributes of an entity called Rating.
Figure 4-1 An entitys attributes
Each table column corresponds to a single characteristic of the attribute, such as its name, external type, or precision. By default, the columns included in this view represent only a subset of possible characteristics you can set for a given attribute. To add columns for additional characteristics, you use the Add Column pop-up menu in the lower-left corner of the table, as shown in Figure 4-1. You can also resize and rearrange columns in the table.
Table 4-1 describes the characteristics you can set for an attribute. Unless otherwise specified, the instructions are for editing the characteristic in the model editors table mode. Some of the characteristics are described in more detail in the cross-referenced sections.
Characteristic | What it is | How you modify it |
Allows Null | Indicates whether the attribute can have a null value. See Allows Null. | Click in the column with the checkmark to toggle the option on and off. You can also edit this characteristic in the Attribute Inspector. |
Class Property | Indicates that you want to include the attribute in your Enterprise Object classes. See Class Property. | Click in the diamond column to toggle the option on and off. You can also edit this characteristic in diagram view. |
Client-Side Class Property | Indicates that you want to include the attribute in your Enterprise Object classes that live on the client side of Java Client applications. See Client-Side Class Property. | Click in the column with the two opposing arrows to toggle the option on and off. |
Column | The name of the column in the data source that corresponds to the attribute. | Edit the table cell. |
Definition | The SQL definition for a derived attribute. Note that Column and Definition are mutually exclusive; you cant set both. Setting one clears the other. See Definition (Derived Attributes). | Edit the table cell. |
External Type | The data type of the attribute as its understood by the data source. | Choose a value from the pop-up menu. |
Locking | Indicates whether an attribute participates in optimistic locking. See Locking. | Click in the pad-lock column to toggle locking off and on for a particular attribute. You can also edit this characteristic in diagram view. |
Name | The name of the attribute as it appears in your application and in your enterprise objects. EOModeler derives a default name based on the corresponding column in the data source which you can edit if necessary. | Edit the table cell. You can also edit this characteristic in diagram view. |
Precision | The number of significant digits. The number 12.34 has a precision of four and a scale of 2. | Edit the table cell or use the Attribute Inspector. |
Primary Key | Declares whether a property is or is part of the entitys primary key. See Primary Key. | Click in the key column to toggle the primary key off and on. You can also edit this characteristic in diagram view. |
Prototype | A prototype attribute from which this attribute derives its characteristics. See Prototype Attributes. | Choose a value from the pop-up menu. See Prototype Attributes to learn where these values are defined. |
Read Format | The format string thats used to format the attributes value for SQL SELECT statements. In the string, %P is replaced by the attributes external name. This string is used whenever the attribute is referenced in a SQL select statement or qualifier. See Read Format and Write Format. | Edit the table cell. |
Read Only | Indicates whether the attribute is read only. | Use the Advanced Attribute Inspector. |
Scale | The number of digits to the right of the decimal point. Can be negative. Applies only to noninteger, numerical types. The number 12.34 has a scale of 2. | Edit the table cell or use the Attribute Inspector. |
Value Class | Not applicable in WebObjects 5. | |
Value Class (Java) | The Java type to which the attribute will be coerced in your enterprise objects. | Edit the table cell or use the Attribute Inspector. |
Value Class (Obj-C) | Not applicable in WebObjects 5. | |
Value Type | The conversion character (such as i or d) the JDBC adaptor uses to communicate with the data source. See Value Type. | Edit the table cell or use the Attribute Inspector. |
Width | The maximum width in bytes or chars of the attribute (applies to string and raw data only). | Edit the table cell or use the Attribute Inspector. |
Write Format | The format string thats used to format the attributes
value for SQL INSERT or UPDATE expressions. In the string, %V is replaced
by the attributes external name. For LDAP data sources accessed via the JNDI adaptor, write format specifies the pattern used to generate the relative distinguished name. See Read Format and Write Format. | Edit the table cell. |