hibernate.cfg.xml 中如何设置 hbm.xml 和 Annotations 的 mapping

在一个 Hibernate 项目中,咱们须要同时设置 hbm.xml 和 Annotations 的 mappingapi

这种状况 hibernate.cfg.xml 如何配置?app


其实 hibernate.cfg.xml 中是能够同时设置 hbm.xml 和 Annotations 的。spa

例以下面的配置:hibernate

<mapping class="com.ossez.covid19.common.models.Covid19Current"/>
    <mapping resource="hbm/api/RewsUser.hbm.xml" />

Hibernate 可以自动识别上面 2 个 mapping。code

https://www.cwiki.us/display/HIBERNATE/questions/57938966xml

相关文章
相关标签/搜索