Package org.apache.derby.catalog

Examples of org.apache.derby.catalog.TypeDescriptor


    private final void create_SYSCS_procedures(
                                               TransactionController   tc, HashSet newlyCreatedRoutines )
        throws StandardException
    {
        // Types used for routine parameters and return types, all nullable.
        TypeDescriptor varchar32672Type = DataTypeDescriptor.getCatalogType(
                Types.VARCHAR, 32672);

        /*
    ** SYSCS_UTIL routines.
    */
 
View Full Code Here


    String          colName = null;
    String          defaultID = null;
    String          tabID = null;
    Integer          colID = null;
    TypeDescriptor         typeDesc = null;
    Object          defaultSerializable = null;
    long          autoincStart = 0;
    long          autoincInc = 0;
    long          autoincValue = 0;
    //The SYSCOLUMNS table's autoinc related columns change with different
View Full Code Here

    ** intended to be movable to the client, so they don't have
    ** the entire implementation.  We need to wrap them in DataTypeServices
    ** and TypeId objects that contain the full implementations for
    ** language processing.
    */
    TypeDescriptor catalogType = (TypeDescriptor) row.getColumn(SYSCOLUMNS_COLUMNDATATYPE).
                          getObject();
    DataTypeDescriptor dataTypeServices =
      DataTypeDescriptor.getType(catalogType);

    /* 7th column is AUTOINCREMENTVALUE (long) */
 
View Full Code Here

       
        TypeDescriptor[] newTypes = null;
       
        for (int t = 0; t < rowTypes.length; t++)
        {
            TypeDescriptor newType = DataTypeDescriptor.getCatalogType(
                    rowTypes[t], collationType);
           
            // Is it the exact same as the old type.
            if (newType == rowTypes[t])
                continue;
View Full Code Here

    Compare if two TypeDescriptors are exactly the same
    @param object the dataTypeDescriptor to compare to.
    */
  public boolean equals(Object object)
  {
    TypeDescriptor typeDescriptor = (TypeDescriptor)object;

    if(!this.getTypeName().equals(typeDescriptor.getTypeName()) ||
       this.precision != typeDescriptor.getPrecision() ||
       this.scale != typeDescriptor.getScale() ||
       this.isNullable != typeDescriptor.isNullable() ||
       this.maximumWidth != typeDescriptor.getMaximumWidth())
       return false;
      else
      {
      switch (typeId.getJDBCTypeId()) {
      case Types.CHAR:
      case Types.VARCHAR:
      case Types.LONGVARCHAR:
      case Types.CLOB:
        //if we are dealing with character types, then we should
        //also compare the collation information on them.
        if(this.collationType != typeDescriptor.getCollationType())
          return false;
        else
          return true;
      default:
        //no collation checking required if we are dealing with
View Full Code Here

  7 - Boolean - CALLED ON NULL INPUT
  8 - TypeDescriptor - return type
*/
  final public StatementNode functionDefinition() throws ParseException, StandardException {
        TableName functionName;
        TypeDescriptor  returnType;
        Object[] functionElements = new Object[CreateAliasNode.ROUTINE_ELEMENT_COUNT];
    jj_consume_token(FUNCTION);
    functionName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    functionElements[0] = functionParameterList();
    jj_consume_token(RETURNS);
    returnType = functionReturnDataType();
    label_36:
    while (true) {
      routineElement(false, returnType.isRowMultiSet(), functionElements);
      switch (jj_nt.kind) {
      case EXTERNAL:
      case NO:
      case NOT:
      case CALLED:
View Full Code Here

/*
* <A NAME="functionReturnDataType">functionReturnDataType</A>
*/
  final public TypeDescriptor functionReturnDataType() throws ParseException, StandardException {
    TypeDescriptor      typeDescriptor;
    if (jj_2_63(1)) {
      typeDescriptor = catalogType();
    } else {
      switch (jj_nt.kind) {
      case TABLE:
View Full Code Here

/*
* <A NAME="parameterTypeList">parameterTypeList</A>
*/
  final public List parameterTypeList() throws ParseException, StandardException {
    ArrayList list = new ArrayList();
    TypeDescriptor type;
    if (jj_2_73(1)) {
      type = catalogType();
            list.add(type);
      label_42:
      while (true) {
View Full Code Here

   *
   * @return true if it has a parameter or return type of character string
   */
  private boolean anyStringTypeDescriptor() {
    RoutineAliasInfo rai = (RoutineAliasInfo)aliasInfo;
    TypeDescriptor aType = rai.getReturnType();
    TypeId compTypeId;
    /*
    ** Try for a built in type matching the
    ** type name. 
    */
    if (aType != null) //that means we are not dealing with a procedure
    {
      compTypeId = TypeId.getBuiltInTypeId(aType.getTypeName());
      if (compTypeId != null && compTypeId.isStringTypeId())
        return true;     
    }
    if (rai.getParameterCount() != 0) {
      int paramCount = rai.getParameterCount();
View Full Code Here

             (List) null,
             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(),
View Full Code Here

TOP

Related Classes of org.apache.derby.catalog.TypeDescriptor

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.