DefaultTableGenerator is a utility class used to generate a default table schema for a EclipseLink project object.
The utility can be used in EclipseLink CMP for OC4J to perform the table auto creation process, which can be triggered
at deployment time when EclipseLink project descriptor is absent (default mapping) or present.
The utility can also be used to any EclipseLink application to perform the table drop/creation at runtime.
The utility handles all direct/relational mappings, inheritance, multiple tables, interface with/without tables,
optimistic version/timestamp lockings, nested relationships, BLOB/CLOB generation.
The utility is platform-agnostic.
Usage:
- CMP
1. set "autocreate-tables=true|false, autodelete-tables=true|false" in oc4j application deployment
descriptor files (config/system-application.xml, config/application.xml, or orion-application.xml in an .ear)
2. Default Mapping: the same as CMP, plus system properties setting -Declipselink.defaultmapping.autocreate-tables='true|false'
and -Declipselink.defaultmapping.autodelete-tables='true|false'
- Non-CMP:
TODO: sessions.xml support (CR 4355200)
1. Configuration: through sessions.xml
2. Directly runtime call through schema framework:
SchemaManager mgr = new SchemaManager(session);
mgr.replaceDefaultTables(); //drop and create
mgr.createDefaultTables(); //create only
The utility currently only supports relational project.

generateFilteredDefaultTableCreator(org.eclipse.persistence.internal.sessions.AbstractSession session)
Generate a default TableCreator object from the EclipseLink project object,
and perform the table existence check through jdbc table metadata, and filter out
tables which are already in the database.

initTableSchema

Build tables/fields information into the table creator object from a EclipseLink descriptor.
This should handle most of the direct/relational mappings except many-to-many and direct
collection/map mappings, witch must be down in postInit method.