Reformat rest of the design patterns - Issue #224
This commit is contained in:
@@ -14,27 +14,25 @@ import com.iluwatar.servicelayer.wizard.Wizard;
|
||||
*/
|
||||
public class HibernateUtil {
|
||||
|
||||
private static final SessionFactory sessionFactory;
|
||||
private static final SessionFactory sessionFactory;
|
||||
|
||||
static {
|
||||
try {
|
||||
sessionFactory = new Configuration()
|
||||
.addAnnotatedClass(Wizard.class)
|
||||
.addAnnotatedClass(Spellbook.class)
|
||||
.addAnnotatedClass(Spell.class)
|
||||
.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect")
|
||||
.setProperty("hibernate.connection.url", "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1")
|
||||
.setProperty("hibernate.current_session_context_class", "thread")
|
||||
.setProperty("hibernate.show_sql", "true")
|
||||
.setProperty("hibernate.hbm2ddl.auto", "create-drop")
|
||||
.buildSessionFactory();
|
||||
} catch (Throwable ex) {
|
||||
System.err.println("Initial SessionFactory creation failed." + ex);
|
||||
throw new ExceptionInInitializerError(ex);
|
||||
}
|
||||
}
|
||||
static {
|
||||
try {
|
||||
sessionFactory =
|
||||
new Configuration().addAnnotatedClass(Wizard.class).addAnnotatedClass(Spellbook.class)
|
||||
.addAnnotatedClass(Spell.class)
|
||||
.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect")
|
||||
.setProperty("hibernate.connection.url", "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1")
|
||||
.setProperty("hibernate.current_session_context_class", "thread")
|
||||
.setProperty("hibernate.show_sql", "true")
|
||||
.setProperty("hibernate.hbm2ddl.auto", "create-drop").buildSessionFactory();
|
||||
} catch (Throwable ex) {
|
||||
System.err.println("Initial SessionFactory creation failed." + ex);
|
||||
throw new ExceptionInInitializerError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static SessionFactory getSessionFactory() {
|
||||
return sessionFactory;
|
||||
}
|
||||
public static SessionFactory getSessionFactory() {
|
||||
return sessionFactory;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user