关于hibernate的AnnotationConfiguration的问题

在hibernate4之后就移除了AnnotationConfiguration()方法了,Configuration已经包含了注解的方法

Configuration con = new Configuration();
SessionFactory sf = con.configure().buildSessionFactory();
Session s = sf.openSession();    

配置文件

<mapping class="com.jckj.hibernate.model.Teacher"/>

  

猜你喜欢

转载自www.cnblogs.com/mr-hu2009/p/9452253.html