Class AbstractJpaQueryProvider
java.lang.Object
org.springframework.batch.item.database.orm.AbstractJpaQueryProvider
- All Implemented Interfaces:
JpaQueryProvider
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
JpaNamedQueryProvider
,JpaNativeQueryProvider
public abstract class AbstractJpaQueryProvider
extends Object
implements JpaQueryProvider, org.springframework.beans.factory.InitializingBean
Abstract JPA Query Provider to serve as a base class for all JPA Query
providers.
- Since:
- 2.1
- Author:
- Anatoly Polinsky, Dave Syer, Mahmoud Ben Hassine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.persistence.EntityManager
Getter forEntityManager
void
setEntityManager
(jakarta.persistence.EntityManager entityManager) Public setter to override the entityManager that was created by thisHibernateQueryProvider
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
Methods inherited from interface org.springframework.batch.item.database.orm.JpaQueryProvider
createQuery
-
Constructor Details
-
AbstractJpaQueryProvider
public AbstractJpaQueryProvider()
-
-
Method Details
-
setEntityManager
public void setEntityManager(jakarta.persistence.EntityManager entityManager) Public setter to override the entityManager that was created by this
HibernateQueryProvider
. This is currently needed to allowHibernateQueryProvider
to participate in a user's managed transaction.- Specified by:
setEntityManager
in interfaceJpaQueryProvider
- Parameters:
entityManager
- EntityManager to use
-
getEntityManager
protected jakarta.persistence.EntityManager getEntityManager()Getter for
EntityManager
- Returns:
- entityManager the injected
EntityManager
-