Spring Data Jpa

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

java.lang.Object
  extended by org.springframework.data.jpa.repository.query.AbstractJpaQuery
All Implemented Interfaces:
RepositoryQuery
Direct Known Subclasses:
AbstractStringBasedJpaQuery, PartTreeJpaQuery

public abstract class AbstractJpaQuery
extends Object
implements RepositoryQuery

Abstract base class to implement RepositoryQuerys.

Author:
Oliver Gierke

Constructor Summary
AbstractJpaQuery(JpaQueryMethod method, javax.persistence.EntityManager em)
          Creates a new AbstractJpaQuery from the given JpaQueryMethod.
 
Method Summary
protected  ParameterBinder createBinder(Object[] values)
           
protected  javax.persistence.TypedQuery<Long> createCountQuery(Object[] values)
           
protected  javax.persistence.Query createQuery(Object[] values)
           
protected abstract  javax.persistence.TypedQuery<Long> doCreateCountQuery(Object[] values)
          Creates a TypedQuery for counting using the given values.
protected abstract  javax.persistence.Query doCreateQuery(Object[] values)
          Creates a Query instance for the given values.
 Object execute(Object[] parameters)
           
protected  javax.persistence.EntityManager getEntityManager()
           
protected  JpaQueryExecution getExecution()
           
 JpaQueryMethod getQueryMethod()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJpaQuery

public AbstractJpaQuery(JpaQueryMethod method,
                        javax.persistence.EntityManager em)
Creates a new AbstractJpaQuery from the given JpaQueryMethod.

Parameters:
method -
em -
Method Detail

getQueryMethod

public JpaQueryMethod getQueryMethod()
Specified by:
getQueryMethod in interface RepositoryQuery

getEntityManager

protected javax.persistence.EntityManager getEntityManager()
Returns:
the em

execute

public Object execute(Object[] parameters)
Specified by:
execute in interface RepositoryQuery

getExecution

protected JpaQueryExecution getExecution()

createBinder

protected ParameterBinder createBinder(Object[] values)

createQuery

protected javax.persistence.Query createQuery(Object[] values)

createCountQuery

protected javax.persistence.TypedQuery<Long> createCountQuery(Object[] values)

doCreateQuery

protected abstract javax.persistence.Query doCreateQuery(Object[] values)
Creates a Query instance for the given values.

Parameters:
values - must not be null.
Returns:

doCreateCountQuery

protected abstract javax.persistence.TypedQuery<Long> doCreateCountQuery(Object[] values)
Creates a TypedQuery for counting using the given values.

Parameters:
values - must not be null.
Returns:

Spring Data Jpa

Copyright © 2011-2012 SpringSource. All Rights Reserved.