Creating Java Objects from Database Tables
The TopLink Mapping editor can automatically generate Java class definitions, descriptor definitions, and associated mappings from the information in database tables. You can later edit the generated information if necessary.
For each database table, the TopLink Mapping editor:
- Creates a class definition and a descriptor definition.
- Adds attributes to the class for each column in the table.
- Automatically generates access methods, if specified.
- Creates direct-to-field mappings for all direct (non-foreign key) fields in the table.
- Creates relationship mappings (one-to-one and one-to-many) if there is sufficient foreign key information. You may be required to determine the exact mapping type.
Note: Class and attribute names are generated based on the table and column names. You can edit the class properties to change their names.
To Generate Descriptors and Classes from Database Tables:
- Right-click the project element in the Navigator and select New. The New Gallery appears.
- In the Categories list, select Business Tier | TopLink.
- In the Items list, select Java Objects from Tables and click OK. The Create Java Objects from Tables Wizard appears.
- Complete each screen in the wizard. The newly created Java objects appear in the Navigator list. The TopLink descriptors appear in the Structure window.
JDeveloper also creates offline database tables from the database connection.
Related Topics
About Database Mappings
Generating Mapping Data from Database Tables
Working with Database Connections
Copyright © 1997, 2004, Oracle.
All rights reserved.