Package org.springframework.batch.item.database.orm

# 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

  Constructors
  Constructor
  Description
  `AbstractJpaQueryProvider()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected jakarta.persistence.EntityManager`
  `getEntityManager()`
  Getter for `EntityManager`
  `void`
  `setEntityManager(jakarta.persistence.EntityManager entityManager)`
  Public setter to override the entityManager that was created by this `HibernateQueryProvider`.

  ### 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 allow `HibernateQueryProvider` to participate in a user's managed transaction.

    Specified by:
      `setEntityManager` in interface `JpaQueryProvider`
    Parameters:
      `entityManager` - EntityManager to use

  - ### getEntityManager

    protected jakarta.persistence.EntityManager getEntityManager()

    Getter for `EntityManager`

    Returns:
      entityManager the injected `EntityManager`