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

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


    if ((helper == null) || !helper.hasClause(expression)) {
      return false;
    }

    Expression clause = helper.getClause(expression);
    Expression clauseExpression = helper.getClauseExpression(clause);
    return helper.isClauseExpressionComplete(clauseExpression);
  }
View Full Code Here


      // After "<collection-valued path expression> "
      if (expression.hasCollectionValuedPathExpression() &&
          expression.hasSpaceAfterCollectionValuedPathExpression()) {

        Expression collectionValuedPathExpression = expression.getCollectionValuedPathExpression();
        length += length(collectionValuedPathExpression) + SPACE_LENGTH;

        // Within "AS"
        if (isPositionWithin(position, length, AS)) {
          proposals.addIdentifier(AS);
View Full Code Here

      if (position == length) {
        helper.addProposals(expression);
      }
      // Somewhere in the clause's expression
      else {
        Expression clauseExpression = helper.getClauseExpression(expression);
        int clauseExpressionLength = length(clauseExpression);

        // At the end of the clause's expression
        if (position == length + clauseExpressionLength + virtualSpaces.peek()) {

          virtualSpaces.add(SPACE_LENGTH);
          corrections.add(-clauseExpressionLength - 2);

          clauseExpression.accept(this);

          // Now ask the helper to add possible identifiers at the end of its expression
          if (isComplete(clauseExpression)) {
            helper.addAtTheEndOfExpression(expression);
          }
View Full Code Here

        // than the expession's grammar would actually allow. The content assist will only
        // provide assistance from the first child to the last allowed child
        int count = Math.min(collectionExpression.childrenSize(), helper.maxCollectionSize(expression));

        for (int index = 0; index < count; index++) {
          Expression child = collectionExpression.getChild(index);
          int childLength = 0;

          // At the beginning of the child expression
          if (position == length) {
            helper.addProposals(expression, index);
View Full Code Here

      return null;
    }

    if (helper.hasClause(expression)) {
      Expression clause = helper.getClause(expression);

      // Check for within the clause
      if (position > length[0]) {
        int clauseLength = length(clause);
        length[0] += clauseLength;
        boolean hasSpaceAfterIdentifier = helper.hasSpaceAfterClause(expression);
        Expression clauseExpression = helper.getClauseExpression(clause);

        // At the end of the clause, check for adding proposals based
        // on possible incomplete information
        if (position == length[0]) {
          helper.appendNextClauseProposals(expression, clause, position, false);
View Full Code Here

    // The KEY, VALUE, and ENTRY operators may only be applied to
    // identification variables that correspond to map-valued associations
    // or map-valued element collections
    if (expression.hasExpression()) {

      Expression childExpression = expression.getExpression();
      String variableName = queryContext.literal(childExpression, LiteralType.IDENTIFICATION_VARIABLE);

      // Retrieve the identification variable's type without traversing the type parameters
      if (ExpressionTools.stringIsNotEmpty(variableName)) {
        ITypeDeclaration typeDeclaration = getTypeDeclaration(childExpression);
View Full Code Here

  private void validateUpdateItemTypes(UpdateItem expression, IType type) {

    if (expression.hasNewValue()) {

      Expression newValue = expression.getNewValue();
      TypeHelper typeHelper = getTypeHelper();
      boolean nullValue = isNullValue(newValue);

      // A NULL value is ignored, except if the type is a primitive, null cannot be
      // assigned to a mapping of primitive type
View Full Code Here

  public void visit(CollectionMemberExpression expression) {

    // Expressions that evaluate to embeddable types are not supported in
    // collection member expressions
    if (expression.hasEntityExpression()) {
      Expression entityExpression = expression.getEntityExpression();

      // Check for embeddable type
      IType type = getType(entityExpression);
      IManagedType managedType = getManagedType(type);
View Full Code Here

    // embeddable types or map entry types (weird because map entry is not
    // an allowed in a COUNT expression)
    if (expression.hasExpression() &&
        expression.hasDistinct()) {

      Expression childExpression = expression.getExpression();

      // Check for embeddable type
      IType type = getType(childExpression);
      IManagedType managedType = getManagedType(type);
View Full Code Here

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

    Expression joinAssociationPath = expression.getJoinAssociationPath();
    validateCollectionValuedPathExpression(joinAssociationPath, false);
    joinAssociationPath.accept(this);

    try {
      registerIdentificationVariable = false;
      expression.getIdentificationVariable().accept(this);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.internal.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.