Hibernate 4.3.11 下问题的解决
- 2017.01.09
问题:hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
解决:
将
new Configuration().configure().buildSessionFactory( new
StandardServiceRegistryBuilder().build() );
修改成:
Configuration cfg = new Configuration().configure();
StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySettings(cfg.getProperties()).build();
cfg.buildSessionFactory(serviceRegistry);
随心所欲不逾矩.