org.jboss.dna.common.jdbc.model.spi
Class TableBean

java.lang.Object
  extended by org.jboss.dna.common.jdbc.model.spi.CoreMetaDataBean
      extended by org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
          extended by org.jboss.dna.common.jdbc.model.spi.SchemaObjectBean
              extended by org.jboss.dna.common.jdbc.model.spi.TableBean
All Implemented Interfaces:
Serializable, CoreMetaData, DatabaseNamedObject, SchemaObject, Table

public class TableBean
extends SchemaObjectBean
implements Table

Provides all core database table specific metadata.

Author:
Sergiy Litsenko
See Also:
Serialized Form

Constructor Summary
TableBean()
          Default constructor
 
Method Summary
 void addBestRowIdentifier(BestRowIdentifier bestRowIdentifier)
          Adds BestRowIdentifier
 void addColumn(TableColumn column)
          Adds TableColumn
 void addForeignKey(ForeignKey foreignKey)
          adds ForeignKey
 void addIndex(Index index)
          adds Index
 void addPrivilege(Privilege privilege)
          Adds table priviledge
 void addVersionColumn(TableColumn tableColumn)
          adds version column
 void deleteBestRowIdentifier(BestRowIdentifier bestRowIdentifier)
          deletes BestRowIdentifier
 void deleteColumn(TableColumn column)
          deletes TableColumn
 void deleteForeignKey(ForeignKey foreignKey)
          deletes ForeignKey
 void deleteIndex(Index index)
          deletes Index
 void deletePrivilege(Privilege privilege)
          Deletes table priviledge
 void deleteVersionColumn(TableColumn tableColumn)
          deletes version column
 BestRowIdentifier findBestRowIdentifierByScopeType(BestRowIdentifierScopeType scopeType)
          Searches the BestRowIdentifier by scope
 TableColumn findColumnByName(String columnName)
          Returns table column for specified column name or null
 ForeignKey findForeignKeyByName(String fkName)
          Returns table foreign key for specified name or null
 Index findIndexByName(String indexName)
          Returns table index for specified name or null
 Privilege findPriviledgeByName(String priviledgeName)
          Searches priviledge by name
 TableColumn findVersionColumnByName(String columnName)
          Returns table version column for specified name or null
 Set<BestRowIdentifier> getBestRowIdentifiers()
          Retrieves a set of descriptions of a table's optimal set of columns that uniquely identifies a row in temporary scopes.
 Set<TableColumn> getColumns()
          Gets a set of table columns
 Set<ForeignKey> getForeignKeys()
          Gets a set of table foreign key columns
 Set<Index> getIndexes()
          Gets a set of table indexes
 PrimaryKey getPrimaryKey()
          Gets a table primary key
 Set<Privilege> getPrivileges()
          Gets table privileges.
 String getReferenceGeneration()
          specifies how values in getSelfReferencingColumnName () are created.
 String getSelfReferencingColumnName()
          Gets name of the designated "identifier" column of a typed table (may be null)
 Table getSuperTable()
          Retrieves a description of the table hierarchies defined in a particular schema in this database.
 TableType getTableType()
          Returns type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
 Catalog getTypeCatalog()
          Gets type catalog
 String getTypeName()
          Gets type name
 Schema getTypeSchema()
          Gets type schema
 Set<TableColumn> getVersionColumns()
          Gets a set of table version columns
 void setPrimaryKey(PrimaryKey primaryKey)
          Sets a table primary key
 void setReferenceGeneration(String referenceGeneration)
          specifies how values in getSelfReferencingColumnName () are created.
 void setSelfReferencingColumnName(String selfReferencingColumnName)
          Sets name of the designated "identifier" column of a typed table (may be null)
 void setSuperTable(Table superTable)
          Sets a description of the table hierarchies defined in a particular schema in this database.
 void setTableType(TableType tableType)
          Sets type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
 void setTypeCatalog(Catalog typeCatalog)
          Sets type catalog
 void setTypeName(String typeName)
          Sets type name
 void setTypeSchema(Schema typeSchema)
          Sets type schema
 
Methods inherited from class org.jboss.dna.common.jdbc.model.spi.SchemaObjectBean
getCatalog, getSchema, setCatalog, setSchema
 
