package locadora.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {

	private static final SessionFactory factory;
	
	static {
		AnnotationConfiguration cfg = new AnnotationConfiguration();
		cfg.configure();
		factory = cfg.buildSessionFactory();
	}
	
	public Session getSession() {
		return factory.openSession();
	}
}
