在一個 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