While creating an entity object with the Entity Object Wizard or editing an entity object with the Entity Object Editor, you specify the following information in the Attribute Settings page. The settings can affect forward generation or the settings can be derived from an existing table (reverse generation).
|
Attribute Setting |
Forward Generation |
Reverse Generation |
Persistent Attribute |
Transient Attribute |
|
N/A |
Default based on column name; you can change it to any Java identifier name. |
Required |
Required |
|
|
N/A |
Default based on column data type; you can choose another type in the list. |
Required |
Required |
|
|
N/A |
N/A |
Optional |
Optional |
|
|
Becomes the table's primary key, or part of it if you specify multiple primary keys for a table (a composite key) |
From the table; it must match the table. |
Selectable |
Selectable, but you should leave it deselected in most cases |
|
|
Becomes a mandatory column in the table (a NOT NULL constraint is generated for that column in the table). |
From the table; this value must match the table, or you might get problematic runtime behavior or an exception. |
Selectable |
Selectable |
|
|
Only persistent attributes are added to the table. |
All attributes derived from the table are persistent; if you change it, this column does not get populated through the business components framework. |
Selected |
Deselected |
|
|
N/A |
N/A |
Selectable |
Selectable |
|
|
N/A |
N/A except when the java.sql.type for this attribute is CHAR, then all Refresh After checkboxes are selected. |
Selectable |
N/A |
|
|
Becomes the table's column name |
From the table; it must match the table. |
Required; it must match the table. |
N/A |
|
|
Becomes the table's column data type |
From the table; it must match the table. |
Required; it must match the table. |
N/A |
|
|
N/A |
N/A |
Selectable |
N/A |
|
|
If selected, the column has a unique constraint. |
From the table; it must match the table. |
Selectable |
N/A |
|
|
N/A |
N/A |
Selectable |
N/A |
In general, if you are performing reverse generation, you don't want to change the primary key, mandatory, database column name, column type, and unique settings that were received from the table. For forward generation, the primary key, mandatory, persistent, database column name, column type, and unique settings are used to generate tables.
For your entity object to be able to uniquely identify a row of data, one of its attributes must be defined as a primary key. If your table doesn't have a primary key, you can use the ROWID.
Choose an attribute in the Select Attribute list.
Specify attribute settings.
Repeat for each attribute.
Click Next or Finish when you are finished.