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

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


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

      Expression abstractSchemaName     = expression.getAbstractSchemaName();
      Expression identificationVariable = expression.getIdentificationVariable();

      // Identification variable
      String variableName = visitDeclaration(abstractSchemaName, identificationVariable);

      if (variableName.length() > 0) {
View Full Code Here


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

    Expression selectExpression = expression.getSelectExpression();

    // visit(CollectionExpression) iterates through the children but for a
    // SELECT clause, a CollectionExpression means the result type is Object[]
    CollectionExpression collectionExpression = collectionExpression(selectExpression);

    if (collectionExpression != null) {
      resolver = buildClassResolver(Object[].class);
    }
    else {
      selectExpression.accept(this);
    }
  }
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

    // If the GROUP BY clause is not defined but the HAVING clause is, the result is treated as a
    // single group, and the select list can only consist of aggregate functions. (page 159)
    if (!expression.hasGroupByClause() &&
         expression.hasHavingClause()) {

      Expression selectExpression = expression.getSelectClause().getSelectExpression();

      if (!isValidWithChildCollectionBypass(selectExpression, AggregateExpressionBNF.ID)) {
        addProblem(selectExpression, SelectStatement_SelectClauseHasNonAggregateFunctions);
      }
    }
View Full Code Here

    CollectionExpression collectionExpression = collectionExpression(expression.getSelectExpression());

    if (collectionExpression != null) {

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

        // At the beginning of the child expression
        if (position == length) {
          addAllIdentificationVariables(expression);
          addAllFunctions(SelectItemBNF.ID);
View Full Code Here

    return getHelper(AcceptableTypeVisitor.class);
  }

  private int findExpressionPosition(CollectionExpression expression) {

    Expression leafExpression = queryPosition.getExpression();

    if (leafExpression != expression) {
      for (int index = 0, count = expression.childrenSize(); index < count; index++) {
        Expression child = expression.getChild(index);

        if (child.isAncestor(leafExpression)) {
          return index;
        }
      }
    }

    int position = position(expression);

    if (position > -1) {
      for (int index = 0, count = expression.childrenSize(); index < count; index++) {
        Expression child = expression.getChild(index);
        String text = child.toActualText();

        if (position <= text.length()) {
          return index;
        }
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.