Examples of AliasDescriptor


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

        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

    //
    // Create a new method alias descriptor with aliasID filled in.
    //
    UUID aliasID = dd.getUUIDFactory().createUUID();

    AliasDescriptor ads = new AliasDescriptor(dd, aliasID,
                   aliasName,
                   sd != null ? sd.getUUID() : null,
                   javaClassName,
                   aliasType,
                   nameSpace,
                   false,
                   aliasInfo, null);

    // perform duplicate rule checking
    switch (aliasType) {
    case AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR:
    case AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR:
    {

      java.util.List list = dd.getRoutineList(
        sd.getUUID().toString(), aliasName, aliasType);
      for (int i = list.size() - 1; i >= 0; i--) {

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

        RoutineAliasInfo procedureInfo = (RoutineAliasInfo) proc.getAliasInfo();
        int parameterCount = procedureInfo.getParameterCount();
        if (parameterCount != ((RoutineAliasInfo) aliasInfo).getParameterCount())
          continue;

        // procedure duplicate checking is simple, only
        // one procedure with a given number of parameters.
        throw StandardException.newException(SQLState.LANG_OBJECT_ALREADY_EXISTS,
                        ads.getDescriptorType(),
                        aliasName);
      }
    }
    break;
    case AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR:
      // If target table/view exists already, error.
      TableDescriptor targetTD = dd.getTableDescriptor(aliasName, sd);
      if (targetTD != null)
      {
        throw StandardException.newException(
                SQLState.LANG_OBJECT_ALREADY_EXISTS,
                targetTD.getDescriptorType(),
                targetTD.getDescriptorName());
      }

      // Detect synonym cycles, if present.
      String nextSynTable = ((SynonymAliasInfo)aliasInfo).getSynonymTable();
      String nextSynSchema = ((SynonymAliasInfo)aliasInfo).getSynonymSchema();
      SchemaDescriptor nextSD;
      for (;;)
      {
        nextSD = dd.getSchemaDescriptor(nextSynSchema, tc, false);
        if (nextSD == null)
          break;
       
        AliasDescriptor nextAD = dd.getAliasDescriptor(nextSD.getUUID().toString(),
             nextSynTable, nameSpace);
        if (nextAD == null)
          break;

        SynonymAliasInfo info = (SynonymAliasInfo) nextAD.getAliasInfo();
        nextSynTable = info.getSynonymTable();
        nextSynSchema = info.getSynonymSchema();

        if (aliasName.equals(nextSynTable) && schemaName.equals(nextSynSchema))
          throw StandardException.newException(SQLState.LANG_SYNONYM_CIRCULAR,
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

            ViewDescriptor v = (ViewDescriptor)p; 
            s = dd.getSchemaDescriptor(v.getCompSchemaId(), tc);
          }
            else if (p instanceof AliasDescriptor)
            {
              AliasDescriptor a = (AliasDescriptor)p;
            s = dd.getSchemaDescriptor( a.getSchemaUUID(), tc);
            }
               
          if (s != null && !user.equals(s.getAuthorizationId()) )
          {
            throw StandardException.newException(
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

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.