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