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:
- default constructor - will be used if implementation is used as default hibernate provider
- constructor with single parameter of type
Properties- will be used if implementation is used as additional named hibernate provider
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommitTransaction(org.hibernate.Transaction tx) Commits specified transaction.org.hibernate.SessionFactoryget()ReturnsSessionFactory.org.hibernate.SessionReturnsSessionfor persistence operations.org.hibernate.TransactiongetTransaction(org.hibernate.Session session) Returns started transaction.voidreturnSession(org.hibernate.Session session) ClosesSession.voidrollbackTransaction(org.hibernate.Transaction tx) Rolls back specified transaction.
-
Method Details
-
get
org.hibernate.SessionFactory get()ReturnsSessionFactory.- Returns:
SessionFactory.
-
getSession
org.hibernate.Session getSession() throws org.hibernate.HibernateExceptionReturnsSessionfor persistence operations.- Returns:
Sessionfor persistence operations.- Throws:
org.hibernate.HibernateException- if unable to acquireSession.
-
returnSession
void returnSession(org.hibernate.Session session) ClosesSession.- Parameters:
session-Sessionwhich should be closed.
-
getTransaction
org.hibernate.Transaction getTransaction(org.hibernate.Session session) throws org.hibernate.HibernateException Returns started transaction.- Parameters:
session-Transactionneeded if joining to existing transaction or starting transaction locally.- Returns:
TransactionAlready 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-Transactiontransaction to be committed.- Throws:
org.hibernate.HibernateException- occurred while committing transaction.
-
rollbackTransaction
void rollbackTransaction(org.hibernate.Transaction tx) Rolls back specified transaction.- Parameters:
tx-Transactiontransaction to be rolled back.
-