Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Configuring Automatic Database Table Creation

You can configure OC4J to automatically create (and, optionally, delete) database tables for your persistent objects (see "Using Deployment XML").

You can use this feature in conjunction with default mappings (see "Configuring Default Relationship Generation").

Using Deployment XML

You can configure automatic database table creation at one of three levels as Table 14-2 shows. You can override the system level configuration at the application level and you can override system and application configuration at the EJB module level.

Table 14-2 Configuring Automatic Table Generation

Level Configuration File Setting Values

System (global)

<OC4J_HOME>/config/application.xml

autocreate-tables

autodelete-tables

TrueFoot 1  or False

True or FalseFootref 1

Application (EAR)

orion-application.xml

autocreate-tables

autodelete-tables

TrueFootref 1 or False

True or FalseFootref 1

EJB Module (JAR)

orion-ejb-jar.xml

pm-properties sub-element default-mapping attribute db-table-genFoot 2 

Create, DropAndCreate, or UseExistingFoot 3 


Footnote 1 Default.

Footnote 2 For more information, see "Customizing the TopLink EJB 2.1 Persistence Manager".

Footnote 3 See Table 14-3.

If you configure automatic table generation at the EJB module level, the value you assign to the db-table-gen attribute corresponds to the autocreate-tables and autodelete-tables settings, as Table 14-3 shows.

Table 14-3 Equivalent Settings for db-table-gen

db-table-gen Setting autocreate-tables Setting autodelete-tables Setting

Create

True

False

DropAndCreate

True

True

UseExisting

False

NA