Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.AliasDescriptor


  public void bindStatement() throws StandardException
  {
    DataDictionary  dataDictionary = getDataDictionary();
    String      aliasName = getRelativeName();

    AliasDescriptor  ad = null;
    SchemaDescriptor sd = getSchemaDescriptor();
   
    if (sd.getUUID() != null) {
      ad = dataDictionary.getAliasDescriptor
                                (sd.getUUID().toString(), aliasName, nameSpace );
    }
    if ( ad == null )
    {
      throw StandardException.newException(SQLState.LANG_OBJECT_DOES_NOT_EXIST, statementToString(), aliasName);
    }

    // User cannot drop a system alias
    if (ad.getSystemAlias())
    {
      throw StandardException.newException(SQLState.LANG_CANNOT_DROP_SYSTEM_ALIASES, aliasName);
    }

    // Statement is dependent on the AliasDescriptor
View Full Code Here


    {
      SchemaDescriptor nextSD = getSchemaDescriptor(nextSynonymSchema, false);
      if (nextSD == null || nextSD.getUUID() == null)
        break;
 
      AliasDescriptor nextAD = dd.getAliasDescriptor(nextSD.getUUID().toString(),
             nextSynonymTable, AliasInfo.ALIAS_NAME_SPACE_SYNONYM_AS_CHAR);
      if (nextAD == null)
        break;

      /* Query is dependent on the AliasDescriptor */
      cc.createDependency(nextAD);

      found = true;
      SynonymAliasInfo info = ((SynonymAliasInfo)nextAD.getAliasInfo());
      nextSynonymTable = info.getSynonymTable();
      nextSynonymSchema = info.getSynonymSchema();
    }

    if (!found)
View Full Code Here

        DataDictionary dd = getDataDictionary();
        SchemaDescriptor typeSchema = getSchemaDescriptor( userTypeID.getSchemaName() );
        char  udtNameSpace = AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR;
        String unqualifiedTypeName = userTypeID.getUnqualifiedName();
        AliasDescriptor ad = dd.getAliasDescriptor( typeSchema.getUUID().toString(), unqualifiedTypeName, udtNameSpace );

    if (ad == null)
    {
      throw StandardException.newException(SQLState.LANG_OBJECT_NOT_FOUND, AliasDescriptor.getAliasType(udtNameSpace),  unqualifiedTypeName);
    }

        createTypeDependency( ad );

        DataTypeDescriptor result = new DataTypeDescriptor
            (
             TypeId.getUserDefinedTypeId( typeSchema.getSchemaName(), unqualifiedTypeName, ad.getJavaClassName() ),
             originalDTD.isNullable()
             );

        return result;
    }
View Full Code Here

     *
     * @param dtd Type which may have a dependency declared on it.
     */
    public void createTypeDependency( DataTypeDescriptor dtd ) throws StandardException
    {
        AliasDescriptor ad = getDataDictionary().getAliasDescriptorForUDT( null, dtd );

        if ( ad != null ) { createTypeDependency( ad ); }
    }
View Full Code Here

        if ( userAggregateName != null )
        {
            userAggregateName.bind( dd );

            AliasDescriptor ad = resolveAggregate
                (
                 dd,
                 getSchemaDescriptor( userAggregateName.getSchemaName(), true ),
                 userAggregateName.getTableName()
                 );

            if ( ad == null )
            {
                throw StandardException.newException
                    (
                     SQLState.LANG_OBJECT_NOT_FOUND,
                     AliasDescriptor.getAliasType( AliasInfo.ALIAS_TYPE_AGGREGATE_AS_CHAR ),
                     userAggregateName.getTableName()
                     );
            }
           
            setUserDefinedAggregate( new UserAggregateDefinition( ad ) );
            aggregateName = ad.getJavaClassName();
         }

    instantiateAggDef();

        // if this is a user-defined aggregate
        if ( isUserDefinedAggregate() )
        {
            AliasDescriptor ad = ((UserAggregateDefinition) uad).getAliasDescriptor();

            // set up dependency on the user-defined aggregate and compile a check for USAGE
            // priv if needed
            getCompilerContext().createDependency( ad );
View Full Code Here

      forCallStatement ? AliasInfo.ALIAS_NAME_SPACE_PROCEDURE_AS_CHAR : AliasInfo.ALIAS_NAME_SPACE_FUNCTION_AS_CHAR
      );

    for (int i = list.size() - 1; i >= 0; i--) {

      AliasDescriptor proc = (AliasDescriptor) list.get(i);

      RoutineAliasInfo rai = (RoutineAliasInfo) proc.getAliasInfo();
      int parameterCount = rai.getParameterCount();
            boolean hasVarargs = rai.hasVarargs();

            if ( hasVarargs )
            {
View Full Code Here

    boolean          systemAlias = false;
    AliasInfo        aliasInfo = null;

    if (td != null) {

      AliasDescriptor     ad = (AliasDescriptor)td;
      aliasID  = ad.getUUID().toString();
      aliasName = ad.getDescriptorName();
      schemaID  = ad.getSchemaUUID().toString();
      javaClassName  = ad.getJavaClassName();
      cAliasType = ad.getAliasType();
      cNameSpace = ad.getNameSpace();
      systemAlias = ad.getSystemAlias();
      aliasInfo = ad.getAliasInfo();
      specificName = ad.getSpecificName();

      char[] charArray = new char[1];
      charArray[0] = cAliasType;
      sAliasType = new String(charArray);
View Full Code Here

    col = row.getColumn(SYSALIASES_SPECIFIC_NAME);
    String specificName = col.getString();


    /* now build and return the descriptor */
    return new AliasDescriptor(dd, aliasUUID, aliasName,
                    schemaUUID, javaClassName, cAliasType,
                    cNameSpace, systemAlias,
                    aliasInfo, specificName);
  }
View Full Code Here

    {
      SchemaDescriptor nextSD = getSchemaDescriptor(nextSynonymSchema, false);
      if (nextSD == null || nextSD.getUUID() == null)
        break;
 
      AliasDescriptor nextAD = dd.getAliasDescriptor(nextSD.getUUID().toString(),
             nextSynonymTable, AliasInfo.ALIAS_NAME_SPACE_SYNONYM_AS_CHAR);
      if (nextAD == null)
        break;

      /* Query is dependent on the AliasDescriptor */
      cc.createDependency(nextAD);

      found = true;
      SynonymAliasInfo info = ((SynonymAliasInfo)nextAD.getAliasInfo());
      nextSynonymTable = info.getSynonymTable();
      nextSynonymSchema = info.getSynonymSchema();
    }

    if (!found)
View Full Code Here

        DataDictionary dd = getDataDictionary();
        SchemaDescriptor typeSchema = getSchemaDescriptor( userTypeID.getSchemaName() );
        char  udtNameSpace = AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR;
        String unqualifiedTypeName = userTypeID.getUnqualifiedName();
        AliasDescriptor ad = dd.getAliasDescriptor( typeSchema.getUUID().toString(), unqualifiedTypeName, udtNameSpace );

    if (ad == null)
    {
      throw StandardException.newException(SQLState.LANG_OBJECT_NOT_FOUND, AliasDescriptor.getAliasType(udtNameSpace),  unqualifiedTypeName);
    }

        createTypeDependency( ad );

        DataTypeDescriptor result = new DataTypeDescriptor
            (
             TypeId.getUserDefinedTypeId( typeSchema.getSchemaName(), unqualifiedTypeName, ad.getJavaClassName() ),
             originalDTD.isNullable()
             );

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.AliasDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.