Spring Data Jpa

org.springframework.data.jpa.repository.query
Class JpaQueryCreator

java.lang.Object
  extended by org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>
      extended by org.springframework.data.jpa.repository.query.JpaQueryCreator
Direct Known Subclasses:
JpaCountQueryCreator

public class JpaQueryCreator
extends org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>

Query creator to create a CriteriaQuery from a PartTree.

Author:
Oliver Gierke

Constructor Summary
JpaQueryCreator(org.springframework.data.repository.query.parser.PartTree tree, Class<?> domainClass, org.springframework.data.repository.query.ParameterAccessor accessor, org.springframework.data.repository.query.Parameters parameters, javax.persistence.EntityManager em)
          Create a new JpaQueryCreator.
 
Method Summary
protected  javax.persistence.criteria.Predicate and(org.springframework.data.repository.query.parser.Part part, javax.persistence.criteria.Predicate base, Iterator<Object> iterator)
           
protected  javax.persistence.criteria.CriteriaQuery<Object> complete(javax.persistence.criteria.Predicate predicate, org.springframework.data.domain.Sort sort)
          Finalizes the given Predicate and applies the given sort.
protected  javax.persistence.criteria.CriteriaQuery<Object> complete(javax.persistence.criteria.Predicate predicate, org.springframework.data.domain.Sort sort, javax.persistence.criteria.CriteriaQuery<Object> query, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Root<?> root)
          Template method to finalize the given Predicate using the given CriteriaQuery and CriteriaBuilder.
protected  javax.persistence.criteria.Predicate create(org.springframework.data.repository.query.parser.Part part, Iterator<Object> iterator)
           
 List<javax.persistence.criteria.ParameterExpression<?>> getParameterExpressions()
           
protected  javax.persistence.criteria.Predicate or(javax.persistence.criteria.Predicate base, javax.persistence.criteria.Predicate predicate)
           
 
Methods inherited from class org.springframework.data.repository.query.parser.AbstractQueryCreator
createQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaQueryCreator

public JpaQueryCreator(org.springframework.data.repository.query.parser.PartTree tree,
                       Class<?> domainClass,
                       org.springframework.data.repository.query.ParameterAccessor accessor,
                       org.springframework.data.repository.query.Parameters parameters,
                       javax.persistence.EntityManager em)
Create a new JpaQueryCreator.

Parameters:
tree -
domainClass -
accessor -
em -
Method Detail

getParameterExpressions

public List<javax.persistence.criteria.ParameterExpression<?>> getParameterExpressions()
Returns:
the parameterExpressions

create

protected javax.persistence.criteria.Predicate create(org.springframework.data.repository.query.parser.Part part,
                                                      Iterator<Object> iterator)
Specified by:
create in class org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>

and

protected javax.persistence.criteria.Predicate and(org.springframework.data.repository.query.parser.Part part,
                                                   javax.persistence.criteria.Predicate base,
                                                   Iterator<Object> iterator)
Specified by:
and in class org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>

or

protected javax.persistence.criteria.Predicate or(javax.persistence.criteria.Predicate base,
                                                  javax.persistence.criteria.Predicate predicate)
Specified by:
or in class org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>

complete

protected final javax.persistence.criteria.CriteriaQuery<Object> complete(javax.persistence.criteria.Predicate predicate,
                                                                          org.springframework.data.domain.Sort sort)
Finalizes the given Predicate and applies the given sort. Delegates to #complete(Predicate, Sort, CriteriaQuery, CriteriaBuilder) and hands it the current CriteriaQuery and CriteriaBuilder.

Specified by:
complete in class org.springframework.data.repository.query.parser.AbstractQueryCreator<javax.persistence.criteria.CriteriaQuery<Object>,javax.persistence.criteria.Predicate>

complete

protected javax.persistence.criteria.CriteriaQuery<Object> complete(javax.persistence.criteria.Predicate predicate,
                                                                    org.springframework.data.domain.Sort sort,
                                                                    javax.persistence.criteria.CriteriaQuery<Object> query,
                                                                    javax.persistence.criteria.CriteriaBuilder builder,
                                                                    javax.persistence.criteria.Root<?> root)
Template method to finalize the given Predicate using the given CriteriaQuery and CriteriaBuilder.

Parameters:
predicate -
sort -
query -
builder -
Returns:

Spring Data Jpa

Copyright © 2011 SpringSource. All Rights Reserved.