{"id":89,"date":"2010-01-12T02:28:34","date_gmt":"2010-01-12T07:28:34","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/daws\/?p=89"},"modified":"2010-01-12T02:28:34","modified_gmt":"2010-01-12T07:28:34","slug":"hibernateutiljava","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/daws\/2010\/01\/12\/hibernateutiljava\/","title":{"rendered":"HibernateUtil.java"},"content":{"rendered":"<p>Con esta clase tenemos al objeto SessionFactory.<\/p>\n<p>package clases;<\/p>\n<p>import org.hibernate.cfg.AnnotationConfiguration;<br \/>\nimport org.hibernate.SessionFactory;<\/p>\n<p>public class HibernateUtil {<br \/>\nprivate static final SessionFactory sessionFactory;<\/p>\n<p>static {<br \/>\ntry {<br \/>\nsessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();<br \/>\n} catch (Throwable ex) {<br \/>\n\/\/ Log the exception.<br \/>\nSystem.err.println(\"Initial SessionFactory creation failed.\" + ex);<br \/>\nthrow new ExceptionInInitializerError(ex);<br \/>\n}<br \/>\n}<br \/>\npublic static SessionFactory getSessionFactory() {<br \/>\nreturn sessionFactory;<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Con esta clase tenemos al objeto SessionFactory. package clases; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.SessionFactory; public class HibernateUtil { private static final SessionFactory sessionFactory; static { try { sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); } catch (Throwable ex) { \/\/ Log the exception. System.err.println(\"Initial SessionFactory creation failed.\" + ex); throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { [&hellip;]<\/p>\n","protected":false},"author":187,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/users\/187"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":2,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":91,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/89\/revisions\/91"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}