Specifying Entity Attribute Settings

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

Attribute Name

N/A

Default based on column name; you can change it to any Java identifier name.

Required

Required

Attribute Type

N/A

Default based on column data type; you can choose another type in the list.

Required

Required

Default Value

N/A

N/A

Optional

Optional

Primary Key

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

Mandatory

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

Persistent

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

Updateable

N/A

N/A

Selectable

Selectable

Refresh After

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

Database Column Name

Becomes the table's column name

From the table; it must match the table.

Required; it must match the table.

N/A

Column Type

Becomes the table's column data type

From the table; it must match the table.

Required; it must match the table.

N/A

Queriable

N/A

N/A

Selectable

N/A

Unique

If selected, the column has a unique constraint.

From the table; it must match the table.

Selectable

N/A

Change Indicator

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.

To define attribute settings:

  1. Choose an attribute in the Select Attribute list.

  2. Specify attribute settings.

  3. Repeat for each attribute.

  4. Click Next or Finish when you are finished.