|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.TableDescriptor
This class represents a table descriptor. The external interface to this class is:
Field Summary | |
static int |
BASE_TABLE_TYPE
|
(package private) ColumnDescriptorList |
columnDescriptorList
|
(package private) ConglomerateDescriptorList |
conglomerateDescriptorList
|
(package private) ConstraintDescriptorList |
constraintDescriptorList
|
static char |
DEFAULT_LOCK_GRANULARITY
|
static int |
GLOBAL_TEMPORARY_TABLE_TYPE
|
(package private) long |
heapConglomNumber
|
private char |
lockGranularity
|
(package private) UUID |
oid
|
private boolean |
onCommitDeleteRows
|
private boolean |
onRollbackDeleteRows
|
(package private) FormatableBitSet |
referencedColumnMap
|
static char |
ROW_LOCK_GRANULARITY
|
(package private) SchemaDescriptor |
schema
|
private java.util.List |
statisticsDescriptorList
A list of statistics pertaining to this table-- |
static int |
SYNONYM_TYPE
|
static int |
SYSTEM_TABLE_TYPE
|
static char |
TABLE_LOCK_GRANULARITY
|
(package private) java.lang.String |
tableName
|
(package private) int |
tableType
|
private GenericDescriptorList |
triggerDescriptorList
|
static int |
VIEW_TYPE
|
(package private) ViewDescriptor |
viewDescriptor
|
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(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(UUID conglomerateUUID)
Gets array of conglomerate descriptors for the given table and conglomerate UUID. |
ConstraintDescriptorList |
getConstraintDescriptorList()
Gets the constraint descriptor list |
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. |
ExecRow |
getEmptyExecRow(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. |
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. |
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 |
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? |
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(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(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 |
public static final int BASE_TABLE_TYPE
public static final int SYSTEM_TABLE_TYPE
public static final int VIEW_TYPE
public static final int GLOBAL_TEMPORARY_TABLE_TYPE
public static final int SYNONYM_TYPE
public static final char ROW_LOCK_GRANULARITY
public static final char TABLE_LOCK_GRANULARITY
public static final char DEFAULT_LOCK_GRANULARITY
private char lockGranularity
private boolean onCommitDeleteRows
private boolean onRollbackDeleteRows
SchemaDescriptor schema
java.lang.String tableName
UUID oid
int tableType
long heapConglomNumber
ColumnDescriptorList columnDescriptorList
ConglomerateDescriptorList conglomerateDescriptorList
ConstraintDescriptorList constraintDescriptorList
private GenericDescriptorList triggerDescriptorList
ViewDescriptor viewDescriptor
FormatableBitSet referencedColumnMap
private java.util.List statisticsDescriptorList
Constructor Detail |
public TableDescriptor(DataDictionary dataDictionary, java.lang.String tableName, SchemaDescriptor schema, int tableType, boolean onCommitDeleteRows, boolean onRollbackDeleteRows)
dataDictionary
- The data dictionary that this descriptor lives intableName
- The name of the temporary tableschema
- The schema descriptor for this table.tableType
- An integer identifier for the type of the table : declared global temporary tableonCommitDeleteRows
- If true, on commit delete rows else on commit preserve rows of temporary table.onRollbackDeleteRows
- If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported valuepublic TableDescriptor(DataDictionary dataDictionary, java.lang.String tableName, SchemaDescriptor schema, int tableType, char lockGranularity)
dataDictionary
- The data dictionary that this descriptor lives intableName
- The name of the tableschema
- The schema descriptor for this table.tableType
- An integer identifier for the type of the table
(base table, view, etc.)lockGranularity
- The lock granularity.Method Detail |
public java.lang.String getSchemaName()
public SchemaDescriptor getSchemaDescriptor()
getSchemaDescriptor
in interface UniqueSQLObjectDescriptor
public java.lang.String getName()
getName
in interface UniqueSQLObjectDescriptor
public void setTableName(java.lang.String newTableName)
newTableName
- The new table name.public java.lang.String getQualifiedName()
private java.lang.String quoteStringIfNecessary(java.lang.String name)
name
- The String with or without double quotes
public UUID getUUID()
getUUID
in interface UniqueTupleDescriptor
public int getTableType()
public long getHeapConglomerateId() throws StandardException
StandardException
- Thrown on errorpublic int getNumberOfColumns()
public FormatableBitSet getReferencedColumnMap()
public void setReferencedColumnMap(FormatableBitSet referencedColumnMap)
referencedColumnMap
- FormatableBitSet of referenced columns.
public int getMaxColumnID() throws StandardException
StandardException
- Thrown on errorpublic void setUUID(UUID oid)
oid
- The UUID of the table to be set in the descriptor
public char getLockGranularity()
public void setLockGranularity(char lockGranularity)
lockGranularity
- The new lockGranularity.public boolean isOnRollbackDeleteRows()
public boolean isOnCommitDeleteRows()
public void resetHeapConglomNumber()
public ExecRow getEmptyExecRow(ContextManager cm) throws StandardException
cm
- Current ContextManager
StandardException
- Thrown on failurepublic ConglomerateDescriptorList getConglomerateDescriptorList()
public ViewDescriptor getViewDescriptor()
public void setViewDescriptor(ViewDescriptor viewDescriptor)
viewDescriptor
- The view descriptor to cache.
public boolean isPersistent()
isPersistent
in interface Dependable
isPersistent
in class TupleDescriptor
public boolean isSynonymDescriptor()
public int getTotalNumberOfIndexes() throws StandardException
StandardException
public void getAllRelevantTriggers(int statementType, int[] changedColumnIds, GenericDescriptorList relevantTriggers) throws StandardException
statementType
- defined in StatementTypechangedColumnIds
- array of changed columnsrelevantTriggers
- IN/OUT. Passed in as an empty list. Filled in as we go.
StandardException
- Thrown on errorpublic void getAllRelevantConstraints(int statementType, boolean skipCheckConstraints, int[] changedColumnIds, boolean[] needsDeferredProcessing, ConstraintDescriptorList relevantConstraints) throws StandardException
statementType
- As defined in StatementType.skipCheckConstraints
- Skip check constraintschangedColumnIds
- If null, all columns being changed, otherwise array
of 1-based column ids for columns being changedneedsDeferredProcessing
- IN/OUT. true if the statement already needs
deferred processing. set while evaluating this
routine if a trigger or constraint requires
deferred processingrelevantConstraints
- IN/OUT. Empty list is passed in. We hang constraints on it as we go.
StandardException
- Thrown on errorpublic DependableFinder getDependableFinder()
Dependable
getDependableFinder
in interface Dependable
Dependable.getDependableFinder()
public java.lang.String getObjectName()
getObjectName
in interface Dependable
public UUID getObjectID()
getObjectID
in interface Dependable
public java.lang.String getClassType()
getClassType
in interface Dependable
public java.lang.String toString()
public ColumnDescriptorList getColumnDescriptorList()
public ConstraintDescriptorList getConstraintDescriptorList() throws StandardException
StandardException
- Thrown on failurepublic void setConstraintDescriptorList(ConstraintDescriptorList newCDL)
newCDL
- The new constraint descriptor list for this table descriptorpublic void emptyConstraintDescriptorList() throws StandardException
StandardException
- Thrown on failurepublic ReferencedKeyConstraintDescriptor getPrimaryKey() throws StandardException
StandardException
- Thrown on failurepublic GenericDescriptorList getTriggerDescriptorList() throws StandardException
StandardException
- Thrown on failurepublic void setTriggerDescriptorList(GenericDescriptorList newCDL)
newCDL
- The new trigger descriptor list for this table descriptorpublic void emptyTriggerDescriptorList() throws StandardException
StandardException
- Thrown on failurepublic boolean tableNameEquals(java.lang.String otherTableName, java.lang.String otherSchemaName)
otherTableName
- the other table nameotherSchemaName
- the other schema name
public void removeConglomerateDescriptor(ConglomerateDescriptor cd) throws StandardException
StandardException
- on errorpublic void removeConstraintDescriptor(ConstraintDescriptor cd) throws StandardException
StandardException
- on errorpublic ColumnDescriptor getColumnDescriptor(java.lang.String columnName)
columnName
- A String containing the name of the column
public ColumnDescriptor getColumnDescriptor(int columnNumber)
columnNumber
- The ordinal position of the column in the table
public ConglomerateDescriptor[] getConglomerateDescriptors()
StandardException
- Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException
conglomerateNumber
- The conglomerate number
we're interested in
StandardException
- Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws StandardException
conglomerateNumber
- The conglomerate number
we're interested in
StandardException
- Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(UUID conglomerateUUID) throws StandardException
conglomerateUUID
- The UUID for the conglomerate
we're interested in
StandardException
- Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(UUID conglomerateUUID) throws StandardException
conglomerateUUID
- The conglomerate UUID
we're interested in
StandardException
- Thrown on failurepublic IndexLister getIndexLister() throws StandardException
StandardException
- Thrown on failurepublic boolean tableHasAutoincrement()
public java.lang.String[] getColumnNamesArray()
public long[] getAutoincIncrementArray()
private java.util.List getStatistics() throws StandardException
StandardException
public boolean statisticsExist(ConglomerateDescriptor cd) throws StandardException
cd
- Conglomerate/Index for which we want to check if statistics
exist. cd can be null in which case user wants to know if there are any
statistics at all on the table.
StandardException
public double selectivityForConglomerate(ConglomerateDescriptor cd, int numKeys) throws StandardException
cd
- ConglomerateDescriptor (Index) whose
cardinality we are interested in.numKeys
- Number of leading columns of the index for which
cardinality is desired.
StandardException
public java.lang.String getDescriptorName()
getDescriptorName
in class TupleDescriptor
TupleDescriptor.getDescriptorName()
public java.lang.String getDescriptorType()
TupleDescriptor
getDescriptorType
in class TupleDescriptor
TupleDescriptor.getDescriptorType()
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |