Home » db-derby-10.5.3.0 » org.apache.derby.iapi.sql.dictionary » [javadoc | source]
org.apache.derby.iapi.sql.dictionary
public class: TableDescriptor [javadoc | source]
java.lang.Object
   org.apache.derby.iapi.sql.dictionary.TupleDescriptor
      org.apache.derby.iapi.sql.dictionary.TableDescriptor

All Implemented Interfaces:
    Provider, UniqueSQLObjectDescriptor

This class represents a table descriptor. The external interface to this class is:

  1. external interface
  2. public String getSchemaName();
  3. public String getQualifiedName();
  4. public int getTableType();
  5. public long getHeapConglomerateId() throws StandardException;
  6. public int getNumberOfColumns();
  7. public FormatableBitSet getReferencedColumnMap();
  8. public void setReferencedColumnMap(FormatableBitSet referencedColumnMap);
  9. public int getMaxColumnID() throws StandardException;
  10. public void setUUID(UUID uuid);
  11. public char getLockGranularity();
  12. public void setTableName(String newTableName);
  13. public void setLockGranularity(char lockGranularity);
  14. public ExecRow getEmptyExecRow( ContextManager cm) throws StandardException;
  15. public boolean tableNameEquals(String otherSchemaName, String otherTableName);
  16. public ReferencedKeyConstraintDescriptor getPrimaryKey() throws StandardException;
  17. public void removeConglomerateDescriptor(ConglomerateDescriptor cd) throws StandardException;
  18. public void removeConstraintDescriptor(ConstraintDescriptor cd) throws StandardException;
  19. public void getAffectedIndexes(...) throws StandardException;
  20. public void getAllRelevantTriggers(...) throws StandardException;
  21. public void getAllRelevantConstraints(...) throws StandardException
  22. public ColumnDescriptorList getColumnDescriptorList();
  23. public String[] getColumnNamesArray();
  24. public long[] getAutoincIncrementArray();
  25. public ColumnDescriptor getColumnDescriptor(String columnName);
  26. public ColumnDescriptor getColumnDescriptor(int columnNumber);
  27. public ConglomerateDescriptor[] getConglomerateDescriptors() throws StandardException;
  28. public ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException;
  29. public ConglomerateDescriptor getConglomerateDescriptor(UUID conglomerateUUID) throws StandardException;
  30. public IndexLister getIndexLister() throws StandardException;
  31. public ViewDescriptor getViewDescriptor();
  32. public boolean tableHasAutoincrement();
  33. public boolean statisticsExist(ConglomerateDescriptor cd) throws StandardException;
  34. public double selectivityForConglomerate(...)throws StandardException;

Field Summary
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  int VTI_TYPE     
public static final  char ROW_LOCK_GRANULARITY     
public static final  char TABLE_LOCK_GRANULARITY     
public static final  char DEFAULT_LOCK_GRANULARITY     
 SchemaDescriptor schema     
 String tableName     
 UUID oid     
 int tableType     
 long heapConglomNumber     
 ColumnDescriptorList columnDescriptorList     
 ConglomerateDescriptorList conglomerateDescriptorList     
 ConstraintDescriptorList constraintDescriptorList     
 ViewDescriptor viewDescriptor     
Constructor:
 public TableDescriptor(DataDictionary dataDictionary,
    String tableName,
    SchemaDescriptor schema,
    int tableType,
    char lockGranularity) 
    Constructor for a TableDescriptor.
    Parameters:
    dataDictionary - The data dictionary that this descriptor lives in
    tableName - The name of the table
    schema - The schema descriptor for this table.
    tableType - An integer identifier for the type of the table (base table, view, etc.)
    lockGranularity - The lock granularity.
 public TableDescriptor(DataDictionary dataDictionary,
    String tableName,
    SchemaDescriptor schema,
    int tableType,
    boolean onCommitDeleteRows,
    boolean onRollbackDeleteRows) 
    Constructor for a TableDescriptor (this is for a temporary table).
    Parameters:
    dataDictionary - The data dictionary that this descriptor lives in
    tableName - The name of the temporary table
    schema - The schema descriptor for this table.
    tableType - An integer identifier for the type of the table : declared global temporary table
    onCommitDeleteRows - 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 value
