public class HibernateUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
beginTransaction() |
static void |
close() |
static void |
commitTransaction() |
protected static org.hibernate.Session |
currentSession() |
static org.hibernate.SessionFactory |
getSessionFactory()
Retrieve the
SessionFactory . |
static void |
initializeMock()
Initialize a in-memory mock database for testing.
|
static org.hibernate.Session |
newSession()
Open a new
Session from the sessionFactory. |
static void |
rollbackTransaction() |
public static org.hibernate.Session newSession()
Session
from the sessionFactory.
This needs to be closed when done withSession
.protected static org.hibernate.Session currentSession()
public static void beginTransaction()
public static void commitTransaction()
public static void rollbackTransaction()
public static void initializeMock()
public static org.hibernate.SessionFactory getSessionFactory()
SessionFactory
.public static void close()
Copyright © 2017. All rights reserved.