Methods inherited from class org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.SchemaObject
getCatalog, getSchema, setCatalog, setSchema
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 

Constructor Detail

TableBean

public TableBean()
Default constructor

Method Detail

getTableType

public TableType getTableType()
Returns type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".

Specified by:
getTableType in interface Table
Returns:
type of table.

setTableType

public void setTableType(TableType tableType)
Sets type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".

Specified by:
setTableType in interface Table
Parameters:
tableType - the type of table.

getTypeCatalog

public Catalog getTypeCatalog()
Gets type catalog

Specified by:
getTypeCatalog in interface Table
Returns:
types catalog (may be null)

setTypeCatalog

public void setTypeCatalog(Catalog typeCatalog)
Sets type catalog

Specified by:
setTypeCatalog in interface Table
Parameters:
typeCatalog - the types catalog (may be null)

getTypeSchema

public Schema getTypeSchema()
Gets type schema

Specified by:
getTypeSchema in interface Table
Returns:
types schema (may be null)

setTypeSchema

public void setTypeSchema(Schema typeSchema)
Sets type schema

Specified by:
setTypeSchema in interface Table
Parameters:
typeSchema - the types schema (may be null)

getTypeName

public String getTypeName()
Gets type name

Specified by:
getTypeName in interface Table
Returns:
types name (may be null)

setTypeName

public void setTypeName(String typeName)
Sets type name

Specified by:
setTypeName in interface Table
Parameters:
typeName - types name (may be null)

getSelfReferencingColumnName

public String getSelfReferencingColumnName()
Gets name of the designated "identifier" column of a typed table (may be null)

Specified by:
getSelfReferencingColumnName in interface Table
Returns:
name of the designated "identifier" column of a typed table (may be null)

setSelfReferencingColumnName

public void setSelfReferencingColumnName(String selfReferencingColumnName)
Sets name of the designated "identifier" column of a typed table (may be null)

Specified by:
setSelfReferencingColumnName in interface Table
Parameters:
selfReferencingColumnName - the name of the designated "identifier" column of a typed table (may be null)

getReferenceGeneration

public String getReferenceGeneration()
specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be null)

Specified by:
getReferenceGeneration in interface Table
Returns:
how values in getSelfReferencingColumnName () are created.

setReferenceGeneration

public void setReferenceGeneration(String referenceGeneration)
specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be null)

Specified by:
setReferenceGeneration in interface Table
Parameters:
referenceGeneration - how values in getSelfReferencingColumnName () are created.

getColumns

public Set<TableColumn> getColumns()
Gets a set of table columns

Specified by:
getColumns in interface Table
Returns:
a set of table columns.

addColumn

public void addColumn(TableColumn column)
Adds TableColumn

Specified by:
addColumn in interface Table
Parameters:
column - the TableColumn

deleteColumn

public void deleteColumn(TableColumn column)
deletes TableColumn

Specified by:
deleteColumn in interface Table
Parameters:
column - the TableColumn

findColumnByName

public TableColumn findColumnByName(String columnName)
Returns table column for specified column name or null

Specified by:
findColumnByName in interface Table
Parameters:
columnName - the name of column
Returns:
table column for specified column name or null.

getPrimaryKey

public PrimaryKey getPrimaryKey()
Gets a table primary key

Specified by:
getPrimaryKey in interface Table
Returns:
a table primary key.

setPrimaryKey

public void setPrimaryKey(PrimaryKey primaryKey)
Sets a table primary key

Specified by:
setPrimaryKey in interface Table
Parameters:
primaryKey - the table primary key.

getForeignKeys

public Set<ForeignKey> getForeignKeys()
Gets a set of table foreign key columns

Specified by:
getForeignKeys in interface Table
Returns:
a set of table foreign keys.

addForeignKey

public void addForeignKey(ForeignKey foreignKey)
adds ForeignKey

Specified by:
addForeignKey in interface Table
Parameters:
foreignKey - the ForeignKey

deleteForeignKey

public void deleteForeignKey(ForeignKey foreignKey)
deletes ForeignKey

Specified by:
deleteForeignKey in interface Table
Parameters:
foreignKey - the ForeignKey

findForeignKeyByName

public ForeignKey findForeignKeyByName(String fkName)
Returns table foreign key for specified name or null

