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的過程中, 遇到最多的一個問題是關于hibernate-annotations的, 這里, 需要再重申一下, 從hibernate core 3.6開始, 就沒有hibernate-annotations這個項目了, 它已經被整合進了hibernate-core, 所以, 如果你在使用hibernate-core 3.6 / 4.x的話, 請把hibernate-annotation這個依賴移除掉 (事實上, 如果有的話, 那你可能在使用錯誤的版本, 因為根本就不存在 3.6 / 4.x 版本的hibernate-annotations)
在hibernate core 3.2 / 3.3的時代, hibernate-core需要兼容JDK1.4, 所以為了能夠使用JDK1.5中出現的annotation, 我們必須創建一個新的項目, 即hibernate-annotations, 而從hibernate-core 3.5開始, 我們拋棄了JDK1.4轉向了1.5, 所以, 就沒有必要在把annotations放在一個單獨的項目當中了.