1
2
3
4
5
6
7
8 package com.buckosoft.BSAccountMan.db;
9
10 import org.hibernate.SessionFactory;
11 import org.hibernate.cfg.Configuration;
12
13
14
15
16
17
18
19 final class HibernateUtil {
20 private SessionFactory sessionFactory;
21 private Configuration configuration = null;
22
23 @SuppressWarnings("deprecation")
24 protected void initialize(String configFile) {
25 if (configFile == null)
26 configFile = "BSAccount-hibernate.cfg.xml";
27 configuration = new Configuration().configure(configFile);
28 sessionFactory = configuration.buildSessionFactory();
29 }
30
31 protected SessionFactory getSessionFactory() {
32 return sessionFactory;
33 }
34 }