dear hibernate users,
I helped some community users on IRC recently which run into issues when migrating to 4.0, and the most popular issue I'm seeing is caused by the hibernate-anntations module dependency, so, I would like to explain it again.
we MERGED this module into hibernate-core since hibernate core 3.6 release, see the release note of 3.6.
so, maven / gradle users, you just need to add hibernate-core ( and hibernate-entitymanager if you're using JPA ) to your dependency list, and remove hibernate-annotation dependency if it is there.
some background:
before hibernate-core 3.5, it was JDK 1.4 compatible, so, to use Annotation, the new feature of JDK 1.5, we had to create a new module, aka, hibernate-annotations
but since we had moved to JDK 1.5 since hibernate-core 3.5, there is no reason to keep hibernate-annotations as a separated module, so, we merged back into hibernate-core.
------------------------ chinese below ---------------------------
我注意到很多人在遷移到hibernate orm 4.x的過程中, 遇到最多的一個(gè)問題是關(guān)于hibernate-annotations的, 這里, 需要再重申一下, 從hibernate core 3.6開始, 就沒有hibernate-annotations這個(gè)項(xiàng)目了, 它已經(jīng)被整合進(jìn)了hibernate-core, 所以, 如果你在使用hibernate-core 3.6 / 4.x的話, 請把hibernate-annotation這個(gè)依賴移除掉 (事實(shí)上, 如果有的話, 那你可能在使用錯(cuò)誤的版本, 因?yàn)楦揪筒淮嬖?3.6 / 4.x 版本的hibernate-annotations)
在hibernate core 3.2 / 3.3的時(shí)代, hibernate-core需要兼容JDK1.4, 所以為了能夠使用JDK1.5中出現(xiàn)的annotation, 我們必須創(chuàng)建一個(gè)新的項(xiàng)目, 即hibernate-annotations, 而從hibernate-core 3.5開始, 我們拋棄了JDK1.4轉(zhuǎn)向了1.5, 所以, 就沒有必要在把a(bǔ)nnotations放在一個(gè)單獨(dú)的項(xiàng)目當(dāng)中了.