|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.utils.manager.hibernate.HibernateUtil
final class HibernateUtil
Hibernate session utility. Using it to get sessions you will ensure that only session is created only once per thread.
Method Summary | |
---|---|
static void |
closeSession()
Closes previousely opened session. |
static void |
deleteObject(Object object,
Session session)
Deletes object from database using existing session. |
static void |
lock(Object o,
Session s)
Makes a try to lock object. |
static Session |
openSession()
Opens new session or returns currently open session for this thread. |
static void |
saveObject(Object object)
Saves object into storage. |
static void |
saveObject(Object object,
Session session)
Saves object into storage. |
static void |
updateObject(Object object)
Updates object in storage. |
static void |
updateObject(Object object,
Session session)
Updates object in storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Session openSession() throws HibernateException
HibernateException
- if something with session creation goes wrong.public static void closeSession()
public static void lock(Object o, Session s)
o
- object to lock.s
- session to lock object in.public static void saveObject(Object object) throws PersistenceManagerException
object
- object to save.
PersistenceManagerException
- in case of any problems during saving.public static void saveObject(Object object, Session session) throws PersistenceManagerException
object
- object to save.
PersistenceManagerException
- in case of any problems during saving.public static void updateObject(Object object) throws PersistenceManagerException
object
- object to update.
PersistenceManagerException
- in case of any problems during updating.public static void updateObject(Object object, Session session) throws PersistenceManagerException
object
- object to update.session
- session to use. If NULL then new session is opened.
PersistenceManagerException
- in case of any problems during updating.public static void deleteObject(Object object, Session session) throws PersistenceManagerException
object
- object to delete.session
- session to use. If NULL then new session is opened.
PersistenceManagerException
- in case of any problems during deletion.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |