private static Logger log = Logger.getLogger(HibernateHelper.class);
public static void initializeHibernate() throws HibernateException {
if (GlobalSessionFactory.get() == null) {
Configuration cfg = initializeConfiguration();
SessionFactory sessionFactory = cfg.buildSessionFactory();
// XPlanner uses a custom session factory so that all sessions will be
// automatically configured with an XPlanner-related Hibernate interceptor.
GlobalSessionFactory.set(new XPlannerSessionFactory(sessionFactory));
}
}