*inthedefaultpackage.Use#setConfigFile()toupdate
*thelocationoftheconfigurationfileforthecurrentsession.
*/
privatestatic String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";
privatestaticfinal ThreadLocal<Session> threadLocal = new ThreadLocal<Session>();
private static Configuration configuration = new Configuration();
privatestatic org.hibernate.SessionFactory sessionFactory;
privatestatic String configFile = CONFIG_FILE_LOCATION;
static {
try {
configuration.configure(configFile);
sessionFactory = configuration.buildSessionFactory();
} catch (Exception e) {
System.err
.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
private HibernateSessionFactory() {
}
/**