Hibernate - AnnotationConfiguration deprecated

后端 未结 4 1751
深忆病人
深忆病人 2020-12-15 03:01

I am using Hibernate in version 3.6.0 and the AnnotationConfiguration is marked as deprecated.

Here is the the line in my HibernateUtil.java class:

s         


        
4条回答
  •  无人及你
    2020-12-15 03:42

    yes it is working for me-

    Configuration cfg=new Configuration();
        cfg.configure();
    
        ServiceRegistry serviceregistry=new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry();
    
    
        Session session=cfg.configure().buildSessionFactory(serviceregistry).openSession();
    

提交回复
热议问题