Specified by:
findForeignKeyByName in interface Table
Parameters:
fkName - the name of foreign key
Returns:
table foreign key for specified name or null.

getIndexes

public Set<Index> getIndexes()
Gets a set of table indexes

Specified by:
getIndexes in interface Table
Returns:
a set of table indexes.

addIndex

public void addIndex(Index index)
adds Index

Specified by:
addIndex in interface Table
Parameters:
index - the Index

deleteIndex

public void deleteIndex(Index index)
deletes Index

Specified by:
deleteIndex in interface Table
Parameters:
index - the Index

findIndexByName

public Index findIndexByName(String indexName)
Returns table index for specified name or null

Specified by:
findIndexByName in interface Table
Parameters:
indexName - the name of index
Returns:
table index for specified name or null.

getVersionColumns

public Set<TableColumn> getVersionColumns()
Gets a set of table version columns

Specified by:
getVersionColumns in interface Table
Returns:
a set of table version columns.

addVersionColumn

public void addVersionColumn(TableColumn tableColumn)
adds version column

Specified by:
addVersionColumn in interface Table
Parameters:
tableColumn - the TableColumn

deleteVersionColumn

public void deleteVersionColumn(TableColumn tableColumn)
deletes version column

Specified by:
deleteVersionColumn in interface Table
Parameters:
tableColumn - the version column

findVersionColumnByName

public TableColumn findVersionColumnByName(String columnName)
Returns table version column for specified name or null

Specified by:
findVersionColumnByName in interface Table
Parameters:
columnName - the name of Version Column
Returns:
table Version Column for specified name or null.

getPrivileges

public Set<Privilege> getPrivileges()
Gets table privileges.

Specified by:
getPrivileges in interface Table
Returns:
set of table privileges

addPrivilege

public void addPrivilege(Privilege privilege)
Adds table priviledge

Specified by:
addPrivilege in interface Table
Parameters:
privilege - the table priviledge

deletePrivilege

public void deletePrivilege(Privilege privilege)
Deletes table priviledge

Specified by:
deletePrivilege in interface Table
Parameters:
privilege - the table priviledge

findPriviledgeByName

public Privilege findPriviledgeByName(String priviledgeName)
Searches priviledge by name

Specified by:
findPriviledgeByName in interface Table
Parameters:
priviledgeName - the priviledge name to search
Returns:
priviledge if found, otherwise return null

getBestRowIdentifiers

public Set<BestRowIdentifier> getBestRowIdentifiers()
Retrieves a set of descriptions of a table's optimal set of columns that uniquely identifies a row in temporary scopes.

Specified by:
getBestRowIdentifiers in interface Table
Returns:
BestRowIdentifier set that uniquely identifies a row in scopes.

addBestRowIdentifier

public void addBestRowIdentifier(BestRowIdentifier bestRowIdentifier)
Adds BestRowIdentifier

Specified by:
addBestRowIdentifier in interface Table
Parameters:
bestRowIdentifier - the BestRowIdentifier

deleteBestRowIdentifier

public void deleteBestRowIdentifier(BestRowIdentifier bestRowIdentifier)
deletes BestRowIdentifier

Specified by:
deleteBestRowIdentifier in interface Table
Parameters:
bestRowIdentifier - the BestRowIdentifier

findBestRowIdentifierByScopeType

public BestRowIdentifier findBestRowIdentifierByScopeType(BestRowIdentifierScopeType scopeType)
Searches the BestRowIdentifier by scope

Specified by:
findBestRowIdentifierByScopeType in interface Table
Parameters:
scopeType - the scope of best row identifier
Returns:
BestRowIdentifier if any

getSuperTable

public Table getSuperTable()
Retrieves a description of the table hierarchies defined in a particular schema in this database. Only the immediate super type/ sub type relationship is modeled.

Specified by:
getSuperTable in interface Table
Returns:
super table for this table
Since:
1.4 (JDBC 3.0)

setSuperTable

public void setSuperTable(Table superTable)
Sets a description of the table hierarchies defined in a particular schema in this database. Only the immediate super type/ sub type relationship is modeled.

Specified by:
setSuperTable in interface Table
Parameters:
superTable - the super table for this table
Since:
1.4 (JDBC 3.0)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.