Hibernate - 不推荐使用 AnnotationConfiguration [英] Hibernate - AnnotationConfiguration deprecated

查看:25
本文介绍了Hibernate - 不推荐使用 AnnotationConfiguration的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 3.6.0 版本中使用 Hibernate,并且 AnnotationConfiguration 被标记为已弃用.

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

这是我的 HibernateUtil.java 类中的行:

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

sessionFactory = new AnnotationConfiguration().configure("/hib.cfg.xml").buildSessionFactory();

AnnotationConfiguration 的替代品是什么?

What's the replacement for AnnotationConfiguration?

推荐答案

所有功能已移至配置":http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/cfg/AnnotationConfiguration.html

"All functionality has been moved to Configuration": http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/cfg/AnnotationConfiguration.html

这是配置:

http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/cfg/Configuration.html

这篇关于Hibernate - 不推荐使用 AnnotationConfiguration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