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:
java.io.Serializable,java.lang.Cloneable,SchemaFactory,Configurable
public class DynamicSchemaFactory extends SchemaGroup implements SchemaFactory, Configurable
Factory whose schema group dynamically fills itself with information as mappings validate themselves in theirmapmethod. Tables are added whenSchemaGroup.findTable(org.apache.openjpa.jdbc.schema.Table)is called. Columns are added to tables whenTable.getColumn(java.lang.String)is called. And the column types are set whenColumn.isCompatible(int, java.lang.String, int, int)is called.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DynamicSchemaFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendConfiguration()Invoked upon completion of bean property configuration for this object.TablefindTable(java.lang.String name)Find the table with the given name in the group, using '.' as the catalog separator.TablefindTable(DBIdentifier name)TablefindTable(QualifiedDBIdentifier path)booleanisKnownTable(java.lang.String name)Return true if the given table is known to exist.booleanisKnownTable(QualifiedDBIdentifier path)booleanisKnownTable(Table table)Return true if the given table is known to exist.protected ColumnnewColumn(DBIdentifier name, Table table)protected TablenewTable(DBIdentifier name, Schema schema)SchemaGroupreadSchema()Return the schema group for the current object model and database.voidsetConfiguration(Configuration conf)Invoked prior to setting bean properties.voidstartConfiguration()Invoked before bean property configuration is begun on this object.voidstoreSchema(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
-
-
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Configuration conf)
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()
Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
endConfiguration
public void endConfiguration()
Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
readSchema
public SchemaGroup readSchema()
Description copied from interface:SchemaFactoryReturn the schema group for the current object model and database.- Specified by:
readSchemain interfaceSchemaFactory
-
storeSchema
public void storeSchema(SchemaGroup schema)
Description copied from interface:SchemaFactoryRecord the schema group after changes may have been made.- Specified by:
storeSchemain interfaceSchemaFactory- Parameters:
schema- the schema definition for the entire system
-
isKnownTable
public boolean isKnownTable(Table table)
Description copied from class:SchemaGroupReturn 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:
isKnownTablein classSchemaGroup
-
isKnownTable
public boolean isKnownTable(java.lang.String name)
Description copied from class:SchemaGroupReturn 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:
isKnownTablein classSchemaGroup
-
isKnownTable
public boolean isKnownTable(QualifiedDBIdentifier path)
- Overrides:
isKnownTablein classSchemaGroup
-
findTable
public Table findTable(java.lang.String name)
Description copied from class:SchemaGroupFind the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found.- Overrides:
findTablein classSchemaGroup
-
findTable
public Table findTable(DBIdentifier name)
-
findTable
public Table findTable(QualifiedDBIdentifier path)
- Overrides:
findTablein classSchemaGroup
-
newTable
protected Table newTable(DBIdentifier name, Schema schema)
- Overrides:
newTablein classSchemaGroup
-
newColumn
protected Column newColumn(DBIdentifier name, Table table)
- Overrides:
newColumnin classSchemaGroup
-
-