Package org.apache.openjpa.jdbc.schema
Class DynamicSchemaFactory
java.lang.Object
org.apache.openjpa.jdbc.schema.NameSet
org.apache.openjpa.jdbc.schema.SchemaGroup
org.apache.openjpa.jdbc.schema.DynamicSchemaFactory
- All Implemented Interfaces:
Serializable
,Cloneable
,SchemaFactory
,Configurable
Factory whose schema group dynamically fills itself with information
as mappings validate themselves in their
map
method.
Tables are added when SchemaGroup.findTable(org.apache.openjpa.jdbc.schema.Table)
is called. Columns
are added to tables when Table.getColumn(java.lang.String)
is called. And the
column types are set when Column.isCompatible(int, java.lang.String, int, int)
is called.- Author:
- Abe White
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked upon completion of bean property configuration for this object.Find the table with the given name in the group, using '.' as the catalog separator.findTable
(DBIdentifier name) boolean
isKnownTable
(String name) Return true if the given table is known to exist.boolean
boolean
isKnownTable
(Table table) Return true if the given table is known to exist.protected Column
newColumn
(DBIdentifier name, Table table) protected Table
newTable
(DBIdentifier name, Schema schema) Return the schema group for the current object model and database.void
Invoked prior to setting bean properties.void
Invoked before bean property configuration is begun on this object.void
storeSchema
(SchemaGroup schema) Record the schema group after changes may have been made.Methods inherited from class org.apache.openjpa.jdbc.schema.SchemaGroup
addSchema, addSchema, addSchema, clone, copy, findExportedForeignKeys, findSequence, findSequence, findSequence, findSequence, findSequence, findSequence, findTable, findTable, findTable, findTable, findTable, getSchema, getSchema, getSchemas, importSchema, isKnownSequence, isKnownSequence, isKnownSequence, isKnownSequence, newColumn, newForeignKey, newForeignKey, newIndex, newIndex, newInstance, newPrimaryKey, newPrimaryKey, newSchema, newSchema, newSequence, newSequence, newTable, newUnique, newUnique, removeSchema, removeUnusedComponents
Methods inherited from class org.apache.openjpa.jdbc.schema.NameSet
addName, addName, isNameTaken, isNameTaken, removeName, removeName
-
Constructor Details
-
DynamicSchemaFactory
public DynamicSchemaFactory()
-
-
Method Details
-
setConfiguration
Description copied from interface:Configurable
Invoked prior to setting bean properties.- Specified by:
setConfiguration
in interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:Configurable
Invoked before bean property configuration is begun on this object.- Specified by:
startConfiguration
in interfaceConfigurable
-
endConfiguration
public void endConfiguration()Description copied from interface:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
-
readSchema
Description copied from interface:SchemaFactory
Return the schema group for the current object model and database.- Specified by:
readSchema
in interfaceSchemaFactory
-
storeSchema
Description copied from interface:SchemaFactory
Record the schema group after changes may have been made.- Specified by:
storeSchema
in interfaceSchemaFactory
- Parameters:
schema
- the schema definition for the entire system
-
isKnownTable
Description copied from class:SchemaGroup
Return true if the given table is known to exist. WhileSchemaGroup.findTable(org.apache.openjpa.jdbc.schema.Table)
may exhibit dynamic behavior in some schema group implementations, this method only returns true if the table has been added to this group or is known to exist in the database.- Overrides:
isKnownTable
in classSchemaGroup
-
isKnownTable
Description copied from class:SchemaGroup
Return true if the given table is known to exist. WhileSchemaGroup.findTable(org.apache.openjpa.jdbc.schema.Table)
may exhibit dynamic behavior in some schema group implementations, this method only returns true if the table has been added to this group or is known to exist in the database.- Overrides:
isKnownTable
in classSchemaGroup
-
isKnownTable
- Overrides:
isKnownTable
in classSchemaGroup
-
findTable
Description copied from class:SchemaGroup
Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found.- Overrides:
findTable
in classSchemaGroup
-
findTable
-
findTable
- Overrides:
findTable
in classSchemaGroup
-
newTable
- Overrides:
newTable
in classSchemaGroup
-
newColumn
- Overrides:
newColumn
in classSchemaGroup
-