Search in sources :

Example 1 with BaseTypeIdImpl

use of org.apache.derby.catalog.types.BaseTypeIdImpl in project derby by apache.

the class DataDictionaryImpl method getAliasDescriptorForUDT.

/**
 * Get the alias descriptor for an ANSI UDT.
 *
 * @param tc The transaction to use: if null, use the compilation transaction
 * @param dtd The UDT's type descriptor
 *
 * @return The UDT's alias descriptor if it is an ANSI UDT; null otherwise.
 */
public AliasDescriptor getAliasDescriptorForUDT(TransactionController tc, DataTypeDescriptor dtd) throws StandardException {
    if (tc == null) {
        tc = getTransactionCompile();
    }
    if (dtd == null) {
        return null;
    }
    BaseTypeIdImpl btii = dtd.getTypeId().getBaseTypeId();
    if (!btii.isAnsiUDT()) {
        return null;
    }
    SchemaDescriptor sd = getSchemaDescriptor(btii.getSchemaName(), tc, true);
    AliasDescriptor ad = getAliasDescriptor(sd.getUUID().toString(), btii.getUnqualifiedName(), AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR);
    return ad;
}
Also used : SchemaDescriptor(org.apache.derby.iapi.sql.dictionary.SchemaDescriptor) AliasDescriptor(org.apache.derby.iapi.sql.dictionary.AliasDescriptor) BaseTypeIdImpl(org.apache.derby.catalog.types.BaseTypeIdImpl)

Aggregations

BaseTypeIdImpl (org.apache.derby.catalog.types.BaseTypeIdImpl)1 AliasDescriptor (org.apache.derby.iapi.sql.dictionary.AliasDescriptor)1 SchemaDescriptor (org.apache.derby.iapi.sql.dictionary.SchemaDescriptor)1