Configuration configuration = new Configuration().configure(); //以下这两句就是4.3的新用法 StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()); StandardServiceRegistryImpl registry = (StandardServiceRegistryImpl) builder.build(); SessionFactory sessionFactory = configuration.buildSessionFactory(registry); Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction();
相关文章
- 01-29春季-在syscontext上传递ClientInfo / ClientIdentifier /与Hibernate进行连接以进行审核
- 01-29hibernate学习三 精解Hibernate之核心文件
- 01-295 -- Hibernate的基本用法 --4 2 hibernate.properties文件与hibernate.cfg.xml文件
- 01-29Hibernate5 与 Spring Boot2 最佳性能实践
- 01-29Hibernate中使用Criteria查询
- 01-29TC4.3 右键菜单
- 01-29hibernate 和 jdbc 优缺点对比
- 01-29hibernate联合主键
- 01-29hibernate联合主键 注解方式
- 01-29hibernate联合主键注解方式