Method from org.apache.derby.iapi.sql.dictionary.TableDescriptor Summary:
emptyConstraintDescriptorList,   emptyTriggerDescriptorList,   getAllRelevantConstraints,   getAllRelevantTriggers,   getAutoincIncrementArray,   getClassType,   getColumnCollationIds,   getColumnDescriptor,   getColumnDescriptor,   getColumnDescriptorList,   getColumnIDs,   getColumnNamesArray,   getConglomerateDescriptor,   getConglomerateDescriptor,   getConglomerateDescriptorList,   getConglomerateDescriptors,   getConglomerateDescriptors,   getConglomerateDescriptors,   getConstraintDescriptorList,   getDependableFinder,   getDescriptorName,   getDescriptorType,   getEmptyExecRow,   getGeneratedColumns,   getHeapConglomerateId,   getIndexLister,   getLockGranularity,   getMaxColumnID,   getName,   getNumberOfColumns,   getObjectID,   getObjectName,   getPrimaryKey,   getQualifiedName,   getReferencedColumnMap,   getSchemaDescriptor,   getSchemaName,   getTableType,   getTotalNumberOfIndexes,   getTriggerDescriptorList,   getUUID,   getViewDescriptor,   isOnCommitDeleteRows,   isOnRollbackDeleteRows,   isPersistent,   isSynonymDescriptor,   makeColumnMap,   removeConglomerateDescriptor,   removeConstraintDescriptor,   resetHeapConglomNumber,   selectivityForConglomerate,   setConstraintDescriptorList,   setLockGranularity,   setReferencedColumnMap,   setTableName,   setTriggerDescriptorList,   setUUID,   setViewDescriptor,   statisticsExist,   tableHasAutoincrement,   tableNameEquals,   toString
Methods from org.apache.derby.iapi.sql.dictionary.TupleDescriptor:
getColumnDependableFinder,   getDataDictionary,   getDependableFinder,   getDescriptorName,   getDescriptorType,   isPersistent,   setDataDictionary
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.derby.iapi.sql.dictionary.TableDescriptor Detail:
 public  void emptyConstraintDescriptorList() throws StandardException 
    Empty the constraint descriptor list
 public  void emptyTriggerDescriptorList() throws StandardException 
    Empty the trigger descriptor list
 public  void getAllRelevantConstraints(int statementType,
    boolean skipCheckConstraints,
    int[] changedColumnIds,
    boolean[] needsDeferredProcessing,
    ConstraintDescriptorList relevantConstraints) throws StandardException 
    Gets all of the relevant constraints for a statement, given its statement type and its list of updated columns.
 public  void getAllRelevantTriggers(int statementType,
    int[] changedColumnIds,
    GenericDescriptorList relevantTriggers) throws StandardException 
    Builds a list of all triggers which are relevant to a given statement type, given a list of updated columns.
 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.
 public String getClassType() 
    Get the provider's type.
 public int[] getColumnCollationIds() throws StandardException 
    Return an array of collation ids for this table.

    Return an array of collation ids, one for each column in the columnDescriptorList. This is useful for passing collation id info down to store, for instance in createConglomerate(). This is only expected to get called during ddl, so object allocation is ok.

 public ColumnDescriptor getColumnDescriptor(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.
 public ColumnDescriptor getColumnDescriptor(int columnNumber) 
 public ColumnDescriptorList getColumnDescriptorList() 
    Gets the column descriptor list
 public int[] getColumnIDs(String[] names) 
    Turn an array of column names into the corresponding 1-based column positions.
 public String[] getColumnNamesArray() 
    Gets an array of column names.
 public ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException 
    Gets a conglomerate descriptor for the given table and conglomerate number.
 public ConglomerateDescriptor getConglomerateDescriptor(UUID conglomerateUUID) throws StandardException 
    Gets a conglomerate descriptor for the given table and conglomerate UUID String.
 public ConglomerateDescriptorList getConglomerateDescriptorList() 
    Gets the conglomerate descriptor list
 public ConglomerateDescriptor[] getConglomerateDescriptors() 
    Gets a ConglomerateDescriptor[] to loop through all the conglomerate descriptors for the table.
 public ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws StandardException 
    Gets array of conglomerate descriptors for the given table and conglomerate number. More than one descriptors if duplicate indexes share one conglomerate.
 public ConglomerateDescriptor[] getConglomerateDescriptors(UUID conglomerateUUID) throws StandardException 
    Gets array of conglomerate descriptors for the given table and conglomerate UUID. More than one descriptors if duplicate indexes share one conglomerate.
 public ConstraintDescriptorList getConstraintDescriptorList() throws StandardException 
    Gets the constraint descriptor list
 public DependableFinder getDependableFinder() 
 public String getDescriptorName() 
 public String getDescriptorType() 
 public ExecRow getEmptyExecRow() throws StandardException 
    Gets an ExecRow for rows stored in the table this describes.
 public ColumnDescriptorList getGeneratedColumns() 
    Gets the list of columns defined by generation clauses.
 public long getHeapConglomerateId() throws 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.
 public IndexLister getIndexLister() throws StandardException 
    Gets an object which lists out all the index row generators on a table together with their conglomerate ids.
 public char getLockGranularity() 
    Gets the lock granularity for the table.
 public int getMaxColumnID() throws 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.
 public String getName() 
    Gets the name of the table.
 public int getNumberOfColumns() 
    Gets the number of columns in the table.
 public UUID getObjectID() 
    Get the provider's UUID
 public String getObjectName() 
    Return the name of this Provider. (Useful for errors.)
 public ReferencedKeyConstraintDescriptor getPrimaryKey() throws StandardException 
    Gets the primary key, may return null if no primary key
 public String getQualifiedName() 
    Gets the full, qualified name of the table.
 public FormatableBitSet getReferencedColumnMap() 
    Get the referenced column map of the table.
 public SchemaDescriptor getSchemaDescriptor() 
    Gets the SchemaDescriptor for this TableDescriptor.
 public String getSchemaName() 
    Gets the name of the schema the table lives in.
 public int getTableType() 
    Gets an identifier telling what type of table this is (base table, declared global temporary table, view, etc.)
 public int getTotalNumberOfIndexes() throws StandardException 
    Gets the number of indexes on the table, including the backing indexes.
 public GenericDescriptorList getTriggerDescriptorList() throws StandardException 
    Gets the trigger descriptor list
 public UUID getUUID() 
    Gets the UUID of the table.
 public ViewDescriptor getViewDescriptor() 
    Gets the view descriptor for this TableDescriptor.
 public boolean isOnCommitDeleteRows() 
    Gets the on commit behavior for the declared global temporary table.
 public boolean isOnRollbackDeleteRows() 
    Gets the on rollback behavior for the declared global temporary table.
 public boolean isPersistent() 
    Is this provider persistent? A stored dependency will be required if both the dependent and provider are persistent.
 public boolean isSynonymDescriptor() 
    Is this descriptor represents a synonym?
 public FormatableBitSet makeColumnMap(ColumnDescriptorList cdl) 
    Given a list of columns in the table, construct a bit map of those columns' ids.
 public  void removeConglomerateDescriptor(ConglomerateDescriptor cd) throws StandardException 
    Remove this descriptor
 public  void removeConstraintDescriptor(ConstraintDescriptor cd) throws StandardException 
    Remove this descriptor. Warning, removes by using object reference, not uuid.
 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
 public double selectivityForConglomerate(ConglomerateDescriptor cd,
    int numKeys) throws 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.
 public  void setConstraintDescriptorList(ConstraintDescriptorList newCDL) 
    Sets the constraint descriptor list
 public  void setLockGranularity(char lockGranularity) 
    Sets the lock granularity for the table to the specified value.
 public  void setReferencedColumnMap(FormatableBitSet referencedColumnMap) 
    Set the referenced column map of the table.
 public  void setTableName(String newTableName) 
    Sets the the table name in case of rename table. This is used only by rename table
 public  void setTriggerDescriptorList(GenericDescriptorList newCDL) 
    Sets the trigger descriptor list
 public  void setUUID(UUID oid) 
    Sets the UUID of the table
 public  void setViewDescriptor(ViewDescriptor viewDescriptor) 
    Set (cache) the view descriptor for this TableDescriptor
 public boolean statisticsExist(ConglomerateDescriptor cd) throws StandardException 
    Are there statistics for this particular conglomerate.
 public boolean tableHasAutoincrement() 
    Does the table have an autoincrement column or not?
 public boolean tableNameEquals(String otherTableName,
    String otherSchemaName) 
    Compare the tables descriptors based on the names. Null schema names match.
 public String toString() 
    Prints the contents of the TableDescriptor