Examples of DataTypeDescriptor


Examples of org.apache.derby.iapi.types.DataTypeDescriptor

        if (rightOperand != null)
        {
            nullableResult |= rightOperand.getTypeServices().isNullable();
        }

        setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID, nullableResult));
    }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    **
    **    CREATE TRIGGER ... INSERT INTO T length(Column), ...
      **
      */

    DataTypeDescriptor  dts     = colDesc.getType();
    TypeId              typeId  = dts.getTypeId();

      if (!typeId.isXMLTypeId())
      {

          StringBuffer methodCall = new StringBuffer();
          methodCall.append(
              "CAST (org.apache.derby.iapi.db.Factory::getTriggerExecutionContext().");
          methodCall.append(isOldTable ? "getOldRow()" : "getNewRow()");
          methodCall.append(".getObject(");
          methodCall.append(colPositionInRuntimeResultSet);
          methodCall.append(") AS ");

          /*
          ** getSQLString() returns <typeName>
          ** for user types, so call getSQLTypeName in that
          ** case.
          */
          methodCall.append(
              (typeId.userType() ?
                   typeId.getSQLTypeName() : dts.getSQLstring()));
         
          methodCall.append(") ");

          return methodCall.toString();
      }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

            if ( forUpdate && !rc.updated() ) { continue; }
           
            if ( rc.hasGenerationClause() )
            {
                ColumnDescriptor    colDesc = rc.getTableColumnDescriptor();
                DataTypeDescriptor  dtd = colDesc.getType();
                DefaultInfo             di = colDesc.getDefaultInfo();
                ValueNode   generationClause = parseGenerationClause( di.getDefaultText(), targetTableDescriptor );

                // insert CAST in case column data type is not same as the
                // resolved type of the generation clause
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

     */
    public boolean hasLargeObjectColumns() {
        for (int i = 0; i < resultColumns.size(); i++) {
            ResultColumn rc = (ResultColumn) resultColumns.elementAt(i);
            if (rc.isReferenced()) {
                DataTypeDescriptor type = rc.getType();
                if (type != null && type.getTypeId().isLOBTypeId()) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

            for (int i = 0; i < refCols.size(); i++)
            {
                if (refCols.isSet(i))
                {
                    ResultColumn rc = (ResultColumn) resultColumns.elementAt(i);
                    DataTypeDescriptor expressionType = rc.getExpression().getTypeServices();
                    if( expressionType != null)
                        perRowUsage += expressionType.estimatedMemoryUsage();
                }
            }

            /*
            ** If the proposed conglomerate is a non-covering index, add the
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

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

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

        {
            TypeDescriptor columnType = columnTypes[ i ];

            if ( columnType.isUserDefinedType() )
            {
                DataTypeDescriptor newColumnDTD = DataTypeDescriptor.getType( columnType );

                newColumnDTD = bindUserType( newColumnDTD );

                TypeDescriptor newColumnType = newColumnDTD.getCatalogType();

                // poke the bound type back into the multi set descriptor
                columnTypes[ i ] = newColumnType;
            }
        }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

                    SQLState.LANG_INVALID_ROW_COUNT_OFFSET,
                    Long.toString(val) );
            }
        } else if (offset instanceof ParameterNode) {
            offset.
                setType(new DataTypeDescriptor(
                            TypeId.getBuiltInTypeId(Types.BIGINT),
                            false /* ignored tho; ends up nullable,
                                     so we test for NULL at execute time */));
        }


        if (fetchFirst instanceof ConstantNode) {
            DataValueDescriptor dvd = ((ConstantNode)fetchFirst).getValue();
            long val = dvd.getLong();

            if (val < 1) {
                throw StandardException.newException(
                    SQLState.LANG_INVALID_ROW_COUNT_FIRST,
                    Long.toString(val) );
            }
        } else if (fetchFirst instanceof ParameterNode) {
            fetchFirst.
                setType(new DataTypeDescriptor(
                            TypeId.getBuiltInTypeId(Types.BIGINT),
                            false /* ignored tho; ends up nullable,
                                     so we test for NULL at execute time*/));
        }
    }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

            ReaderToUTF8Stream utfIn;
            final StringDataValue dvd = (StringDataValue)
                    getParms().getParameter(parameterIndex -1);
            dvd.setStreamHeaderFormat(usePreTenFiveHdrFormat());
            // Need column width to figure out if truncation is needed
            DataTypeDescriptor dtd[] = preparedStatement
                    .getParameterTypes();
            int colWidth = dtd[parameterIndex - 1].getMaximumWidth();
            // Holds either UNKNOWN_LOGICAL_LENGTH or the exact logical length.
            int usableLength = DataValueDescriptor.UNKNOWN_LOGICAL_LENGTH;
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

        try {
            RawToBinaryFormatStream rawStream;
            if (lengthLess) {
                // Indicate that we don't know the logical length of the stream.
                length = DataValueDescriptor.UNKNOWN_LOGICAL_LENGTH;
                DataTypeDescriptor dtd[] =
                    preparedStatement.getParameterTypes();
                rawStream = new RawToBinaryFormatStream(x,
                        dtd[parameterIndex -1].getMaximumWidth(),
                        dtd[parameterIndex -1].getTypeName());
            } else {
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.