Package org.apache.openjpa.jdbc.schema
Class Schema
- java.lang.Object
-
- org.apache.openjpa.jdbc.schema.Schema
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Schema>
public class Schema extends java.lang.Object implements java.lang.Comparable<Schema>, java.io.Serializable
Represents a database schema.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Schema()
Default constructor.Schema(java.lang.String name, SchemaGroup group)
Deprecated.Schema(DBIdentifier name, SchemaGroup group)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Sequence
addSequence(java.lang.String name)
Deprecated.Sequence
addSequence(DBIdentifier name)
Table
addTable(java.lang.String name)
Deprecated.Table
addTable(java.lang.String name, java.lang.String validName)
Deprecated.Table
addTable(DBIdentifier name)
Table
addTable(DBIdentifier name, DBIdentifier validName)
int
compareTo(Schema other)
DBIdentifier
getIdentifier()
java.lang.String
getName()
Deprecated.SchemaGroup
getSchemaGroup()
Return the schema's group.Sequence
getSequence(java.lang.String name)
Deprecated.Sequence
getSequence(DBIdentifier name)
Sequence[]
getSequences()
Return the schema's sequences.Table
getTable(java.lang.String name)
Deprecated.Table
getTable(DBIdentifier name)
Table[]
getTables()
Return the schema's tables.Sequence
importSequence(Sequence seq)
Import a sequence from another schema.Table
importTable(Table table)
Import a table from another schema.boolean
removeSequence(Sequence seq)
Remove the given sequence from the schema.boolean
removeTable(Table tab)
Remove the given table from the schema.void
setIdentifier(DBIdentifier name)
void
setName(java.lang.String name)
Deprecated.java.lang.String
toString()
-
-
-
Constructor Detail
-
Schema
public Schema()
Default constructor.
-
Schema
@Deprecated public Schema(java.lang.String name, SchemaGroup group)
Deprecated.Constructor.- Parameters:
name
- the schema name, if anygroup
- the schema's owning group
-
Schema
public Schema(DBIdentifier name, SchemaGroup group)
-
-
Method Detail
-
getSchemaGroup
public SchemaGroup getSchemaGroup()
Return the schema's group.
-
getName
@Deprecated public java.lang.String getName()
Deprecated.Return the name of the schema, or null if none.
-
getIdentifier
public DBIdentifier getIdentifier()
-
setName
@Deprecated public void setName(java.lang.String name)
Deprecated.Set the name of the schema. This method can only be used for schemas not attached to a group.
-
setIdentifier
public void setIdentifier(DBIdentifier name)
-
getTables
public Table[] getTables()
Return the schema's tables.
-
getTable
@Deprecated public Table getTable(java.lang.String name)
Deprecated.Return the table with the given name, or null if none.
-
getTable
public Table getTable(DBIdentifier name)
-
addTable
@Deprecated public Table addTable(java.lang.String name)
Deprecated.Add a table to the schema.
-
addTable
public Table addTable(DBIdentifier name)
-
addTable
@Deprecated public Table addTable(java.lang.String name, java.lang.String validName)
Deprecated.Add a table with a shortened (i.e., validated) name to the schema
-
addTable
public Table addTable(DBIdentifier name, DBIdentifier validName)
-
removeTable
public boolean removeTable(Table tab)
Remove the given table from the schema.- Returns:
- true if the table was removed, false if not in the schema
-
importTable
public Table importTable(Table table)
Import a table from another schema. Note that this method does not import foreign keys, indexes, or unique constraints.
-
getSequences
public Sequence[] getSequences()
Return the schema's sequences.
-
getSequence
@Deprecated public Sequence getSequence(java.lang.String name)
Deprecated.Return the sequence with the given name, or null if none.
-
getSequence
public Sequence getSequence(DBIdentifier name)
-
addSequence
@Deprecated public Sequence addSequence(java.lang.String name)
Deprecated.Add a sequence to the schema.
-
addSequence
public Sequence addSequence(DBIdentifier name)
-
removeSequence
public boolean removeSequence(Sequence seq)
Remove the given sequence from the schema.- Returns:
- true if the sequence was removed, false if not in the schema
-
compareTo
public int compareTo(Schema other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Schema>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-