|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.impl.hibernate.SessionHandler
public class SessionHandler
Singleton class from which hibernate sesssions may be retrieved needed for transactions.
Method Summary | |
---|---|
Connection |
getConnection()
Gets the default JDBC Connection object. |
static SessionHandler |
getInstance()
Returns the singelton instance, calling getInstance(Properties) with properties set to null. |
static SessionHandler |
getInstance(Properties props)
Returns the one and only instance which can be used to obtain a Session for further operation with the hibernate objects. |
Session |
getSession()
Gets hibernate session object, if JDBC Connection was
set earlier this will be used for the opening a hibernate session. |
Session |
getSession(Connection conn)
Gets a a new session whilst using an existing JDBC connection. |
boolean |
isSessionOpen()
Returns true if session is open. |
void |
setConnection(Connection connection)
Sets the default JDBC Connection object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SessionHandler getInstance(Properties props) throws HibernateException
Session
for further operation with the hibernate objects.
HibernateException
- In case a problem occurred while configuring
hibernate or creating the session factory.public static SessionHandler getInstance() throws HibernateException
getInstance(Properties)
with properties set to null.
HibernateException
public Session getSession() throws HibernateException
Connection
was
set earlier this will be used for the opening a hibernate session.
HibernateException
public Session getSession(Connection conn)
conn
- JDBC connectionpublic Connection getConnection()
public void setConnection(Connection connection)
public boolean isSessionOpen()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |