|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.co.concise.maven.hdc.dao.HibernateUtil
public abstract class HibernateUtil
Super class for all our data accessor objects.
Field Summary | |
---|---|
static java.lang.ThreadLocal |
session
|
Constructor Summary | |
---|---|
HibernateUtil()
|
Method Summary | |
---|---|
static void |
closeSession()
Closes the session for the running thread. |
static void |
configure(java.lang.String dbDriverClass,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPass,
java.lang.String dbHibernateDialect)
Configures hibernate programmatically. |
static net.sf.hibernate.Session |
currentSession()
Returns a session for the calling thread. |
static void |
handleHibernateException(net.sf.hibernate.Transaction tx,
net.sf.hibernate.HibernateException e)
Handles if there is a hibernate exception during a transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.ThreadLocal session
Constructor Detail |
---|
public HibernateUtil()
Method Detail |
---|
public static void configure(java.lang.String dbDriverClass, java.lang.String dbUrl, java.lang.String dbUser, java.lang.String dbPass, java.lang.String dbHibernateDialect)
dbDriverClass
- the JDBC driver used for persistance.dbUrl
- the URL to the database.dbUser
- the user used to login to the database.dbPass
- the password used to login to the database.dbHibernateDialect
- the database dialect that Hibernate will use.public static net.sf.hibernate.Session currentSession()
public static void closeSession()
public static void handleHibernateException(net.sf.hibernate.Transaction tx, net.sf.hibernate.HibernateException e)
tx
- the transaction.e
- the hibernate exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |