HHH-8674 - fixed usage of deprecated method

Configuration#buildSessionFactory() in documentation
This commit is contained in:
Brett Meyer 2014-01-28 17:19:06 -05:00
parent ea256ac1d6
commit 856721507c
1 changed files with 2 additions and 3 deletions

View File

@ -589,9 +589,8 @@ public class HibernateUtil {
private static SessionFactory buildSessionFactory() { private static SessionFactory buildSessionFactory() {
try { try {
// Create the SessionFactory from hibernate.cfg.xml // Create the SessionFactory from hibernate.cfg.xml
Configuration configuration = new Configuration(); new Configuration().configure().buildSessionFactory(
return configuration.configure().buildSessionFactory(new StandardServiceRegistryBuilder() new StandardServiceRegistryBuilder().build() );
.applySettings(configuration.getProperties()).build());
} }
catch (Throwable ex) { catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed // Make sure you log the exception, as it might be swallowed