Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HibernateUtil {
- private static SessionFactory factory;
- static {
- Configuration configuration = new AnnotationConfiguration();
- configuration.configure();
- factory = configuration.buildSessionFactory();
- }
- public static Session getSession(){
- return factory.openSession();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement