Class JpaNativeQueryProvider<E>
- java.lang.Object
- org.springframework.batch.item.database.orm.AbstractJpaQueryProvider
- org.springframework.batch.item.database.orm.JpaNativeQueryProvider<E>
- Type Parameters:
E- entity returned by executing the query
- All Implemented Interfaces:
JpaQueryProvider,org.springframework.beans.factory.InitializingBean
public class JpaNativeQueryProvider<E> extends AbstractJpaQueryProvider
This query provider creates JPA
Querys from injected native SQL queries. This is useful if there is a need to utilize database-specific features such as query hints, the CONNECT keyword in Oracle, etc.- Author:
- Anatoly Polinsky
Constructor Summary
Constructors Constructor Description JpaNativeQueryProvider()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()javax.persistence.QuerycreateQuery()Create the query object.voidsetEntityClass(java.lang.Class<E> entityClazz)voidsetSqlQuery(java.lang.String sqlQuery)Methods inherited from class org.springframework.batch.item.database.orm.AbstractJpaQueryProvider
getEntityManager, setEntityManager
Method Detail
createQuery
public javax.persistence.Query createQuery()
Description copied from interface:JpaQueryProviderCreate the query object.
- Returns:
- created query
setSqlQuery
public void setSqlQuery(java.lang.String sqlQuery)
setEntityClass
public void setEntityClass(java.lang.Class<E> entityClazz)
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Throws:
java.lang.Exception