Hibernate辅助类(官方推荐)
- public class HibernateUtil {
- private static final SessionFactory sessionFactory = buildSessionFactory();
- private static SessionFactory buildSessionFactory() {
- try {
- // Create the SessionFactory from hibernate.cfg.xml
- return new Configuration().configure().buildSessionFactory();
- } catch (Throwable ex) {
- // Make sure you log the exception, as it might be swallowed
- System.err.println("Initial SessionFactory creation failed." + ex);
- throw new ExceptionInInitializerError(ex);
- }
- }
- public static SessionFactory getSessionFactory() {
- return sessionFactory;
- }
- }
Hibernate(Jar包详解)Hibernate优缺点相关资讯 hibernate
- Hibernate利用@DynamicInsert和@ (今 07:09)
- Hibernate某些版本(4.3)下报错 (04月20日)
- Hibernate 5.1.0 正式版发布下载 (02月12日)
| - Hibernate的get和load的区别 (08月07日)
- Hibernate3.1.2_中文文档PDF (02月17日)
- Hibernate ORM 5.0.6 发布下载 (12/17/2015 17:12:55)
|
本文评论 查看全部评论 (0)