Hi,
I would like to configure hibernate to keep my datebase data after my session exixts. So I change my "hbm2ddl.auto" to "update" in my configuration.
like this in my code, but it still does not work. Can someone please help me with this. Thank you.
static {
try {
configuration = new Configuration();
configuration.setProperty("hibernate.hbm2ddl.auto", "update");
sessionFactory = configuration.configure().buildSessionFactory();
} catch (Throwable ex) {
// We have to catch Throwable, otherwise we will miss
// NoClassDefFoundError and other subclasses of Error
log.error("Building SessionFactory failed.", ex);
throw new ExceptionInInitializerError(ex);
}
}
|