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

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


    // 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

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

    Expression patternValue     = expression.getPatternValue();
    Expression stringExpression = expression.getStringExpression();
    Expression escapeCharacter  = expression.getEscapeCharacter();

    if (escapeCharacter == inputParameter) {
      this.type = Character.class;
    }
    else if (patternValue.isAncestor(inputParameter)) {
View Full Code Here

    expression.getStateFieldPathExpression().accept(this);
  }

  private void visitCompoundExpression(CompoundExpression expression) {

    Expression leftExpression  = expression.getLeftExpression();
    Expression rightExpression = expression.getRightExpression();

    // Now traverse the other side to find its return type
    if (leftExpression.isAncestor(inputParameter)) {
      if (currentExpression == null) {
        currentExpression = expression;
        rightExpression.accept(this);
        currentExpression = null;
      }
      else {
        type = null;
        ignoreType = true;
        expression = null;
      }
    }
    // Now traverse the other side to find its return type
    else if (rightExpression.isAncestor(inputParameter)) {
      if (currentExpression == null) {
        currentExpression = expression;
        leftExpression.accept(this);
        currentExpression = null;
      }
View Full Code Here

    @Override
    public void visit(CollectionMemberDeclaration expression) {

      Declaration declaration = new Declaration();

      Expression identificationVariable = expression.getIdentificationVariable();
      String variableName = visitDeclaration(expression, identificationVariable);

      if (variableName.length() > 0) {
        declaration.identificationVariable = (IdentificationVariable) identificationVariable;
      }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void visit(Join expression) {
      Expression identificationVariable = expression.getIdentificationVariable();
      String variableName = visitDeclaration(expression, identificationVariable);
      if (variableName.length() > 0) {
        currentDeclaration.addJoin(expression, (IdentificationVariable) identificationVariable);
      }
      else {
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.