Package org.apache.openjpa.jdbc.schema
Class SchemaGroup
java.lang.Object
org.apache.openjpa.jdbc.schema.NameSet
org.apache.openjpa.jdbc.schema.SchemaGroup
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
DynamicSchemaFactory
,LazySchemaFactory
Represents a grouping of schemas used in a database.
- Author:
- Abe White
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a schema to the group.Deprecated.addSchema
(DBIdentifier name) Add a schema to the group.clone()
protected void
copy
(SchemaGroup group) Copy cloneable state from the given instance.Find all foreign keys exported by a given primary key (all foreign keys that link to the primary key).findSequence
(String name) Deprecated.findSequence
(DBIdentifier name) findSequence
(Schema inSchema, String name) Deprecated.findSequence
(Schema inSchema, QualifiedDBIdentifier path) findSequence
(Sequence seq) Find the equivalent of the given sequence in this schema group.Deprecated.Deprecated.findTable
(Schema inSchema, DBIdentifier name) findTable
(Schema inSchema, DBIdentifier name, DBIdentifier defaultSchemaName) findTable
(Schema inSchema, QualifiedDBIdentifier path, DBIdentifier defaultSchemaName) Find the equivalent of the given table in this schema group.Deprecated.getSchema
(DBIdentifier name) Schema[]
Return all schemas.importSchema
(Schema schema) Import a schema from another group.boolean
isKnownSequence
(String name) Deprecated.boolean
isKnownSequence
(DBIdentifier name) boolean
boolean
isKnownSequence
(Sequence seq) Return true if the given sequence is known to exist.boolean
isKnownTable
(String name) Deprecated.boolean
boolean
isKnownTable
(Table table) Return true if the given table is known to exist.protected Column
Deprecated.protected Column
newColumn
(DBIdentifier name, Table table) protected ForeignKey
newForeignKey
(String name, Table table) Deprecated.protected ForeignKey
newForeignKey
(DBIdentifier name, Table table) protected Index
Deprecated.protected Index
newIndex
(DBIdentifier name, Table table) protected SchemaGroup
Create a new instance of this class.protected PrimaryKey
newPrimaryKey
(String name, Table table) Deprecated.protected PrimaryKey
newPrimaryKey
(DBIdentifier name, Table table) protected Schema
Deprecated.protected Schema
newSchema
(DBIdentifier name) protected Sequence
newSequence
(String name, Schema schema) Deprecated.protected Sequence
newSequence
(DBIdentifier name, Schema schema) protected Table
Deprecated.protected Table
newTable
(DBIdentifier name, Schema schema) protected Unique
Deprecated.protected Unique
newUnique
(DBIdentifier name, Table table) boolean
removeSchema
(Schema schema) Remove the given schema from the group.void
Remove unreferenced or emtpy components from the schema.Methods inherited from class org.apache.openjpa.jdbc.schema.NameSet
addName, addName, isNameTaken, isNameTaken, removeName, removeName
-
Constructor Details
-
SchemaGroup
public SchemaGroup()
-
-
Method Details
-
getSchemas
Return all schemas. -
getSchema
Deprecated.Return the schema with the given name, or null if none. -
getSchema
-
addSchema
Add a schema to the group. -
addSchema
Add a schema to the group. -
addSchema
Deprecated.- Parameters:
name
-
-
removeSchema
Remove the given schema from the group.- Returns:
- true if the schema was removed, false if not in the group
-
importSchema
Import a schema from another group. Foreign keys are not imported. -
isKnownTable
Return true if the given table is known to exist. WhilefindTable(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. -
isKnownTable
Deprecated.Return true if the given table is known to exist. WhilefindTable(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. -
isKnownTable
-
findTable
Find the equivalent of the given table in this schema group. The given table that may have come from another schema group. -
findTable
Deprecated.Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found. -
findTable
-
findTable
Deprecated.Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found. -
findTable
-
findTable
-
findTable
-
isKnownSequence
Return true if the given sequence is known to exist. WhilefindSequence(org.apache.openjpa.jdbc.schema.Sequence)
may exhibit dynamic behavior in some schema group implementations, this method only returns true if the sequence has been added to this group or is known to exist in the database. -
isKnownSequence
Deprecated.Return true if the given sequence is known to exist. WhilefindSequence(org.apache.openjpa.jdbc.schema.Sequence)
may exhibit dynamic behavior in some schema group implementations, this method only returns true if the sequence has been added to this group or is known to exist in the database. -
isKnownSequence
-
isKnownSequence
-
findSequence
Find the equivalent of the given sequence in this schema group. The given sequence that may have come from another schema group. -
findSequence
Deprecated.Find the sequence with the given name in the group, using '.' as the catalog separator. Returns null if no sequence found. -
findSequence
-
findSequence
-
findSequence
Deprecated.Find the sequence with the given name in the group, using '.' as the catalog separator. Returns null if no sequence found. -
findSequence
-
findExportedForeignKeys
Find all foreign keys exported by a given primary key (all foreign keys that link to the primary key). -
removeUnusedComponents
public void removeUnusedComponents()Remove unreferenced or emtpy components from the schema. -
clone
-
newInstance
Create a new instance of this class. -
copy
Copy cloneable state from the given instance. -
newSchema
Deprecated.Return a new schema with the given name. -
newSchema
-
newSequence
Deprecated.Return a new sequence with the given name and owner schema. -
newSequence
-
newTable
Deprecated.Return a new table with the given name and owner schema. -
newTable
-
newColumn
Deprecated.Return a new column with the given name and owner table. -
newColumn
-
newPrimaryKey
Deprecated.Return a new primary key with the given name and owner table. -
newPrimaryKey
-
newIndex
Deprecated.Return a new index with the given name and owner table. -
newIndex
-
newUnique
Deprecated.Return a new unique constraint with the given name and owner table. -
newUnique
-
newForeignKey
Deprecated.Return a new foreign key with the given name and owner table. -
newForeignKey
-