Created
December 1, 2012 11:29
-
-
Save rvazquezglez/4181612 to your computer and use it in GitHub Desktop.
Clase de utilería para mantener una sola fábrica de sesión.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HibernateUtil { | |
private static final SessionFactory sessionFactory; | |
/** | |
* Inicializa la fabrica de sesiones de hibernate | |
*/ | |
static { | |
sessionFactory = new Configuration(). | |
configure(). | |
buildSessionFactory(); | |
} | |
/** | |
* Regresa la fabrica de sesiones. | |
* @return Fabrica de sesiones. | |
*/ | |
public static SessionFactory getSessionFactory() { | |
return sessionFactory; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment