|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ dictionary overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.sql.dictionary
Class TableDescriptor

java.lang.Objectorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.TableDescriptor
- All Implemented Interfaces:
- org.apache.derby.catalog.Dependable, org.apache.derby.iapi.sql.depend.Provider, UniqueSQLObjectDescriptor, UniqueTupleDescriptor
- public class TableDescriptor
- extends TupleDescriptor
- implements UniqueSQLObjectDescriptor, org.apache.derby.iapi.sql.depend.Provider
- extends TupleDescriptor
This class represents a table descriptor. The external interface to this class is:
- external interface
- public String getSchemaName();
- public String getQualifiedName();
- public int getTableType();
- public long getHeapConglomerateId() throws StandardException;
- public int getNumberOfColumns();
- public FormatableBitSet getReferencedColumnMap();
- public void setReferencedColumnMap(FormatableBitSet referencedColumnMap);
- public int getMaxColumnID() throws StandardException;
- public void setUUID(UUID uuid);
- public char getLockGranularity();
- public void setTableName(String newTableName);
- public void setLockGranularity(char lockGranularity);
- public ExecRow getEmptyExecRow( ContextManager cm) throws StandardException;
- public boolean tableNameEquals(String otherSchemaName, String otherTableName);
- public ReferencedKeyConstraintDescriptor getPrimaryKey() throws StandardException;
- public void removeConglomerateDescriptor(ConglomerateDescriptor cd) throws StandardException;
- public void removeConstraintDescriptor(ConstraintDescriptor cd) throws StandardException;
- public void getAffectedIndexes(...) throws StandardException;
- public void getAllRelevantTriggers(...) throws StandardException;
- public void getAllRelevantConstraints(...) throws StandardException
- public ColumnDescriptorList getColumnDescriptorList();
- public String[] getColumnNamesArray();
- public long[] getAutoincIncrementArray();
- public ColumnDescriptor getColumnDescriptor(String columnName);
- public ColumnDescriptor getColumnDescriptor(int columnNumber);
- public ConglomerateDescriptor[] getConglomerateDescriptors() throws StandardException;
- public ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException;
- public ConglomerateDescriptor getConglomerateDescriptor(UUID conglomerateUUID) throws StandardException;
- public IndexLister getIndexLister() throws StandardException;
- public ViewDescriptor getViewDescriptor();
- public boolean tableHasAutoincrement();
- public boolean statisticsExist(ConglomerateDescriptor cd) throws StandardException;
- public double selectivityForConglomerate(...)throws StandardException;
| Fields inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor |
COLUMN_LIST, CONGLOMERATE_LIST, CONSTRAINT_LIST, TRIGGER_LIST |
| Fields inherited from interface org.apache.derby.catalog.Dependable |
ALIAS, COLUMNS_IN_TABLE, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PREPARED_STATEMENT, SCHEMA, STORED_PREPARED_STATEMENT, TABLE, TRIGGER, VIEW |
| Constructor Summary | |
TableDescriptor(DataDictionary dataDictionary,
java.lang.String tableName,
SchemaDescriptor schema,
int tableType,
boolean onCommitDeleteRows,
boolean onRollbackDeleteRows)
Constructor for a TableDescriptor (this is for a temporary table). |
|
TableDescriptor(DataDictionary dataDictionary,
java.lang.String tableName,
SchemaDescriptor schema,
int tableType,
char lockGranularity)
Constructor for a TableDescriptor. |
|
| Method Summary | |
void |
emptyConstraintDescriptorList()
Empty the constraint descriptor list |
void |
emptyTriggerDescriptorList()
Empty the trigger descriptor list |
void |
getAllRelevantConstraints(int statementType,
boolean skipCheckConstraints,
int[] changedColumnIds,
boolean[] needsDeferredProcessing,
ConstraintDescriptorList relevantConstraints)
Gets all of the relevant constraints for a statement, given its statement type and its list of updated columns. |
void |
getAllRelevantTriggers(int statementType,
int[] changedColumnIds,
GenericDescriptorList relevantTriggers)
Builds a list of all triggers which are relevant to a given statement type, given a list of updated columns. |
long[] |
getAutoincIncrementArray()
gets an array of increment values for autoincrement columns in the target table. |
java.lang.String |
getClassType()
Get the provider's type. |
ColumnDescriptor |
getColumnDescriptor(int columnNumber)
|
ColumnDescriptor |
getColumnDescriptor(java.lang.String columnName)
Get the descriptor for a column in the table, either by the column name or by its ordinal position (column number). |
ColumnDescriptorList |
getColumnDescriptorList()
Gets the column descriptor list |
java.lang.String[] |
getColumnNamesArray()
Gets an array of column names. |
ConglomerateDescriptor |
getConglomerateDescriptor(long conglomerateNumber)
Gets a conglomerate descriptor for the given table and conglomerate number. |
ConglomerateDescriptor |
getConglomerateDescriptor(org.apache.derby.catalog.UUID conglomerateUUID)
Gets a conglomerate descriptor for the given table and conglomerate UUID String. |
ConglomerateDescriptorList |
getConglomerateDescriptorList()
Gets the conglomerate descriptor list |
ConglomerateDescriptor[] |
getConglomerateDescriptors()
Gets a ConglomerateDescriptor[] to loop through all the conglomerate descriptors for the table. |
ConglomerateDescriptor[] |
getConglomerateDescriptors(long conglomerateNumber)
Gets array of conglomerate descriptors for the given table and conglomerate number. |
ConglomerateDescriptor[] |
getConglomerateDescriptors(org.apache.derby.catalog.UUID conglomerateUUID)
Gets array of conglomerate descriptors for the given table and conglomerate UUID. |
ConstraintDescriptorList |
getConstraintDescriptorList()
Gets the constraint descriptor list |
org.apache.derby.catalog.DependableFinder |
getDependableFinder()
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable. |
java.lang.String |
getDescriptorName()
|
java.lang.String |
getDescriptorType()
Each descriptor must identify itself with its type; i.e index, check constraint whatever. |
org.apache.derby.iapi.sql.execute.ExecRow |
getEmptyExecRow(org.apache.derby.iapi.services.context.ContextManager cm)
Gets an ExecRow for rows stored in the table this describes. |
long |
getHeapConglomerateId()
Gets the id for the heap conglomerate of the table. |
IndexLister |
getIndexLister()
Gets an object which lists out all the index row generators on a table together with their conglomerate ids. |
char |
getLockGranularity()
Gets the lock granularity for the table. |
int |
getMaxColumnID()
Gets the highest column id in the table. |
java.lang.String |
getName()
Gets the name of the table. |
int |
getNumberOfColumns()
Gets the number of columns in the table. |
org.apache.derby.catalog.UUID |
getObjectID()
Get the provider's UUID |
java.lang.String |
getObjectName()
Return the name of this Provider. |
ReferencedKeyConstraintDescriptor |
getPrimaryKey()
Gets the primary key, may return null if no primary key |
java.lang.String |
getQualifiedName()
Gets the full, qualified name of the table. |
org.apache.derby.iapi.services.io.FormatableBitSet |
getReferencedColumnMap()
Get the referenced column map of the table. |
SchemaDescriptor |
getSchemaDescriptor()
Gets the SchemaDescriptor for this TableDescriptor. |
java.lang.String |
getSchemaName()
Gets the name of the schema the table lives in. |
private java.util.List |
getStatistics()
Returns a list of statistics for this table. |
int |
getTableType()
Gets an identifier telling what type of table this is (base table, declared global temporary table, view, etc.) |
int |
getTotalNumberOfIndexes()
Gets the number of indexes on the table, including the backing indexes. |
GenericDescriptorList |
getTriggerDescriptorList()
Gets the trigger descriptor list |
org.apache.derby.catalog.UUID |
getUUID()
Gets the UUID of the table. |
ViewDescriptor |
getViewDescriptor()
Gets the view descriptor for this TableDescriptor. |
boolean |
isOnCommitDeleteRows()
Gets the on commit behavior for the declared global temporary table. |
boolean |
isOnRollbackDeleteRows()
Gets the on rollback behavior for the declared global temporary table. |
boolean |
isPersistent()
Is this provider persistent? A stored dependency will be required if both the dependent and provider are persistent. |
boolean |
isSynonymDescriptor()
Is this descriptor represents a synonym? |
private java.lang.String |
quoteStringIfNecessary(java.lang.String name)
If the name has double quotes in it, put two double quotes for every single double quote. |
void |
removeConglomerateDescriptor(ConglomerateDescriptor cd)
Remove this descriptor |
void |
removeConstraintDescriptor(ConstraintDescriptor cd)
Remove this descriptor. |
void |
resetHeapConglomNumber()
Sets the heapConglomNumber to -1 for temporary table since the table was dropped and recreated at the commit time and hence its conglomerate id has changed. |
double |
selectivityForConglomerate(ConglomerateDescriptor cd,
int numKeys)
For this conglomerate (index), return the selectivity of the first numKeys. |
void |
setConstraintDescriptorList(ConstraintDescriptorList newCDL)
Sets the constraint descriptor list |
void |
setLockGranularity(char lockGranularity)
Sets the lock granularity for the table to the specified value. |
void |
setReferencedColumnMap(org.apache.derby.iapi.services.io.FormatableBitSet referencedColumnMap)
Set the referenced column map of the table. |
void |
setTableName(java.lang.String newTableName)
Sets the the table name in case of rename table. |
void |
setTriggerDescriptorList(GenericDescriptorList newCDL)
Sets the trigger descriptor list |
void |
setUUID(org.apache.derby.catalog.UUID oid)
Sets the UUID of the table |
void |
setViewDescriptor(ViewDescriptor viewDescriptor)
Set (cache) the view descriptor for this TableDescriptor |
boolean |
statisticsExist(ConglomerateDescriptor cd)
Are there statistics for this particular conglomerate. |
boolean |
tableHasAutoincrement()
Does the table have an autoincrement column or not? |
boolean |
tableNameEquals(java.lang.String otherTableName,
java.lang.String otherSchemaName)
Compare the tables descriptors based on the names. |
java.lang.String |
toString()
Prints the contents of the TableDescriptor |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor |
getColumnDependableFinder, getDataDictionary, getDependableFinder, setDataDictionary |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
BASE_TABLE_TYPE
public static final int BASE_TABLE_TYPE
- See Also:
- Constant Field Values
SYSTEM_TABLE_TYPE
public static final int SYSTEM_TABLE_TYPE
- See Also:
- Constant Field Values
VIEW_TYPE
public static final int VIEW_TYPE
- See Also:
- Constant Field Values
GLOBAL_TEMPORARY_TABLE_TYPE
public static final int GLOBAL_TEMPORARY_TABLE_TYPE
- See Also:
- Constant Field Values
SYNONYM_TYPE
public static final int SYNONYM_TYPE
- See Also:
- Constant Field Values
ROW_LOCK_GRANULARITY
public static final char ROW_LOCK_GRANULARITY
- See Also:
- Constant Field Values
TABLE_LOCK_GRANULARITY
public static final char TABLE_LOCK_GRANULARITY
- See Also:
- Constant Field Values
DEFAULT_LOCK_GRANULARITY
public static final char DEFAULT_LOCK_GRANULARITY
- See Also:
- Constant Field Values
lockGranularity
private char lockGranularity
onCommitDeleteRows
private boolean onCommitDeleteRows
onRollbackDeleteRows
private boolean onRollbackDeleteRows
schema
SchemaDescriptor schema
tableName
java.lang.String tableName
oid
org.apache.derby.catalog.UUID oid
tableType
int tableType
heapConglomNumber
long heapConglomNumber
columnDescriptorList
ColumnDescriptorList columnDescriptorList
conglomerateDescriptorList
ConglomerateDescriptorList conglomerateDescriptorList
constraintDescriptorList
ConstraintDescriptorList constraintDescriptorList
triggerDescriptorList
private GenericDescriptorList triggerDescriptorList
viewDescriptor
ViewDescriptor viewDescriptor
referencedColumnMap
org.apache.derby.iapi.services.io.FormatableBitSet referencedColumnMap
statisticsDescriptorList
private java.util.List statisticsDescriptorList
- A list of statistics pertaining to this table--
| Constructor Detail |
TableDescriptor
public TableDescriptor(DataDictionary dataDictionary, java.lang.String tableName, SchemaDescriptor schema, int tableType, boolean onCommitDeleteRows, boolean onRollbackDeleteRows)
- Constructor for a TableDescriptor (this is for a temporary table).
TableDescriptor
public TableDescriptor(DataDictionary dataDictionary, java.lang.String tableName, SchemaDescriptor schema, int tableType, char lockGranularity)
- Constructor for a TableDescriptor.
| Method Detail |
getSchemaName
public java.lang.String getSchemaName()
- Gets the name of the schema the table lives in.
getSchemaDescriptor
public SchemaDescriptor getSchemaDescriptor()
- Gets the SchemaDescriptor for this TableDescriptor.
- Specified by:
getSchemaDescriptorin interfaceUniqueSQLObjectDescriptor
getName
public java.lang.String getName()
- Gets the name of the table.
- Specified by:
getNamein interfaceUniqueSQLObjectDescriptor
setTableName
public void setTableName(java.lang.String newTableName)
- Sets the the table name in case of rename table.
This is used only by rename table
getQualifiedName
public java.lang.String getQualifiedName()
- Gets the full, qualified name of the table.
quoteStringIfNecessary
private java.lang.String quoteStringIfNecessary(java.lang.String name)
- If the name has double quotes in it, put two double quotes for every single
double quote.
For eg, if table name is m"n, return it as "m""n". For now, this is used
by DMLModStatementNode.parseCheckConstraint().
getUUID
public org.apache.derby.catalog.UUID getUUID()
- Gets the UUID of the table.
- Specified by:
getUUIDin interfaceUniqueTupleDescriptor
getTableType
public int getTableType()
- Gets an identifier telling what type of table this is
(base table, declared global temporary table, view, etc.)
getHeapConglomerateId
public long getHeapConglomerateId()
throws org.apache.derby.iapi.error.StandardException
- Gets the id for the heap conglomerate of the table.
There may also be keyed conglomerates, these are
stored separately in the conglomerates table.
getNumberOfColumns
public int getNumberOfColumns()
- Gets the number of columns in the table.
getReferencedColumnMap
public org.apache.derby.iapi.services.io.FormatableBitSet getReferencedColumnMap()
- Get the referenced column map of the table.
setReferencedColumnMap
public void setReferencedColumnMap(org.apache.derby.iapi.services.io.FormatableBitSet referencedColumnMap)
- Set the referenced column map of the table.
getMaxColumnID
public int getMaxColumnID()
throws org.apache.derby.iapi.error.StandardException
- Gets the highest column id in the table. For now this is the same as
the number of columns. However, in the future, after we implement
ALTER TABLE DROP COLUMN, this correspondence won't hold any longer.
setUUID
public void setUUID(org.apache.derby.catalog.UUID oid)
- Sets the UUID of the table
getLockGranularity
public char getLockGranularity()
- Gets the lock granularity for the table.
setLockGranularity
public void setLockGranularity(char lockGranularity)
- Sets the lock granularity for the table to the specified value.
isOnRollbackDeleteRows
public boolean isOnRollbackDeleteRows()
- Gets the on rollback behavior for the declared global temporary table.
isOnCommitDeleteRows
public boolean isOnCommitDeleteRows()
- Gets the on commit behavior for the declared global temporary table.
resetHeapConglomNumber
public void resetHeapConglomNumber()
- Sets the heapConglomNumber to -1 for temporary table since the table was dropped and recreated at the commit time
and hence its conglomerate id has changed. This is used for temporary table descriptors only
getEmptyExecRow
public org.apache.derby.iapi.sql.execute.ExecRow getEmptyExecRow(org.apache.derby.iapi.services.context.ContextManager cm) throws org.apache.derby.iapi.error.StandardException
- Gets an ExecRow for rows stored in the table this describes.
getConglomerateDescriptorList
public ConglomerateDescriptorList getConglomerateDescriptorList()
- Gets the conglomerate descriptor list
getViewDescriptor
public ViewDescriptor getViewDescriptor()
- Gets the view descriptor for this TableDescriptor.
setViewDescriptor
public void setViewDescriptor(ViewDescriptor viewDescriptor)
- Set (cache) the view descriptor for this TableDescriptor
isPersistent
public boolean isPersistent()
- Is this provider persistent? A stored dependency will be required
if both the dependent and provider are persistent.
- Specified by:
isPersistentin interfaceorg.apache.derby.catalog.Dependable- Overrides:
isPersistentin classTupleDescriptor
isSynonymDescriptor
public boolean isSynonymDescriptor()
- Is this descriptor represents a synonym?
getTotalNumberOfIndexes
public int getTotalNumberOfIndexes()
throws org.apache.derby.iapi.error.StandardException
- Gets the number of indexes on the table, including the backing indexes.
getAllRelevantTriggers
public void getAllRelevantTriggers(int statementType,
int[] changedColumnIds,
GenericDescriptorList relevantTriggers)
throws org.apache.derby.iapi.error.StandardException
- Builds a list of all triggers which are relevant to a
given statement type, given a list of updated columns.
getAllRelevantConstraints
public void getAllRelevantConstraints(int statementType,
boolean skipCheckConstraints,
int[] changedColumnIds,
boolean[] needsDeferredProcessing,
ConstraintDescriptorList relevantConstraints)
throws org.apache.derby.iapi.error.StandardException
- Gets all of the relevant constraints for a statement, given its
statement type and its list of updated columns.
getDependableFinder
public org.apache.derby.catalog.DependableFinder getDependableFinder()
- Description copied from interface:
org.apache.derby.catalog.Dependable - Get an object which can be written to disk and which,
when read from disk, will find or reconstruct this in-memory
Dependable.
- Specified by:
getDependableFinderin interfaceorg.apache.derby.catalog.Dependable
getObjectName
public java.lang.String getObjectName()
- Return the name of this Provider. (Useful for errors.)
- Specified by:
getObjectNamein interfaceorg.apache.derby.catalog.Dependable
getObjectID
public org.apache.derby.catalog.UUID getObjectID()
- Get the provider's UUID
- Specified by:
getObjectIDin interfaceorg.apache.derby.catalog.Dependable
getClassType
public java.lang.String getClassType()
- Get the provider's type.
- Specified by:
getClassTypein interfaceorg.apache.derby.catalog.Dependable
toString
public java.lang.String toString()
- Prints the contents of the TableDescriptor
getColumnDescriptorList
public ColumnDescriptorList getColumnDescriptorList()
- Gets the column descriptor list
getConstraintDescriptorList
public ConstraintDescriptorList getConstraintDescriptorList() throws org.apache.derby.iapi.error.StandardException
- Gets the constraint descriptor list
setConstraintDescriptorList
public void setConstraintDescriptorList(ConstraintDescriptorList newCDL)
- Sets the constraint descriptor list
emptyConstraintDescriptorList
public void emptyConstraintDescriptorList()
throws org.apache.derby.iapi.error.StandardException
- Empty the constraint descriptor list
getPrimaryKey
public ReferencedKeyConstraintDescriptor getPrimaryKey() throws org.apache.derby.iapi.error.StandardException
- Gets the primary key, may return null if no primary key
getTriggerDescriptorList
public GenericDescriptorList getTriggerDescriptorList() throws org.apache.derby.iapi.error.StandardException
- Gets the trigger descriptor list
setTriggerDescriptorList
public void setTriggerDescriptorList(GenericDescriptorList newCDL)
- Sets the trigger descriptor list
emptyTriggerDescriptorList
public void emptyTriggerDescriptorList()
throws org.apache.derby.iapi.error.StandardException
- Empty the trigger descriptor list
tableNameEquals
public boolean tableNameEquals(java.lang.String otherTableName, java.lang.String otherSchemaName)
- Compare the tables descriptors based on the names.
Null schema names match.
removeConglomerateDescriptor
public void removeConglomerateDescriptor(ConglomerateDescriptor cd) throws org.apache.derby.iapi.error.StandardException
- Remove this descriptor
removeConstraintDescriptor
public void removeConstraintDescriptor(ConstraintDescriptor cd) throws org.apache.derby.iapi.error.StandardException
- Remove this descriptor. Warning, removes by using object
reference, not uuid.
getColumnDescriptor
public ColumnDescriptor getColumnDescriptor(java.lang.String columnName)
- Get the descriptor for a column in the table,
either by the column name or by its ordinal position (column number).
Returns NULL for columns that do not exist.
getColumnDescriptor
public ColumnDescriptor getColumnDescriptor(int columnNumber)
getConglomerateDescriptors
public ConglomerateDescriptor[] getConglomerateDescriptors()
- Gets a ConglomerateDescriptor[] to loop through all the conglomerate descriptors
for the table.
getConglomerateDescriptor
public ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws org.apache.derby.iapi.error.StandardException
- Gets a conglomerate descriptor for the given table and conglomerate number.
getConglomerateDescriptors
public ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws org.apache.derby.iapi.error.StandardException
- Gets array of conglomerate descriptors for the given table and
conglomerate number. More than one descriptors if duplicate indexes
share one conglomerate.
getConglomerateDescriptor
public ConglomerateDescriptor getConglomerateDescriptor(org.apache.derby.catalog.UUID conglomerateUUID) throws org.apache.derby.iapi.error.StandardException
- Gets a conglomerate descriptor for the given table and conglomerate UUID String.
getConglomerateDescriptors
public ConglomerateDescriptor[] getConglomerateDescriptors(org.apache.derby.catalog.UUID conglomerateUUID) throws org.apache.derby.iapi.error.StandardException
- Gets array of conglomerate descriptors for the given table and
conglomerate UUID. More than one descriptors if duplicate indexes
share one conglomerate.
getIndexLister
public IndexLister getIndexLister() throws org.apache.derby.iapi.error.StandardException
- Gets an object which lists out all the index row generators on a table together
with their conglomerate ids.
tableHasAutoincrement
public boolean tableHasAutoincrement()
- Does the table have an autoincrement column or not?
getColumnNamesArray
public java.lang.String[] getColumnNamesArray()
- Gets an array of column names.
getAutoincIncrementArray
public long[] getAutoincIncrementArray()
- gets an array of increment values for autoincrement columns in the target
table. If column is not an autoincrement column, then increment value is
0. If table has no autoincrement columns, returns NULL.
getStatistics
private java.util.List getStatistics() throws org.apache.derby.iapi.error.StandardException
- Returns a list of statistics for this table.
statisticsExist
public boolean statisticsExist(ConglomerateDescriptor cd) throws org.apache.derby.iapi.error.StandardException
- Are there statistics for this particular conglomerate.
selectivityForConglomerate
public double selectivityForConglomerate(ConglomerateDescriptor cd, int numKeys) throws org.apache.derby.iapi.error.StandardException
- For this conglomerate (index), return the selectivity of the first
numKeys. This basically returns the reciprocal of the number of unique
values in the leading numKey columns of the index. It is assumed that
statistics exist for the conglomerate if this function is called.
getDescriptorName
public java.lang.String getDescriptorName()
- Overrides:
getDescriptorNamein classTupleDescriptor
getDescriptorType
public java.lang.String getDescriptorType()
- Description copied from class:
TupleDescriptor - Each descriptor must identify itself with its type; i.e index, check
constraint whatever.
- Overrides:
getDescriptorTypein classTupleDescriptor
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ dictionary overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC