org.springframework.batch.item.database.orm

## Class HibernateNativeQueryProvider<E>

- java.lang.Object
- - org.springframework.batch.item.database.orm.AbstractHibernateQueryProvider
  - - org.springframework.batch.item.database.orm.HibernateNativeQueryProvider<E>

- Type Parameters:
    `E` - entity returned by executing the query
  All Implemented Interfaces:
    HibernateQueryProvider

      public class HibernateNativeQueryProvider<E>
      extends AbstractHibernateQueryProvider

  This query provider creates Hibernate `Query`s 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 and Description
    `HibernateNativeQueryProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()`
    `org.hibernate.SQLQuery` | `createQuery()` Create an `SQLQuery` from the session provided (preferring stateless if both are available).
    `void` | `setEntityClass(java.lang.Class<E> entityClazz)`
    `void` | `setSqlQuery(java.lang.String sqlQuery)`

    - ### Methods inherited from class org.springframework.batch.item.database.orm.AbstractHibernateQueryProvider

      `getStatefulSession, getStatelessSession, isStatelessSession, setSession, setStatelessSession`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HibernateNativeQueryProvider

          public HibernateNativeQueryProvider()

  - ### Method Detail

    - #### createQuery

          public org.hibernate.SQLQuery createQuery()

      Create an `SQLQuery` from the session provided (preferring stateless if both are available).

      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`