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

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


    /**
     * {@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(RangeVariableDeclaration expression) {

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

    switch (declaration.getType()) {

      // If the Declaration is RangeDeclaration, then retrieve its Descriptor directly,
      // this will support two cases automatically, the "root" object is
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

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

    // Now cache the Expression for future retrieval by the ORDER BY clause
    IdentificationVariable identificationVariable = (IdentificationVariable) expression.getResultVariable();
    resultVariable = identificationVariable.getText();

    // Create the Expression that is added to the query as an attribute
    expression.getSelectExpression().accept(this);

    resultVariable = null;
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void visit(ValueExpression expression) {
    IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
    Expression queryExpression = queryContext.buildExpression(expression, type);
    addAttribute(identificationVariable.getText(), queryExpression);
  }
View Full Code Here

    DeclarationResolver declarationResolver = queryContext.getDeclarationResolverImp();

    // Collect the identification variables from the declarations
    for (Declaration declaration : declarationResolver.getDeclarations()) {
      IdentificationVariable identificationVariable = declaration.identificationVariable;
      addIdentificationVariable(identificationVariable, identificationVariables);
    }

    // Collect the result variables
    for (IdentificationVariable identificationVariable : declarationResolver.getResultVariables()) {
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();

    if (mapping.isDirectMapMapping()) {

      DirectMapMapping mapMapping = (DirectMapMapping) mapping;
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

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.