Examples of AliasDescriptor


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

  public QueryTreeNode bind() 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);
    }

    return this;
View Full Code Here

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

      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 routineInfo = (RoutineAliasInfo) proc.getAliasInfo();
      int parameterCount = routineInfo.getParameterCount();
      if (parameterCount != methodParms.length)
        continue;

      // pre-form the method signature. If it is a dynamic result set procedure
View Full Code Here

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


    /* Get the alias descriptor.  We're responsible for raising
     * the error if it isn't found
     */
    AliasDescriptor ad = dd.getAliasDescriptor(sd.getUUID().toString(), aliasName, nameSpace);

    // RESOLVE - fix error message
    if (ad == null)
    {
      throw StandardException.newException(SQLState.LANG_OBJECT_NOT_FOUND, ad.getAliasType(nameSpace),  aliasName);
    }

    /* Prepare all dependents to invalidate.  (This is their chance
     * to say that they can't be invalidated.  For example, an open
     * cursor referencing a table/view that the user is attempting to
     * drop.) If no one objects, then invalidate any dependent objects.
     * We check for invalidation before we drop the descriptor
     * since the descriptor may be looked up as part of
     * decoding tuples in SYSDEPENDS.
     */
    int invalidationType = 0;
    switch (ad.getAliasType())
    {
      case AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR:
      case AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR:
        invalidationType = DependencyManager.DROP_METHOD_ALIAS;
        break;

      case AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR:
        invalidationType = DependencyManager.DROP_SYNONYM;
        break;
    }

    dm.invalidateFor(ad, invalidationType, lcc);

    if (ad.getAliasType() == AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR)
    {
      // Drop the entry from SYSTABLES as well.
      DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
      TableDescriptor td = ddg.newTableDescriptor(aliasName, sd,
        TableDescriptor.SYNONYM_TYPE, TableDescriptor.DEFAULT_LOCK_GRANULARITY);
      dd.dropTableDescriptor(td, sd, tc);
    }
    else
      dd.dropAllRoutinePermDescriptors(ad.getUUID(), tc);
     
    /* Drop the alias */
    dd.dropAliasDescriptor(ad, tc);

  }
View Full Code Here

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

        String[] details = DataDictionaryImpl.SYSFUN_FUNCTIONS[f];
        String name = details[0];
        if (!name.equals(routineName))
          continue;
       
        AliasDescriptor ad = DataDictionaryImpl.SYSFUN_AD[f];
        if (ad == null)
        {
          // details[1] Return type
          TypeDescriptor rt =
            DataTypeDescriptor.getBuiltInDataTypeDescriptor(details[1]);

          // details[4] - zero or single argument type
          String paramType = details[4];
          TypeDescriptor[] pt;
          String[] paramNames;
          int[] paramModes;
          int paramCount;
          if (paramType != null)
          {     
            paramNames = DataDictionaryImpl.SYSFUN_PNAME;
            paramCount = 1;
            paramModes = DataDictionaryImpl.SYSFUN_PMODE;
            pt = new TypeDescriptor[1];
            pt[0] =
              DataTypeDescriptor.getBuiltInDataTypeDescriptor(paramType);
          }
          else
          {
            // no parameters
            paramNames = null;
            pt = null;
            paramCount = 0;
            paramModes = null;
          }
         
          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
              RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL,
              false, rt);

          // details[2] = class name
          ad = new AliasDescriptor(this, uuidFactory.createUUID(), name,
              uuidFactory.recreateUUID(schemaID),
              details[2], AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR,
              AliasInfo.ALIAS_NAME_SPACE_FUNCTION_AS_CHAR,
              true, ai, null);

          DataDictionaryImpl.SYSFUN_AD[f] = ad;
        }
        list.add(ad);
      }
      return list;
    }
   
    AliasDescriptor ad = getAliasDescriptor(schemaID, routineName, nameSpace);
    if (ad != null) {
      list.add(ad);
    }
    return list;
  }
View Full Code Here

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

                                                    //  NO_SQL
                true,                               // true - calledOnNullInput
                return_type);

    UUID routine_uuid = getUUIDFactory().createUUID();
        AliasDescriptor ads =
            new AliasDescriptor(
                this,
                routine_uuid,
                routine_name,
                schema_uuid,
                procClass, 
View Full Code Here

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

                      char nameSpace,
                      TransactionController tc,
                      String authorizationID)
                        throws StandardException {
      // For system routines, a valid alias descriptor will be returned.
      AliasDescriptor ad = getAliasDescriptor(schemaID, routineName,
                          nameSpace);
     
      if (SanityManager.DEBUG) {
      SanityManager.ASSERT((ad != null), "Failed to get AliasDescriptor"
                      + " of the routine");
      }
     
      UUID routineUUID = ad.getUUID();
      createRoutinePermPublicDescriptor(routineUUID, tc, authorizationID);
    }
View Full Code Here

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

      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 routineInfo = (RoutineAliasInfo) proc.getAliasInfo();
      int parameterCount = routineInfo.getParameterCount();
      if (parameterCount != methodParms.length)
        continue;

      // pre-form the method signature. If it is a dynamic result set procedure
View Full Code Here

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

    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

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

    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

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

    {
      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
TOP
Copyright © 2018 www.massapi.com. 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.