|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.tools.schemaframework.DefaultTableGenerator
public class DefaultTableGenerator
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.
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 |
---|
protected boolean generateFKConstraints
Constructor Detail |
---|
public DefaultTableGenerator(Project project)
public DefaultTableGenerator(Project project, boolean generateFKConstraints)
Method Detail |
---|
public TableCreator generateDefaultTableCreator()
public TableCreator generateFilteredDefaultTableCreator(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
DatabaseException
protected void initTableSchema(ClassDescriptor desc)
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |