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

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


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

      IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();

      // Create the Expression for the identification variable
      identificationVariable.accept(ExpressionBuilderVisitor.this);
      localExpression = new MapEntryExpression(queryExpression);

      // Retrieve the mapping's key mapping's descriptor
      descriptor = queryContext.resolveDescriptor(expression);
    }
View Full Code Here


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

      IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();

      // Create the Expression for the identification variable
      identificationVariable.accept(ExpressionBuilderVisitor.this);
      localExpression = queryExpression;

      // Retrieve the mapping's reference descriptor
      declaration = queryContext.findDeclaration(identificationVariable.getVariableName());
      descriptor = declaration.getDescriptor();
    }
View Full Code Here

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

    IdentificationVariable variable = (IdentificationVariable) expression.getIdentificationVariable();
    Declaration declaration = queryContext.getDeclaration(variable.getVariableName());

    // If the Declaration is RangeDeclaration, then retrieve its Descriptor directly,
    // this will support two cases automatically, the "root" object is
    // 1) An abstract schema name (entity name) -> parsed as AbstractSchemaName
    // 2) A fully qualified class name -> parsed as a CollectionValuedPathExpression
View Full Code Here

   */
  @Override
  public void visit(ResultVariable expression) {

    expression.getSelectExpression().accept(this);
    IdentificationVariable identificationVariable = (IdentificationVariable) expression.getResultVariable();
    String variableName = identificationVariable.getVariableName();
    queryContext.addQueryExpression(variableName, queryExpression);

    // Note: The type will be calculated when traversing the select expression
  }
View Full Code Here

    @Override
    public void visit(Join expression) {

      if (expression.hasIdentificationVariable()) {

        IdentificationVariable identificationVariable = (IdentificationVariable) expression.getIdentificationVariable();
        Expression queryExpression = addNonFetchJoinedAttribute(expression, identificationVariable);

        // Add the ON clause to the expression
        if (expression.hasOnClause()) {
          Expression onClause = queryContext.buildExpression(expression.getOnClause());

          // Create the JOIN expression using the base Expression
          if (expression.isLeftJoin()) {
            queryExpression = baseExpression.leftJoin(queryExpression, onClause);
          }
          else {
            queryExpression = baseExpression.join(queryExpression, onClause);
          }
        }

        // Add the FETCH expression to the Expression
        if (expression.hasFetch()) {

          String variableName = identificationVariable.getVariableName();
          queryExpression = queryContext.getQueryExpression(variableName);

          if (queryExpression == null) {
            queryExpression = queryContext.buildExpression(expression);
            queryContext.addQueryExpression(variableName, queryExpression);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void visit(KeyExpression expression) {
    IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
    Declaration declaration = queryContext.findDeclaration(identificationVariable.getVariableName());
    DatabaseMapping mapping = declaration.getMapping();
    MappedKeyMapContainerPolicy mapContainerPolicy = (MappedKeyMapContainerPolicy) mapping.getContainerPolicy();
    type = (Class<?>) mapContainerPolicy.getKeyType();
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void visit(ValueExpression expression) {
    IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
    Declaration declaration = queryContext.findDeclaration(identificationVariable.getVariableName());
    DatabaseMapping mapping = declaration.getMapping();
    type = mapping.getReferenceDescriptor().getJavaClass();
  }
View Full Code Here

     * {@link InputParameter}
     */
    @Override
    public void visit(KeyExpression expression) {

      IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
      Declaration declaration = queryContext.getDeclaration(identificationVariable.getVariableName());
      DatabaseMapping mapping = declaration.getMapping();

      ContainerPolicy containerPolicy = mapping.getContainerPolicy();
      MappedKeyMapContainerPolicy mapPolicy = (MappedKeyMapContainerPolicy) containerPolicy;
      descriptor = mapPolicy.getKeyMapping().getReferenceDescriptor();
View Full Code Here

    /**
     * {@link InputParameter}
     */
    @Override
    public void visit(ValueExpression expression) {
      IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
      Declaration declaration = queryContext.getDeclaration(identificationVariable.getVariableName());
      descriptor = declaration.getDescriptor();
    }
View Full Code Here

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

      IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
      String variableName = identificationVariable.getVariableName();

      // Retrieve the Expression for the identification variable
      declaration = queryContext.findDeclaration(variableName);
      declaration.getBaseExpression().accept(ExpressionBuilderVisitor.this);
      localExpression = queryExpression;
View Full Code Here

TOP

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

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.