|
||||||||||
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(String name,
Schema schema)
Constructor. |
Method Summary | |
---|---|
Column |
addColumn(String name)
Add a column to the table. |
ForeignKey |
addForeignKey()
Add a foreign key to the table. |
ForeignKey |
addForeignKey(String name)
Add a foreign key to the table. |
Index |
addIndex(String name)
Add an index to the table. |
PrimaryKey |
addPrimaryKey()
Set the primary key for the table. |
PrimaryKey |
addPrimaryKey(String name)
Set the primary key for the table. |
Unique |
addUnique(String name)
Add a unique constraint to the table. |
int |
compareTo(Object other)
|
boolean |
containsColumn(String name)
Affirms if this table contains the column of the given name without any side-effect. |
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(String name)
Return the column with the given name, or null if none. |
String[] |
getColumnNames()
|
Column[] |
getColumns()
Return the table's columns, in alphabetical order. |
String |
getComment()
|
ForeignKey |
getForeignKey(String name)
Return the foreign key with the given name. |
ForeignKey[] |
getForeignKeys()
Return all foreign keys for the table. |
String |
getFullName()
Return the table name, including schema, using '.' as the catalog separator. |
Index |
getIndex(String name)
Return the index with the given name, or null if none. |
Index[] |
getIndexes()
Return the table's indexes. |
int |
getLineNumber()
Return the line number of the file at which this instance was parsed. |
String |
getName()
Return the name of the table. |
PrimaryKey |
getPrimaryKey()
Return the primary key for the table, if any. |
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. |
String |
getSchemaName()
The table's schema name. |
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(String name)
Return the unique constraint with the given name, or null if none. |
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. |
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 |
setColNumber(int colNum)
|
void |
setComment(String comment)
|
void |
setLineNumber(int lineNum)
|
void |
setName(String name)
Set the name of the table. |
void |
setSchemaName(String name)
The table's schema name. |
void |
setSource(File source,
int srcType)
|
String |
toString()
|
Methods inherited from class org.apache.openjpa.jdbc.schema.NameSet |
---|
addName, isNameTaken, 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 schemaMethod Detail |
---|
public Schema getSchema()
public String getSchemaName()
public void setSchemaName(String name)
public String getName()
public void setName(String name)
public String getFullName()
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 boolean containsColumn(String name)
can have side-effect of creating a column
for dynamic table implementation.
public Column addColumn(String name)
public boolean removeColumn(Column col)
public Column importColumn(Column col)
public PrimaryKey getPrimaryKey()
public PrimaryKey addPrimaryKey()
public PrimaryKey addPrimaryKey(String name)
public boolean removePrimaryKey()
public PrimaryKey importPrimaryKey(PrimaryKey pk)
public ForeignKey getForeignKey(String name)
public ForeignKey[] getForeignKeys()
public ForeignKey addForeignKey()
public ForeignKey addForeignKey(String name)
public boolean removeForeignKey(ForeignKey fk)
public ForeignKey importForeignKey(ForeignKey fk)
public Index[] getIndexes()
public Index getIndex(String name)
public Index addIndex(String name)
public boolean removeIndex(Index idx)
public Index importIndex(Index idx)
public Unique[] getUniques()
public Unique getUnique(String name)
public Unique addUnique(String name)
public boolean removeUnique(Unique unq)
public Unique importUnique(Unique unq)
public int compareTo(Object other)
compareTo
in interface Comparable
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 |