org.apache.openjpa.persistence.criteria
Class CriteriaExpressionBuilder

java.lang.Object
  extended by org.apache.openjpa.persistence.criteria.CriteriaExpressionBuilder

 class CriteriaExpressionBuilder
extends Object

Converts expressions of a CriteriaQuery to kernel Expression.

Since:
2.0.0
Author:
Pinaki Poddar, Fay Wang

Constructor Summary
CriteriaExpressionBuilder()
           
 
Method Summary
protected  void evalAccessPaths(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalCrossJoinRoots(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalDistinct(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalFetchJoin(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalFilter(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalGrouping(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  Map<ExpressionImpl<?>,Value> evalOrdering(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
          Evaluates the ordering expressions by converting them to kernel values.
protected  void evalOrderingAndProjection(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
protected  void evalProjections(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q, Map<ExpressionImpl<?>,Value> exp2Vals)
           
 QueryExpressions getQueryExpressions(ExpressionFactory factory, CriteriaQueryImpl<?> q)
           
(package private)  ResultShape<?> getShape(CriteriaQueryImpl<?> q, ResultShape<?> parent, Selection<?> s)
          Gets the shape of a selection item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaExpressionBuilder

CriteriaExpressionBuilder()
Method Detail

getQueryExpressions

public QueryExpressions getQueryExpressions(ExpressionFactory factory,
                                            CriteriaQueryImpl<?> q)

evalAccessPaths

protected void evalAccessPaths(QueryExpressions exps,
                               ExpressionFactory factory,
                               CriteriaQueryImpl<?> q)

evalOrderingAndProjection

protected void evalOrderingAndProjection(QueryExpressions exps,
                                         ExpressionFactory factory,
                                         CriteriaQueryImpl<?> q)

evalOrdering

protected Map<ExpressionImpl<?>,Value> evalOrdering(QueryExpressions exps,
                                                    ExpressionFactory factory,
                                                    CriteriaQueryImpl<?> q)
Evaluates the ordering expressions by converting them to kernel values. Sets the ordering fields of kernel QueryExpressions.

Parameters:
exps - kernel QueryExpressions
factory - for kernel expressions
q - a criteria query
Returns:
map of kernel values indexed by criteria query expressions that created it. These kernel values are required to be held in a map to avoid recomputing for the same CriteriaQuery Expressions appearing in ordering terms as well as projection term.

evalGrouping

protected void evalGrouping(QueryExpressions exps,
                            ExpressionFactory factory,
                            CriteriaQueryImpl<?> q)

evalDistinct

protected void evalDistinct(QueryExpressions exps,
                            ExpressionFactory factory,
                            CriteriaQueryImpl<?> q)

evalCrossJoinRoots

protected void evalCrossJoinRoots(QueryExpressions exps,
                                  ExpressionFactory factory,
                                  CriteriaQueryImpl<?> q)

evalFilter

protected void evalFilter(QueryExpressions exps,
                          ExpressionFactory factory,
                          CriteriaQueryImpl<?> q)

evalProjections

protected void evalProjections(QueryExpressions exps,
                               ExpressionFactory factory,
                               CriteriaQueryImpl<?> q,
                               Map<ExpressionImpl<?>,Value> exp2Vals)

evalFetchJoin

protected void evalFetchJoin(QueryExpressions exps,
                             ExpressionFactory factory,
                             CriteriaQueryImpl<?> q)

getShape

ResultShape<?> getShape(CriteriaQueryImpl<?> q,
                        ResultShape<?> parent,
                        Selection<?> s)
Gets the shape of a selection item. Creates the shape if necessary.

Parameters:
q - the original query
parent - the parent shape that nests this given selection
s - the selection term for which a result shape to be computed


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.