First page Back Continue Last page Graphics

Creating Entity Objects from Tables, Views, or Synonyms


Creating Entity Objects from Tables, View, or Synonyms

When you create an entity object from an existing table, first JDeveloper uses the online database connection to interrogate the data dictionary to infer the following information:

The Java-friendly entity attribute names from the names of the table’s columns (for example, DEPT_ID becomes DeptId)

The SQL and Java data types of each attribute based on those of the underlying column

The length and precision of each attribute

The primary and unique key attributes (if the table has no primary key, it uses RowID)

The mandatory flag on attributes, based on NOT NULL constraints

The relationships between the new entity object and other entities based on foreign key constraints

JDeveloper then creates the XML component definition file that represents its declarative settings and saves it in the directory that corresponds to the name of its package.

If you create an entity object from a view, or from a table without a primary key, by default RowID is used as a primary key. If you create an entity object from a synonym, that entity object behaves as if it is created on the underlying table or view.