Package com.sun.jdo.spi.persistence.support.sqlstore

Examples of com.sun.jdo.spi.persistence.support.sqlstore.RetrieveDesc


        _t = _t.getNextSibling();
        _t = __t36;
        _t = _t.getNextSibling();
        if ( inputState.guessing==0 ) {
         
          RetrieveDesc from = expr2.getRetrieveDesc();
          RetrieveDesc to = op2.getRetrieveDesc();
          from.addResult(i2.getText(), to, outer);
         
        }
        break;
      }
      case VARIABLE:
      {
        AST __t37 = _t;
        op3 = _t==ASTNULL ? null :(JQLAST)_t;
        match(_t,VARIABLE);
        _t = _t.getFirstChild();
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case TYPECAST:
        case FIELD_ACCESS:
        case NAVIGATION:
        case NOT_IN:
        {
          col3 = _t==ASTNULL ? null : (JQLAST)_t;
          name=collectionExprResult(_t);
          _t = _retTree;
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        _t = __t37;
        _t = _t.getNextSibling();
        if ( inputState.guessing==0 ) {
         
          if (col3 != null) {
          RetrieveDesc from = col3.getRetrieveDesc();
          RetrieveDesc to = op3.getRetrieveDesc();
          from.addResult(name, to, outer);
          }
         
        }
        break;
View Full Code Here


     */
    public RetrieveDesc codeGen(PersistenceManager pm, ParameterTable paramtab)
    {
        boolean finer = logger.isLoggable(Logger.FINER);
        boolean finest = logger.isLoggable(Logger.FINEST);
        RetrieveDesc rd = null;
       
        // check if a RetrieveDescriptor for the actual parameter constellation
        // is already available in the cache
        String key = paramtab.getKeyForRetrieveDescCache();

View Full Code Here

     */
    public String toString()
    {
        StringBuffer repr = new StringBuffer();
    Object jqlType = getJQLType();
        RetrieveDesc rd = getRetrieveDesc();
        // token text
        repr.append((getText() == null ? "null" : getText())); //NOI18N
        repr.append(" ["); //NOI18N
        // token type
        repr.append(getType());
View Full Code Here

          errorMsg.fatal(I18NHelper.getMessage(messages, "jqlc.codegeneration.primary.null")); //NOI18N
          }
          else if (value instanceof Boolean)
          {
          boolean booleanValue = ((Boolean)value).booleanValue();
          RetrieveDesc rd = v.getRetrieveDesc();
          rd.addConstraint(null, RetrieveDesc.OP_VALUE, new Integer(0));
          rd.addConstraint(null, RetrieveDesc.OP_VALUE, new Integer(0));
          rd.addConstraint(null, (booleanValue?RetrieveDesc.OP_EQ:RetrieveDesc.OP_NE), null);
          }
          else
          {
          v.getRetrieveDesc().addConstraint(null, RetrieveDesc.OP_VALUE, value);
          }
View Full Code Here

          if (expr.getType() == FIELD_ACCESS) {
          // The NOT operand is a boolean field.
          // Map this to 'booleanField = FALSE'. Note, the runtime will
          // create a JDBC parameter for the literal FALSE and call
          // setBoolean to bind the value.
          RetrieveDesc rd = op2.getRetrieveDesc();
          rd.addConstraint(null, RetrieveDesc.OP_VALUE, Boolean.FALSE);
          expression(expr);
          rd.addConstraint(null, RetrieveDesc.OP_EQ, null);
          }
          else {
          expression(expr);
          op2.getRetrieveDesc().addConstraint(null, RetrieveDesc.OP_NOT, null);
          }
View Full Code Here

      expression(_t);
      _t = _retTree;
      if ( inputState.guessing==0 ) {
       
        if (e.getType() == FIELD_ACCESS) {
        RetrieveDesc rd = e.getRetrieveDesc();
        rd.addConstraint(null, RetrieveDesc.OP_VALUE, Boolean.TRUE);
        rd.addConstraint(null, RetrieveDesc.OP_EQ, null);
        }
       
      }
    }
    catch (RecognitionException ex) {
View Full Code Here

      _t = __t123;
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
       
        RetrieveDesc varRD = var.getRetrieveDesc();
        if (!boundRetrieveDescs.contains(varRD))
        {
        if (col != null)
        {
        if (col.getType() == NOT_IN)
View Full Code Here

      _t = _t.getNextSibling();
      _t = __t121;
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
        RetrieveDesc from = expr.getRetrieveDesc();
        RetrieveDesc to = n.getRetrieveDesc();
        from.addConstraint(i.getText(), to);
       
      }
    }
    catch (RecognitionException ex) {
View Full Code Here

      _t = _t.getNextSibling();
      _t = __t146;
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
        RetrieveDesc rd = op.getRetrieveDesc();
        if ((begin.getType() == VALUE) && (end.getType() == VALUE))
        {
        // Optimization: begin and end are constant values =>
        // calculate start and length of SQL SUBSTRING function
        // at compile time.
        // Note, Semantic ensures begin and end are int or Integer values.
        int beginValue = (begin.getValue() != null) ?
        ((Integer)begin.getValue()).intValue() : 0;
        int endValue = (end.getValue() != null) ?
        ((Integer)end.getValue()).intValue() : 0;
        if (beginValue < 0)
        {
        errorMsg.error(begin.getLine(), begin.getColumn(),
        I18NHelper.getMessage(messages,
        "jqlc.codegeneration.substring.beginnegative", // NOI18N
        String.valueOf(beginValue)));
        }
        else if (endValue < beginValue)
        {
        errorMsg.error(op.getLine(), op.getColumn(),
        I18NHelper.getMessage(messages,
        "jqlc.codegeneration.substring.beginlargerend", // NOI18N
        String.valueOf(beginValue), String.valueOf(endValue)));
        }
        // SQL length = end - begin
        rd.addConstraint(null, RetrieveDesc.OP_VALUE,
        new Integer(endValue-beginValue));
        // SQL start index = begin + 1
        rd.addConstraint(null, RetrieveDesc.OP_VALUE,
        new Integer(beginValue+1));
        }
        else
        {
        // At least one of begin or end is a non constant value =>
        // generate the arguments start and length of the SQL SUBSTRING
        // function as binary plus/minus expressions.
        // The next 3 line denote the SQL length = end - begin
        expression(begin);
        expression(end);
        rd.addConstraint(null, RetrieveDesc.OP_SUB, null);
        // The next 3 lines denote the SQL start index = begin + 1
        rd.addConstraint(null, RetrieveDesc.OP_VALUE, new Integer(1));
        expression(begin);
        rd.addConstraint(null, RetrieveDesc.OP_ADD, null);
        }
        // now push the string on the constraint stack
        expression(string);
        rd.addConstraint(null, RetrieveDesc.OP_SUBSTRING, null);
       
      }
    }
    catch (RecognitionException ex) {
      if (inputState.guessing==0) {
View Full Code Here

      _t = _retTree;
      _t = __t148;
      _t = _t.getNextSibling();
      if ( inputState.guessing==0 ) {
       
        RetrieveDesc rd = op.getRetrieveDesc();
        // the 3 lines denote the SQL function POSITION OR POSITION_START
        expression(pattern);
        expression(string);
        rd.addConstraint(null, opCode, null);
        // SQL handles indexes starting from 1 =>
        // decrement the returned value to make it Java like!
        incr--;
        if (incr != 0)
        {
        rd.addConstraint(null, RetrieveDesc.OP_VALUE, new Integer(incr));
        rd.addConstraint(null, RetrieveDesc.OP_ADD, null);
        }
       
      }
    }
    catch (RecognitionException ex) {
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.RetrieveDesc

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.