Search in sources :

Example 26 with ColumnDescriptorList

use of org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList in project derby by apache.

the class MatchingClauseNode method buildFullColumnList.

/**
 * <p>
 * Build the full column list for a table.
 * </p>
 */
private ResultColumnList buildFullColumnList(TableDescriptor td) throws StandardException {
    ResultColumnList result = new ResultColumnList(getContextManager());
    ColumnDescriptorList cdl = td.getColumnDescriptorList();
    int cdlSize = cdl.size();
    for (int index = 0; index < cdlSize; index++) {
        ColumnDescriptor colDesc = cdl.elementAt(index);
        ColumnReference columnRef = new ColumnReference(colDesc.getColumnName(), null, getContextManager());
        ResultColumn resultColumn = new ResultColumn(columnRef, null, getContextManager());
        result.addResultColumn(resultColumn);
    }
    return result;
}
Also used : ColumnDescriptorList(org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList) ResultColumnDescriptor(org.apache.derby.iapi.sql.ResultColumnDescriptor) ColumnDescriptor(org.apache.derby.iapi.sql.dictionary.ColumnDescriptor)

Example 27 with ColumnDescriptorList

use of org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList in project derby by apache.

the class DataDictionaryImpl method createIdentitySequences.

/**
 * Create sequence generators for all identity columns on upgrade to 10.11.
 */
void createIdentitySequences(TransactionController tc) throws StandardException {
    Hashtable<UUID, TableDescriptor> tableMap = hashAllTableDescriptorsByTableId(tc);
    for (UUID tableID : tableMap.keySet()) {
        TableDescriptor td = getTableDescriptor(tableID);
        ColumnDescriptorList cdl = td.getColumnDescriptorList();
        for (ColumnDescriptor cd : cdl) {
            if (cd.isAutoincrement()) {
                createIdentitySequence(td, cd, tc);
            }
        }
    }
}
Also used : ColumnDescriptorList(org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList) ColumnDescriptor(org.apache.derby.iapi.sql.dictionary.ColumnDescriptor) UUID(org.apache.derby.catalog.UUID) TableDescriptor(org.apache.derby.iapi.sql.dictionary.TableDescriptor)

Aggregations

ColumnDescriptorList (org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList)27 ColumnDescriptor (org.apache.derby.iapi.sql.dictionary.ColumnDescriptor)23 UUID (org.apache.derby.catalog.UUID)9 TableDescriptor (org.apache.derby.iapi.sql.dictionary.TableDescriptor)9 ConglomerateDescriptor (org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)7 TransactionController (org.apache.derby.iapi.store.access.TransactionController)7 LanguageConnectionContext (org.apache.derby.iapi.sql.conn.LanguageConnectionContext)6 ConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor)6 DataDictionary (org.apache.derby.iapi.sql.dictionary.DataDictionary)6 ConstraintDescriptorList (org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList)5 SchemaDescriptor (org.apache.derby.iapi.sql.dictionary.SchemaDescriptor)5 FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)4 DependencyManager (org.apache.derby.iapi.sql.depend.DependencyManager)4 DataDescriptorGenerator (org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator)4 ExecRow (org.apache.derby.iapi.sql.execute.ExecRow)4 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 ForeignKeyConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.ForeignKeyConstraintDescriptor)3 ReferencedKeyConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor)3 ConglomerateController (org.apache.derby.iapi.store.access.ConglomerateController)3