Search in sources :

Example 6 with DependableFinder

use of org.apache.derby.catalog.DependableFinder in project derby by apache.

the class SYSDEPENDSRowFactory method buildDescriptor.

// /////////////////////////////////////////////////////////////////////////
// 
// ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory
// 
// /////////////////////////////////////////////////////////////////////////
/**
 * Make a ConstraintDescriptor out of a SYSDEPENDS row
 *
 * @param row a SYSDEPENDSS row
 * @param parentTupleDescriptor	Null for this kind of descriptor.
 * @param dd dataDictionary
 *
 * @exception   StandardException thrown on failure
 */
public TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd) throws StandardException {
    DependencyDescriptor dependencyDesc = null;
    if (SanityManager.DEBUG) {
        SanityManager.ASSERT(row.nColumns() == SYSDEPENDS_COLUMN_COUNT, "Wrong number of columns for a SYSDEPENDS row");
    }
    DataValueDescriptor col;
    String dependentIDstring;
    UUID dependentUUID;
    DependableFinder dependentBloodhound;
    String providerIDstring;
    UUID providerUUID;
    DependableFinder providerBloodhound;
    /* 1st column is DEPENDENTID (UUID - char(36)) */
    col = row.getColumn(SYSDEPENDS_DEPENDENTID);
    dependentIDstring = col.getString();
    dependentUUID = getUUIDFactory().recreateUUID(dependentIDstring);
    /* 2nd column is DEPENDENTTYPE */
    col = row.getColumn(SYSDEPENDS_DEPENDENTTYPE);
    dependentBloodhound = (DependableFinder) col.getObject();
    /* 3rd column is PROVIDERID (UUID - char(36)) */
    col = row.getColumn(SYSDEPENDS_PROVIDERID);
    providerIDstring = col.getString();
    providerUUID = getUUIDFactory().recreateUUID(providerIDstring);
    /* 4th column is PROVIDERTYPE */
    col = row.getColumn(SYSDEPENDS_PROVIDERTYPE);
    providerBloodhound = (DependableFinder) col.getObject();
    /* now build and return the descriptor */
    return new DependencyDescriptor(dependentUUID, dependentBloodhound, providerUUID, providerBloodhound);
}
Also used : DependableFinder(org.apache.derby.catalog.DependableFinder) DependencyDescriptor(org.apache.derby.iapi.sql.dictionary.DependencyDescriptor) DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor) UUID(org.apache.derby.catalog.UUID)

Aggregations

DependableFinder (org.apache.derby.catalog.DependableFinder)6 DependencyDescriptor (org.apache.derby.iapi.sql.dictionary.DependencyDescriptor)4 UUID (org.apache.derby.catalog.UUID)3 ArrayList (java.util.ArrayList)2 Provider (org.apache.derby.iapi.sql.depend.Provider)2 ColumnDescriptor (org.apache.derby.iapi.sql.dictionary.ColumnDescriptor)2 DataValueDescriptor (org.apache.derby.iapi.types.DataValueDescriptor)2 Statement (java.sql.Statement)1 ReferencedColumnsDescriptorImpl (org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl)1 ContextManager (org.apache.derby.iapi.services.context.ContextManager)1 FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)1 Dependency (org.apache.derby.iapi.sql.depend.Dependency)1 DependencyManager (org.apache.derby.iapi.sql.depend.DependencyManager)1 Dependent (org.apache.derby.iapi.sql.depend.Dependent)1 ProviderInfo (org.apache.derby.iapi.sql.depend.ProviderInfo)1 CheckConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor)1 ColumnDescriptorList (org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList)1 ConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor)1 ConstraintDescriptorList (org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList)1 DataDescriptorGenerator (org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator)1