Examples of JSQLType


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

  String[]  getPrimitiveSignature( boolean castToPrimitiveAsNecessary )
    throws StandardException
  {
    int          count = signature.length;
    String[]       primParmTypeNames = new String[ count ];
    JSQLType      jsqlType;

    for (int i = 0; i < count; i++)
    {
      jsqlType = signature[ i ];

      if ( jsqlType == null ) { primParmTypeNames[i] = ""; }
      else
      {
        switch( jsqlType.getCategory() )
          {
              case JSQLType.SQLTYPE:

            if ((procedurePrimitiveArrayType != null)
              && (i < procedurePrimitiveArrayType.length)
              && (procedurePrimitiveArrayType[i] != null)) {

              primParmTypeNames[i] = procedurePrimitiveArrayType[i];

            } else {


              TypeId  ctid = mapToTypeID( jsqlType );

              if ((ctid.isNumericTypeId() && !ctid.isDecimalTypeId()) || ctid.isBooleanTypeId())
              {
                TypeCompiler tc = getTypeCompiler(ctid);
                primParmTypeNames[i] = tc.getCorrespondingPrimitiveTypeName();
                if ( castToPrimitiveAsNecessary) { methodParms[i].castToPrimitive(true); }
              }
              else { primParmTypeNames[i] = ctid.getCorrespondingJavaTypeName(); }
            }

            break;

                case JSQLType.JAVA_CLASS:

            primParmTypeNames[i] = jsqlType.getJavaClassName();
            break;

                case JSQLType.JAVA_PRIMITIVE:

            primParmTypeNames[i] = JSQLType.primitiveNames[ jsqlType.getPrimitiveKind() ];
            if ( castToPrimitiveAsNecessary) { methodParms[i].castToPrimitive(true); }
            break;

                default:
View Full Code Here

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

    //make sure we are calling super's setType. We will get into
    //an infinite loop if this setType ends up calling the local
    //setType method
    super.setType(descriptor);

    if ( getJSQLType() == null ) { setJSQLTypenew JSQLType( descriptor ) ); }
  }
View Full Code Here

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

            td.getScale(),
            td.isNullable(),
            td.getMaximumWidth()
          );

        signature[p] = new JSQLType(methoddtd);

        // this is the SQL type of the procedure parameter.
        DataTypeDescriptor paramdtd = new DataTypeDescriptor(
          parameterTypeId,
          td.getPrecision(),
          td.getScale(),
          td.isNullable(),
          td.getMaximumWidth()
        );

                //
                // Now coerce the actual method parameter to the declared type
                // of this routine arg.
                //

                // if this is the last argument of a varargs routine...
                if ( hasVarargs && (p == parameterCount-1) )
                {
                    //
                    // The invocation of a varargs routine may have more actual parameters
                    // than the number of declared routine arguments. All of the trailing
                    // parameters must be coercible to the type of the last declared argument.
                    // Furthermore, it may turn out that there isn't a parameter corresponding to the last
                    // declared argument of the varargs routine.
                    //
                    for ( int idx = p; idx < methodParms.length; idx++ )
                    {
                        coerceMethodParameter
                            (
                             fromList, subqueryList, aggregateVector,
                             rai,
                             methodParms.length,
                             paramdtd, parameterTypeId, parameterMode,
                             idx
                             );
                    }
                }
                else    // NOT the last argument of a varargs routine
                {
                    coerceMethodParameter
                        (
                         fromList, subqueryList, aggregateVector,
                         rai,
                         methodParms.length,
                         paramdtd, parameterTypeId, parameterMode,
                         p
                         );
                }
      }

      if (sigParameterCount != parameterCount) {

        DataTypeDescriptor dtd = new DataTypeDescriptor(
            TypeId.getUserDefinedTypeId("java.sql.ResultSet[]"),
            0,
            0,
            false,
            -1
          );

        signature[parameterCount] = new JSQLType(dtd);

      }

      this.routineInfo = rai;
      ad = proc;
