public class HibernateUtil extends Object
Modifier | Constructor and Description |
---|---|
protected |
HibernateUtil(Properties propBundle) |
Modifier and Type | Method and Description |
---|---|
static void |
checkAndRepairLineIndex() |
static void |
closeSession()
Close the current session.
|
static HibernateUtil |
createInstance(Properties propBundle) |
boolean |
dbIsEmpty()
We check if the database contains any tables on Iniitialisation to be
sure we have an empty schema when we create a new database.
|
static boolean |
dialectIsMysql() |
void |
disconnect() |
static org.hibernate.classic.Session |
getCurrentSession() |
String |
getDbName() |
String |
getDbType() |
String |
getHbm2ddlType() |
static HibernateUtil |
getInstance() |
Connection |
getJdbcConnection()
Return a connection to the configured database to be used with utilities
like Liquibase.
|
static org.hibernate.classic.Session |
getNewSession()
Closes the current session and retturns a new one.
|
static org.hibernate.classic.Session |
getSession()
Get the session currently associated with the thread.
|
static org.hibernate.SessionFactory |
getSessionFactory() |
static org.hibernate.classic.Session |
openSession()
Return a new session which is independent of the session created by
getSession.
|
void |
reInitialize()
Completely shut down the session factory and start again.
|
void |
setHbm2ddlType(String hbm2ddlType) |
protected HibernateUtil(Properties propBundle)
public static HibernateUtil createInstance(Properties propBundle)
public static HibernateUtil getInstance()
public static org.hibernate.classic.Session openSession() throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static boolean dialectIsMysql()
public static void checkAndRepairLineIndex()
public Connection getJdbcConnection() throws SQLException
SQLException
public static org.hibernate.classic.Session getSession() throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static org.hibernate.classic.Session getNewSession() throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static void closeSession()
public static org.hibernate.classic.Session getCurrentSession()
public static org.hibernate.SessionFactory getSessionFactory()
public String getHbm2ddlType()
public void setHbm2ddlType(String hbm2ddlType)
hbm2ddlType
- the hbm2ddlType to setpublic void reInitialize()
public void disconnect()
public String getDbType()
public boolean dbIsEmpty()
public String getDbName()
Copyright © 2021. All rights reserved.