public class Table extends NameSet implements Comparable<Object>, SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
Constructor and Description |
---|
Table()
Default constructor.
|
Table(DBIdentifier name,
Schema schema) |
Table(String name,
Schema schema)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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.
|
int |
compareTo(Object other) |
boolean |
containsColumn(Column col) |
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(DBIdentifier name,
boolean create) |
Column |
getColumn(String name)
Deprecated.
|
String[] |
getColumnNames()
Return the list of column names, used only for informative (error) messages.
|
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.
|
boolean |
isAssociation() |
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)
Set the name of the table.
|
void |
setLineNumber(int lineNum) |
void |
setName(String name)
Deprecated.
use
setIdentifier(DBIdentifier) instead. |
void |
setSchemaIdentifier(DBIdentifier name) |
void |
setSchemaName(String name)
Deprecated.
|
void |
setSource(File source,
int srcType) |
String |
toString() |
addName, addName, isNameTaken, isNameTaken, removeName, removeName
public Table()
@Deprecated public Table(String name, Schema schema)
name
- the table nameschema
- the table schemapublic Table(DBIdentifier name, Schema schema)
public void setAssociation()
public boolean isAssociation()
public Schema getSchema()
@Deprecated public String getSchemaName()
public DBIdentifier getSchemaIdentifier()
@Deprecated public void setSchemaName(String name)
public void setSchemaIdentifier(DBIdentifier name)
@Deprecated public String getName()
public DBIdentifier getIdentifier()
@Deprecated public void setName(String name)
setIdentifier(DBIdentifier)
instead.public void setIdentifier(DBIdentifier name)
name
- The name of the table.IllegalStateException
- if getSchema()
does not return null.@Deprecated 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()
@Deprecated public Column getColumn(String name)
public Column getColumn(DBIdentifier name)
public Column getColumn(DBIdentifier name, boolean create)
@Deprecated public boolean containsColumn(String name)
public boolean containsColumn(DBIdentifier name)
@Deprecated 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 boolean containsColumn(Column col)
@Deprecated public Column addColumn(String name)
public Column addColumn(DBIdentifier name)
@Deprecated public Column addColumn(String name, String validName)
public Column addColumn(DBIdentifier name, DBIdentifier validName)
@Deprecated public void addCorrectedColumnName(String name, boolean validate)
public void addCorrectedColumnName(DBIdentifier name, boolean validate)
public boolean removeColumn(Column col)
public PrimaryKey getPrimaryKey()
public PrimaryKey addPrimaryKey()
@Deprecated public PrimaryKey addPrimaryKey(String name)
public PrimaryKey addPrimaryKey(DBIdentifier name)
public boolean removePrimaryKey()
public PrimaryKey importPrimaryKey(PrimaryKey pk)
@Deprecated public ForeignKey getForeignKey(String name)
public ForeignKey getForeignKey(DBIdentifier name)
public ForeignKey[] getForeignKeys()
public ForeignKey addForeignKey()
@Deprecated public ForeignKey addForeignKey(String name)
public ForeignKey addForeignKey(DBIdentifier name)
public boolean removeForeignKey(ForeignKey fk)
public ForeignKey importForeignKey(ForeignKey fk)
public Index[] getIndexes()
@Deprecated public Index getIndex(String name)
public Index getIndex(DBIdentifier name)
@Deprecated public Index addIndex(String name)
public Index addIndex(DBIdentifier name)
public boolean removeIndex(Index idx)
public Index importIndex(Index idx)
public Unique[] getUniques()
@Deprecated public Unique getUnique(String name)
public Unique getUnique(DBIdentifier name)
@Deprecated public Unique addUnique(String name)
public Unique addUnique(DBIdentifier name)
public boolean removeUnique(Unique unq)
public Unique importUnique(Unique unq)
public int compareTo(Object other)
compareTo
in interface Comparable<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)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.