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

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


        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 );

        return ad;
    }
View Full Code Here


        if ( !isPrivilegeCollectionRequired() ) { return; }
       
        DataTypeDescriptor  dtd = val.getTypeServices();
        if ( (dtd != null) && dtd.getTypeId().userType() )
        {
            AliasDescriptor ad = getUDTDesc( dtd );
            getCompilerContext().addRequiredUsagePriv( ad );
        }
    }
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 this is a user-defined aggregate that hasn't been bound yet,
        // bind it now.
        if (userAggregateName != null && uad == null)
        {

            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

                return makeTableName( td.getSchemaName(), td.getName(), _cm );
            }
            else if ( OptimizerImpl.isTableFunction( optimizable ) )
            {
                ProjectRestrictNode prn = (ProjectRestrictNode) optimizable;
                AliasDescriptor ad =
                    ((StaticMethodCallNode) ((FromVTI) prn.getChildResult()).
                        getMethodCall() ).ad;
                return makeTableName( ad.getSchemaName(), ad.getName(), _cm );
            }
            else if ( isFromTable( optimizable ) )
            {
                TableName   retval = ((FromTable) ((ProjectRestrictNode) optimizable).getChildResult()).getTableName();
View Full Code Here

       
    keyRow.setColumn(1, new SQLChar( SchemaDescriptor.SYSIBM_SCHEMA_UUID ));
    keyRow.setColumn(2, aliasNameOrderable);
    keyRow.setColumn(3, nameSpaceOrderable);

        AliasDescriptor oldAD = getDescriptorViaIndex
            (
             SYSALIASESRowFactory.SYSALIASES_INDEX1_ID,
             keyRow,
             (ScanQualifier [][]) null,
             ti,
             (TupleDescriptor) null,
             (List<TupleDescriptor>) null,
             AliasDescriptor.class,
             true,
             TransactionController.ISOLATION_REPEATABLE_READ,
             tc);
        RoutineAliasInfo   oldRai = (RoutineAliasInfo) oldAD.getAliasInfo();
        TypeDescriptor     newReturnType = DataTypeDescriptor.getCatalogType( Types.VARCHAR, Limits.MAX_CLOB_RETURN_LEN );
        RoutineAliasInfo   newRai = new RoutineAliasInfo
            (
             oldRai.getMethodName(),
             oldRai.getParameterCount(),
             oldRai.getParameterNames(),
             oldRai.getParameterTypes(),
             oldRai.getParameterModes(),
             oldRai.getMaxDynamicResultSets(),
             oldRai.getParameterStyle(),
             oldRai.getSQLAllowed(),
             oldRai.isDeterministic(),
             oldRai.hasVarargs(),
             oldRai.hasDefinersRights(),
             oldRai.calledOnNullInput(),
             newReturnType
             );
        AliasDescriptor      newAD = new AliasDescriptor
            (
             this,
             oldAD.getUUID(),
             oldAD.getObjectName(),
             oldAD.getSchemaUUID(),
View Full Code Here

       
    aliasKeyRow.setColumn(1, new SQLChar( SchemaDescriptor.SYSCS_UTIL_SCHEMA_UUID ));
    aliasKeyRow.setColumn(2, aliasNameOrderable);
    aliasKeyRow.setColumn(3, nameSpaceOrderable);

        AliasDescriptor oldAD = getDescriptorViaIndex
            (
             SYSALIASESRowFactory.SYSALIASES_INDEX1_ID,
             aliasKeyRow,
             (ScanQualifier [][]) null,
             aliasTI,
             (TupleDescriptor) null,
             (List<TupleDescriptor>) null,
             AliasDescriptor.class,
             true,
             TransactionController.ISOLATION_REPEATABLE_READ,
             tc);
        UUID                 aliasID = oldAD.getUUID();

        //
        // Now delete the permissions tuple which has a null grantor
        //
    TabInfoImpl          rpTI = getNonCoreTI(SYSROUTINEPERMS_CATALOG_NUM);
View Full Code Here

        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;
    }
View Full Code Here

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

                    boolean isDeterministic = Boolean.valueOf( details[ SYSFUN_DETERMINISTIC_INDEX ] ).booleanValue();
                    boolean hasVarargs = Boolean.valueOf( details[ SYSFUN_VARARGS_INDEX ] ).booleanValue();
                   
                    // Determine the number of arguments (could be zero).
                    int paramCount = details.length - SYSFUN_FIRST_PARAMETER_INDEX;
          TypeDescriptor[] pt = new TypeDescriptor[paramCount];
          String[] paramNames = new String[paramCount];
          int[] paramModes = new int[paramCount];
                    for (int i = 0; i < paramCount; i++) {
                        pt[i] = DataTypeDescriptor.getBuiltInDataTypeDescriptor(
                                    details[SYSFUN_FIRST_PARAMETER_INDEX +i]).getCatalogType();
                        paramNames[i] = "P" + (i +1); // Dummy names
                        // All parameters must be IN.
                        paramModes[i] = (ParameterMetaData.parameterModeIn);
                    }

          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
                            RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL, isDeterministic, hasVarargs,
                            false, /* hasDefinersRights */
              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);

          sysfunDescriptors[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

                false,                              // not definer's rights
                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

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.