View Full Code Here

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

    */
    @Override
    String getJavaTypeName()
            throws StandardException
  {
    JSQLType  myType = getJSQLType();

    if ( myType == null ) { return ""; }
    else { return  mapToTypeID( myType ).getCorrespondingJavaTypeName(); }
  }
View Full Code Here

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

    */
    @Override
    String getPrimitiveTypeName()
    throws StandardException
  {
    JSQLType  myType = getJSQLType();

    if ( myType == null )
    {
      return "";
    }
View Full Code Here

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

      }
      else
      {
        DataTypeDescriptor dtd = value.getTypeServices();
        if (dtd != null)
          jsqlType = new JSQLType( dtd );
      }
    }

    return jsqlType;
  }
View Full Code Here

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

            td.getScale(),
            td.isNullable(),
            td.getMaximumWidth()
          );

        signature[p] = new JSQLType(methoddtd);

        // this is the SQL type of the procedure parameter.
        DataTypeDescriptor paramdtd = new DataTypeDescriptor(
          parameterTypeId,
          td.getPrecision(),
          td.getScale(),
          td.isNullable(),
          td.getMaximumWidth()
        );

                //
                // Now coerce the actual method parameter to the declared type
                // of this routine arg.
                //

                // if this is the last argument of a varargs routine...
                if ( hasVarargs && (p == parameterCount-1) )
                {
                    //
                    // The invocation of a varargs routine may have more actual parameters
                    // than the number of declared routine arguments. All of the trailing
                    // parameters must be coercible to the type of the last declared argument.
                    // Furthermore, it may turn out that there isn't a parameter corresponding to the last
                    // declared argument of the varargs routine.
                    //
                    for ( int idx = p; idx < methodParms.length; idx++ )
                    {
                        coerceMethodParameter
                            (
                             fromList, subqueryList, aggregates,
                             rai,
                             methodParms.length,
                             paramdtd, parameterTypeId, parameterMode,
                             idx
                             );
                    }
                }
                else    // NOT the last argument of a varargs routine
                {
                    coerceMethodParameter
                        (
                         fromList, subqueryList, aggregates,
                         rai,
                         methodParms.length,
                         paramdtd, parameterTypeId, parameterMode,
                         p
                         );
                }
      }

      if (sigParameterCount != parameterCount) {

        DataTypeDescriptor dtd = new DataTypeDescriptor(
            TypeId.getUserDefinedTypeId("java.sql.ResultSet[]"),
            0,
            0,
            false,
            -1
          );

        signature[parameterCount] = new JSQLType(dtd);

      }

      this.routineInfo = rai;
      ad = proc;
View Full Code Here

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

     * Get the Java class corresponding to a Derby datatype.
     */
    private Class<?> getJavaClass( ClassFactory classFactory, DataTypeDescriptor dtd )
        throws StandardException, ClassNotFoundException
    {
        JSQLType    jsqlType = new JSQLType( dtd );
        String  javaClassName = MethodCallNode.getObjectTypeName( jsqlType, null );

        //
        // The real class name of byte[] is [B. Class.forName( "byte[]" ) will throw a
        // ClassNotFoundException.
View Full Code Here

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

        return DataTypeDescriptor.getSQLDataTypeDescriptor( getJavaTypeName()) ;
    }

    final boolean isPrimitiveType() throws StandardException
  {
    JSQLType  myType = getJSQLType();
   
    if ( myType == null ) { return false; }
    else { return ( myType.getCategory() == JSQLType.JAVA_PRIMITIVE ); }
  }
View Full Code Here

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

    else { return ( myType.getCategory() == JSQLType.JAVA_PRIMITIVE ); }
  }

    String getJavaTypeName() throws StandardException
  {
    JSQLType  myType = getJSQLType();

    if ( myType == null ) { return ""; }

    switch( myType.getCategory() )
    {
        case JSQLType.JAVA_CLASS: return myType.getJavaClassName();

        case JSQLType.JAVA_PRIMITIVE: return JSQLType.getPrimitiveName( myType.getPrimitiveKind() );

        default:

        if (SanityManager.DEBUG)
        { SanityManager.THROWASSERT( "Inappropriate JSQLType: " + myType ); }
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.