Examples of JPQLExpression


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

  }

  private void initializeRoot() {

    if (jpqlExpression == null) {
      jpqlExpression = new JPQLExpression(
        query.getExpression(),
        IJPAVersion.DEFAULT_VERSION,
        true
      );
    }
View Full Code Here

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

  }

  private void initializeRoot() {

    if (jpqlExpression == null) {
      jpqlExpression = new JPQLExpression(
        query.getExpression(),
        IJPAVersion.DEFAULT_VERSION,
        true
      );
    }
View Full Code Here

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

  }

  private void initializeRoot() {

    if (jpqlExpression == null) {
      jpqlExpression = new JPQLExpression(
        query.getExpression(),
        IJPAVersion.DEFAULT_VERSION,
        true
      );
    }
View Full Code Here

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

  }

  protected void initializeRoot() {

    if (jpqlExpression == null) {
      jpqlExpression = new JPQLExpression(query.getExpression(), jpqlGrammar, true);
    }

    currentQuery = jpqlExpression;
    contexts.put(currentQuery, this);
  }
View Full Code Here

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

    sb.append(TRIM);
    sb.append(LEFT_PARENTHESIS);
    sb.append(jpqlFragment);
    sb.append(RIGHT_PARENTHESIS);

    JPQLExpression jpqlExpression = new JPQLExpression(
      sb,
      getGrammar(),
      FunctionsReturningStringsBNF.ID,
      true
    );

    TrimExpression trimExpression = (TrimExpression) jpqlExpression.getQueryStatement();
    setSpecification(trimExpression.getSpecification());
    parseTrimCharacter(trimExpression.getTrimCharacter().toParsedText());
    super.parse(trimExpression.getExpression().toParsedText());

    // The trim character is actually the string primary
View Full Code Here

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

   *
   * @return The root of the parsed tree
   */
  public JPQLExpression getExpression() {
    if (jpqlExpression == null) {
      jpqlExpression = new JPQLExpression(getJPQLFragment(), jpqlGrammar, isTolerant());
    }
    return jpqlExpression;
  }
View Full Code Here

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

                                           String selectionCriteria,
                                           AbstractSession session) {

    try {
      // Create the parsed tree representation of the selection criteria
      JPQLExpression jpqlExpression = new JPQLExpression(
        selectionCriteria,
        DefaultEclipseLinkJPQLGrammar.instance(),
        ConditionalExpressionBNF.ID,
        isTolerant()
      );

      // Caches the info and add a virtual range variable declaration
      JPQLQueryContext queryContext = new JPQLQueryContext(jpqlGrammar());
      queryContext.cache(session, null, jpqlExpression, selectionCriteria);
      queryContext.addRangeVariableDeclaration(entityName, "this");

      // Validate the JPQL query, which will use the JPQL grammar matching the validation
      // level, for now, only validate the query statement because there could be an unknown
      // ending that is an order by clause
      validate(queryContext, jpqlExpression.getQueryStatement());

      // Create the Expression representing the selection criteria
      return queryContext.buildExpression(jpqlExpression.getQueryStatement());
    }
    catch (JPQLException exception) {
      throw exception;
    }
    catch (Exception exception) {
View Full Code Here

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

                                         DatabaseQuery query,
                                         AbstractSession session) {

    try {
      // Parse the JPQL query with the most recent JPQL grammar
      JPQLExpression jpqlExpression = new JPQLExpression(
        jpqlQuery,
        DefaultEclipseLinkJPQLGrammar.instance(),
        isTolerant()
      );

      // Create a context that caches the information contained in the JPQL query
      // (especially from the FROM clause)
      JPQLQueryContext queryContext = new JPQLQueryContext(jpqlGrammar());
      queryContext.cache(session, query, jpqlExpression, jpqlQuery);

      // Validate the JPQL query, which will use the JPQL grammar matching the validation level
      validate(queryContext, jpqlExpression);

      // Create the DatabaseQuery by visiting the parsed tree
      DatabaseQueryVisitor visitor = new DatabaseQueryVisitor(queryContext, jpqlQuery);
      jpqlExpression.accept(visitor);

      // Add the input parameter types to the DatabaseQuery
      if (query == null) {
        query = queryContext.getDatabaseQuery();
        addArguments(queryContext, query);
View Full Code Here

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

                                               CharSequence jpqlQuery,
                                               String queryBNFId,
                                               boolean tolerant) {

    // First parse the JPQL query
    JPQLExpression jpqlExpression = parse(jpqlQuery, getGrammar(), tolerant);

    // Now visit the parsed expression and create the state object hierarchy
    BasicStateObjectBuilder builder = getStateObjectBuilder();

    try {
      builder.jpqlQueryBuilder    = this;
      builder.managedTypeProvider = provider;

      jpqlExpression.accept(wrap(builder));

      return builder.parent;
    }
    finally {
      builder.jpqlQueryBuilder    = null;
View Full Code Here

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

  public StateObject buildStateObject(StateObject parent,
                                      CharSequence jpqlFragment,
                                      String queryBNFId) {

    // First parse the JPQL fragment
    JPQLExpression jpqlExpression = parse(jpqlFragment, parent.getGrammar(), queryBNFId);

    // We keep track of the old stuff because during the creation of a JPQLQueryStateObject,
    // it is possible the state model uses this builder to create some objects
    BasicStateObjectBuilder builder  = getStateObjectBuilder();
    IJPQLQueryBuilder oldBuilder     = builder.jpqlQueryBuilder;
    IManagedTypeProvider oldProvider = builder.managedTypeProvider;
    JPQLQueryStateObject oldParent   = builder.parent;
    StateObject oldStateObject       = builder.stateObject;

    try {
      builder.jpqlQueryBuilder    = this;
      builder.managedTypeProvider = parent.getManagedTypeProvider();
      builder.parent              = parent.getRoot();
      builder.stateObject         = parent;

      // Visit the Expression for which a StateObject is needed
      jpqlExpression.getQueryStatement().accept(wrap(builder));

      return builder.stateObject;
    }
    finally {
      builder.jpqlQueryBuilder    = oldBuilder;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.