|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.schema.NameSet org.apache.openjpa.jdbc.schema.Table
public class Table
Represents a database table.
Field Summary |
---|
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker |
---|
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML |
Constructor Summary | |
---|---|
Table()
Default constructor. |
|
Table(DBIdentifier name,
Schema schema)
|
|
Table(String name,
Schema schema)
Deprecated. |
Method Summary | |
---|---|
Column |
addColumn(DBIdentifier name)
|
Column |
addColumn(DBIdentifier name,
DBIdentifier validName)
|
Column |
addColumn(String name)
Deprecated. |
Column |
addColumn(String name,
String validName)
Deprecated. |
void |
addCorrectedColumnName(DBIdentifier name,
boolean validate)
|
void |
addCorrectedColumnName(String name,
boolean validate)
Deprecated. |
ForeignKey |
addForeignKey()
Add a foreign key to the table. |
ForeignKey |
addForeignKey(DBIdentifier name)
|
ForeignKey |
addForeignKey(String name)
Deprecated. |
Index |
addIndex(DBIdentifier name)
|
Index |
addIndex(String name)
Deprecated. |
PrimaryKey |
addPrimaryKey()
Set the primary key for the table. |
PrimaryKey |
addPrimaryKey(DBIdentifier name)
|
PrimaryKey |
addPrimaryKey(String name)
Deprecated. |
Unique |
addUnique(DBIdentifier name)
|
Unique |
addUnique(String name)
Deprecated. |
(package private) void |
changeAutoAssigned(Column col)
Called by columns when their auto increment status changes. |
(package private) void |
changeRelationId(Column col)
Called by columns when their relation id status changes. |
int |
compareTo(Object other)
|
boolean |
containsColumn(DBIdentifier name)
|
boolean |
containsColumn(DBIdentifier name,
DBDictionary dict)
|
boolean |
containsColumn(String name)
Deprecated. |
boolean |
containsColumn(String name,
DBDictionary dict)
Deprecated. |
Column[] |
getAutoAssignedColumns()
Return this table's auto-assigned columns. |
int |
getColNumber()
Return the column number in the line of the file at which this instance was parsed. |
Column |
getColumn(DBIdentifier name)
|
Column |
getColumn(String name)
Deprecated. |
String[] |
getColumnNames()
|
Column[] |
getColumns()
Return the table's columns, in alphabetical order. |
String |
getComment()
|
ForeignKey |
getForeignKey(DBIdentifier name)
|
ForeignKey |
getForeignKey(String name)
Deprecated. |
ForeignKey[] |
getForeignKeys()
Return all foreign keys for the table. |
DBIdentifier |
getFullIdentifier()
|
String |
getFullName()
Deprecated. |
DBIdentifier |
getIdentifier()
|
Index |
getIndex(DBIdentifier name)
|
Index |
getIndex(String name)
Deprecated. |
Index[] |
getIndexes()
Return the table's indexes. |
int |
getLineNumber()
Return the line number of the file at which this instance was parsed. |
String |
getName()
Deprecated. |
PrimaryKey |
getPrimaryKey()
Return the primary key for the table, if any. |
QualifiedDBIdentifier |
getQualifiedPath()
|
Column[] |
getRelationIdColumns()
Return this table's relation id columns. |
String |
getResourceName()
Return the domain-meaningful name of the resource that was loaded from this source. |
Schema |
getSchema()
Return the schema for the table. |
DBIdentifier |
getSchemaIdentifier()
|
String |
getSchemaName()
Deprecated. |
File |
getSourceFile()
Return the file from which this instance was parsed. |
Object |
getSourceScope()
Return the domain-dependent scope of this instance within its file. |
int |
getSourceType()
Return the type of source. |
Unique |
getUnique(DBIdentifier name)
|
Unique |
getUnique(String name)
Deprecated. |
Unique[] |
getUniques()
Return the table's unique constraints. |
boolean |
hasComment()
|
Column |
importColumn(Column col)
Import a column from another table. |
ForeignKey |
importForeignKey(ForeignKey fk)
Import a foreign key; column names must match columns of this table. |
Index |
importIndex(Index idx)
Import an index; column names must match columns of this table. |
PrimaryKey |
importPrimaryKey(PrimaryKey pk)
Import a primary key; column names must match columns of this table. |
Unique |
importUnique(Unique unq)
Import a constraint; column names must match columns of this table. |
(package private) void |
indexColumns()
Called by columns to ensure that all columns are properly indexed before returning that information to the user. |
(package private) void |
indexForeignKeys()
Called by foreign keys to ensure that all fks are properly indexed before returning that information to the user. |
boolean |
isAssociation()
|
(package private) void |
remove()
Called when the table is removed from its schema. |
boolean |
removeColumn(Column col)
Remove the given column from the table. |
boolean |
removeForeignKey(ForeignKey fk)
Remove the given foreign key from the table. |
boolean |
removeIndex(Index idx)
Remove the given index from the table. |
boolean |
removePrimaryKey()
Remove the primary key from this table. |
boolean |
removeUnique(Unique unq)
Remove the given unique constraint from the table. |
void |
setAssociation()
|
void |
setColNumber(int colNum)
|
void |
setComment(String comment)
|
void |
setIdentifier(DBIdentifier name)
|
void |
setLineNumber(int lineNum)
|
void |
setName(String name)
Deprecated. |
void |
setSchemaIdentifier(DBIdentifier name)
|
void |
setSchemaName(String name)
Deprecated. |
void |
setSource(File source,
int srcType)
|
String |
toString()
|
Methods inherited from class org.apache.openjpa.jdbc.schema.NameSet |
---|
addName, addName, isNameTaken, isNameTaken, removeName, removeName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Table()
public Table(String name, Schema schema)
name
- the table nameschema
- the table schemapublic Table(DBIdentifier name, Schema schema)
Method Detail |
---|
public void setAssociation()
public boolean isAssociation()
void remove()
public Schema getSchema()
public String getSchemaName()
public DBIdentifier getSchemaIdentifier()
public void setSchemaName(String name)
public void setSchemaIdentifier(DBIdentifier name)
public String getName()
public DBIdentifier getIdentifier()
public void setName(String name)
public void setIdentifier(DBIdentifier name)
public String getFullName()
public QualifiedDBIdentifier getQualifiedPath()
public DBIdentifier getFullIdentifier()
public File getSourceFile()
SourceTracker
getSourceFile
in interface SourceTracker
public Object getSourceScope()
SourceTracker
getSourceScope
in interface SourceTracker
public int getSourceType()
SourceTracker
getSourceType
in interface SourceTracker
public void setSource(File source, int srcType)
public String getResourceName()
SourceTracker
getResourceName
in interface SourceTracker
public Column[] getColumns()
public Column[] getAutoAssignedColumns()
public Column[] getRelationIdColumns()
public String[] getColumnNames()
public Column getColumn(String name)
public Column getColumn(DBIdentifier name)
public boolean containsColumn(String name)
can have side-effect of creating a column
for dynamic table implementation.
public boolean containsColumn(DBIdentifier name)
public boolean containsColumn(String name, DBDictionary dict)
dict
- the current database dictionary or null.can have side-effect of creating a column
for dynamic table implementation.
public boolean containsColumn(DBIdentifier name, DBDictionary dict)
public Column addColumn(String name)
public Column addColumn(DBIdentifier name)
public Column addColumn(String name, String validName)
public Column addColumn(DBIdentifier name, DBIdentifier validName)
public void addCorrectedColumnName(String name, boolean validate)
public void addCorrectedColumnName(DBIdentifier name, boolean validate)
public boolean removeColumn(Column col)
public Column importColumn(Column col)
public PrimaryKey getPrimaryKey()
public PrimaryKey addPrimaryKey()
public PrimaryKey addPrimaryKey(String name)
public PrimaryKey addPrimaryKey(DBIdentifier name)
public boolean removePrimaryKey()
public PrimaryKey importPrimaryKey(PrimaryKey pk)
public ForeignKey getForeignKey(String name)
public ForeignKey getForeignKey(DBIdentifier name)
public ForeignKey[] getForeignKeys()
public ForeignKey addForeignKey()
public ForeignKey addForeignKey(String name)
public ForeignKey addForeignKey(DBIdentifier name)
public boolean removeForeignKey(ForeignKey fk)
public ForeignKey importForeignKey(ForeignKey fk)
public Index[] getIndexes()
public Index getIndex(String name)
public Index getIndex(DBIdentifier name)
public Index addIndex(String name)
public Index addIndex(DBIdentifier name)
public boolean removeIndex(Index idx)
public Index importIndex(Index idx)
public Unique[] getUniques()
public Unique getUnique(String name)
public Unique getUnique(DBIdentifier name)
public Unique addUnique(String name)
public Unique addUnique(DBIdentifier name)
public boolean removeUnique(Unique unq)
public Unique importUnique(Unique unq)
void indexColumns()
void indexForeignKeys()
void changeAutoAssigned(Column col)
void changeRelationId(Column col)
public int compareTo(Object other)
compareTo
in interface Comparable<Object>
public String toString()
toString
in class Object
public boolean hasComment()
public String getComment()
public void setComment(String comment)
public int getLineNumber()
SourceTracker
getLineNumber
in interface SourceTracker
public void setLineNumber(int lineNum)
public int getColNumber()
SourceTracker
getColNumber
in interface SourceTracker
public void setColNumber(int colNum)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |