EclipseLink 2.0.0, build 'v20091127-r5931' API Reference

org.eclipse.persistence.tools.schemaframework
Class DefaultTableGenerator

java.lang.Object
  extended by org.eclipse.persistence.tools.schemaframework.DefaultTableGenerator

public class DefaultTableGenerator
extends java.lang.Object

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: 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.

Author:
King Wang
Since:
Oracle TopLink 10.1.3

Field Summary
protected  boolean generateFKConstraints
           
 
Constructor Summary
DefaultTableGenerator(Project project)
          Default construcotr
DefaultTableGenerator(Project project, boolean generateFKConstraints)
          This constructor will create a DefaultTableGenerator that can be set to create fk constraints
 
Method Summary
 TableCreator generateDefaultTableCreator()
          Generate a default TableCreator object from the EclipseLink project object.
 TableCreator 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.
protected  void initTableSchema(ClassDescriptor desc)
          Build tables/fields information into the table creator object from a EclipseLink descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generateFKConstraints

protected boolean generateFKConstraints
Constructor Detail

DefaultTableGenerator

public DefaultTableGenerator(Project project)
Default construcotr


DefaultTableGenerator

public DefaultTableGenerator(Project project,
                             boolean generateFKConstraints)
This constructor will create a DefaultTableGenerator that can be set to create fk constraints

Method Detail

generateDefaultTableCreator

public TableCreator generateDefaultTableCreator()
Generate a default TableCreator object from the EclipseLink project object.


generateFilteredDefaultTableCreator

public TableCreator generateFilteredDefaultTableCreator(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                                 throws DatabaseException
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.

Throws:
DatabaseException

initTableSchema

protected void initTableSchema(ClassDescriptor desc)
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.


EclipseLink 2.0.0, build 'v20091127-r5931' API Reference