Package org.eclipse.persistence.jpa.jpql.parser

Examples of org.eclipse.persistence.jpa.jpql.parser.Expression


        if (index == expression.childrenSize()) {
          index--;
        }

        // Now traverse the child
        Expression child = expression.getChild(index);
        child.accept(this);

        // Rather than marking the CollectionExpression as the Expression to visit
        // with the adjusted QueryPosition, the child that to the left of the invalid
        // expression will be used instead.
        // Example: "SELECT e FROM Employee e WHERE CONCAT(e.name, A|S a)" <- | is the cursor
        //          In this example, "CONCAT(e.name, AS a)" is wrapped with a BadExpression, but
        //          "CONCAT(e.name, " is actually valid so this will allow the new QueryPosition
        //          to be "inside" the CONCAT expression and the proposals will be available
        if (index > 0) {
          Expression previousChild = expression.getChild(index - 1);

          if (!isComplete(previousChild)) {
            queryPosition.setExpression(previousChild);
            queryPosition.addPosition(previousChild, previousChild.getLength());
          }
        }

        if (queryPosition.getExpression() == null) {
          queryPosition.setExpression(expression);
View Full Code Here


     * {@inheritDoc}
     */
    public void visit(JPQLExpression expression) {

      if (expression.hasQueryStatement()) {
        Expression queryStatement = expression.getQueryStatement();
        queryStatement.accept(this);
        queryPosition.addPosition(expression, queryStatement.getLength() - correction);
      }
      else {
        queryPosition.setExpression(expression);
        queryPosition.addPosition(expression, 0);
      }
View Full Code Here

        if (index == expression.childrenSize()) {
          index--;
        }

        // Now traverse the child
        Expression child = expression.getChild(index);
        child.accept(this);

        // Rather than marking the CollectionExpression as the Expression to visit
        // with the adjusted QueryPosition, the child that to the left of the invalid
        // expression will be used instead.
        // Example: "SELECT e FROM Employee e WHERE CONCAT(e.name, A|S a)" <- | is the cursor
        //          In this example, "CONCAT(e.name, AS a)" is wrapped with a BadExpression, but
        //          "CONCAT(e.name, " is actually valid so this will allow the new QueryPosition
        //          to be "inside" the CONCAT expression and the proposals will be available
        if (index > 0) {
          Expression previousChild = expression.getChild(index - 1);

          if (!isComplete(previousChild)) {
            queryPosition.setExpression(previousChild);
            queryPosition.addPosition(previousChild, previousChild.getLength());
          }
        }

        if (queryPosition.getExpression() == null) {
          queryPosition.setExpression(expression);
View Full Code Here

     * {@inheritDoc}
     */
    public void visit(JPQLExpression expression) {

      if (expression.hasQueryStatement()) {
        Expression queryStatement = expression.getQueryStatement();
        queryStatement.accept(this);
        queryPosition.addPosition(expression, queryStatement.getLength() - correction);
      }
      else {
        queryPosition.setExpression(expression);
        queryPosition.addPosition(expression, 0);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      AbstractFromClause fromClause = (AbstractFromClause) expression.getFromClause();
      Expression declaration = fromClause.getDeclaration();
      boolean complete = isValid(declaration, fromClause.declarationBNF());

      if (complete) {
        complete = isComplete(declaration);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      AbstractFromClause fromClause = (AbstractFromClause) expression.getFromClause();
      Expression declaration = fromClause.getDeclaration();
      boolean complete = isValid(declaration, fromClause.declarationBNF());

      if (complete) {
        complete = isComplete(declaration);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      GroupByClause groupByClause = (GroupByClause) expression.getGroupByClause();
      Expression items = groupByClause.getGroupByItems();
      boolean complete = isValid(items, GroupByItemBNF.ID);

      if (complete) {
        complete = isComplete(items);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      GroupByClause groupByClause = (GroupByClause) expression.getGroupByClause();
      Expression items = groupByClause.getGroupByItems();
      boolean complete = isValid(items, GroupByItemBNF.ID);

      if (complete) {
        complete = isComplete(items);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      HavingClause havingClause = (HavingClause) expression.getHavingClause();
      Expression condition = havingClause.getConditionalExpression();
      boolean complete = isValid(condition, ConditionalExpressionBNF.ID);

      if (complete) {
        complete = isComplete(condition);
      }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isClauseComplete(T expression) {

      HavingClause havingClause = (HavingClause) expression.getHavingClause();
      Expression condition = havingClause.getConditionalExpression();
      boolean complete = isValid(condition, ConditionalExpressionBNF.ID);

      if (complete) {
        complete = isComplete(condition);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.parser.Expression

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.