moazs.util
Class HibernateUtil

java.lang.Object
  extended by moazs.util.HibernateUtil

public final class HibernateUtil
extends Object

Author:
Thomas Knall

Method Summary
static void closeSession()
          Closes the current session.
static org.hibernate.cfg.Configuration getConfiguration()
           
static org.hibernate.classic.Session getCurrentSession()
          Checks if a session factory is currently available.
static org.hibernate.classic.Session getNewSession()
           
static void initHibernate(MoaConfig hbmConfig)
           
static void schemaExport(org.hibernate.cfg.Configuration configuration, boolean forceCreation)
           
static void schemaExport(MoaConfig config, boolean forceCreation)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.