View Javadoc
1   /******************************************************************************
2    * HibernateUtil.java - Non-object access to the database 
3    * 
4    * BuckoVidLib - The BuckoSoft Video Library
5    * Copyright(c) 2015 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.BSAccount.db;
9   
10  import org.hibernate.SessionFactory;
11  import org.hibernate.cfg.Configuration;
12  
13  /** Non-object access to the database. <br>
14   * This class is really private to DatabaseImpl.
15   * @author Dick Balaska
16   * @since 2015/04/15
17   * @version $Revision$ <br> $Date$
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);	//.setProperties(props);
28  		sessionFactory = configuration.buildSessionFactory();		// XXX deprecated use
29  	}
30  
31  	protected SessionFactory getSessionFactory() {
32  		return sessionFactory;
33  	}
34  }