moazs.util
Class HibernateUtil
java.lang.Object
moazs.util.HibernateUtil
public final class HibernateUtil
- extends Object
- Author:
- Thomas Knall
getConfiguration
public static org.hibernate.cfg.Configuration getConfiguration()
initHibernate
public static void initHibernate(MoaConfig hbmConfig)
getCurrentSession
public static org.hibernate.classic.Session getCurrentSession()
- Checks if a session factory is currently available. If necessary a new
session factory is created.
- Returns:
- current (or new) session factory
- Throws:
org.hibernate.HibernateException
- thrown if a hibernate error occurs
getNewSession
public static org.hibernate.classic.Session getNewSession()
closeSession
public static void closeSession()
- Closes the current session.
- Throws:
org.hibernate.HibernateException
- thrown if session is already closed or a hibernate error
occurs.
schemaExport
public static void schemaExport(MoaConfig config,
boolean forceCreation)
schemaExport
public static void schemaExport(org.hibernate.cfg.Configuration configuration,
boolean forceCreation)
Copyright 2008 EGIZ. All Rights Reserved.