Package com.isomorphic.hibernate

# Interface HBProviderInterface

All Known Implementing Classes:
  `HB6Provider`, `SpringHB6Provider`

public interface HBProviderInterface
Interface used to provide specific implementation of `Session` and transaction acquiring and handling.

Implementation of this interface should provide at least two constructors:

1. default constructor - will be used if implementation is used as default hibernate provider
2. constructor with single parameter of type `Properties` - will be used if implementation is used as additional named hibernate provider

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `commitTransaction(org.hibernate.Transaction tx)`
  Commits specified transaction.
  `org.hibernate.SessionFactory`
  `get()`
  Returns `SessionFactory`.
  `org.hibernate.Session`
  `getSession()`
  Returns `Session` for persistence operations.
  `org.hibernate.Transaction`
  `getTransaction(org.hibernate.Session session)`
  Returns started transaction.
  `void`
  `returnSession(org.hibernate.Session session)`
  Closes `Session`.
  `void`
  `rollbackTransaction(org.hibernate.Transaction tx)`
  Rolls back specified transaction.

- ## Method Details

  - ### get

    org.hibernate.SessionFactory get()
    Returns `SessionFactory`.
    Returns:
      `SessionFactory`.

  - ### getSession

    org.hibernate.Session getSession() throws org.hibernate.HibernateException
    Returns `Session` for persistence operations.
    Returns:
      `Session` for persistence operations.
    Throws:
      `org.hibernate.HibernateException` - if unable to acquire `Session`.

  - ### returnSession

    void returnSession(org.hibernate.Session session)
    Closes `Session`.
    Parameters:
      `session` - `Session` which should be closed.

  - ### getTransaction

    org.hibernate.Transaction getTransaction(org.hibernate.Session session) throws org.hibernate.HibernateException
    Returns started transaction.
    Parameters:
      `session` - `Transaction` needed if joining to existing transaction or starting transaction locally.
    Returns:
      `Transaction` Already started transaction for persistence operations.
    Throws:
      `org.hibernate.HibernateException` - if unable to acquire or open transaction.

  - ### commitTransaction

    void commitTransaction(org.hibernate.Transaction tx) throws org.hibernate.HibernateException
    Commits specified transaction.
    Parameters:
      `tx` - `Transaction` transaction to be committed.
    Throws:
      `org.hibernate.HibernateException` - occurred while committing transaction.

  - ### rollbackTransaction

    void rollbackTransaction(org.hibernate.Transaction tx)
    Rolls back specified transaction.
    Parameters:
      `tx` - `Transaction` transaction to be rolled back.