您的位置:首页 > 编程语言 > Java开发

hibernate annnotation @talbe( name = "xxx") have error in eclipse

2012-06-28 17:36 357 查看
本来在另一个项目用的好好的代码段

在新项目就出错了。 查了一下才知道 有两个同名的annotation的,我用错了
http://stackoverflow.com/questions/5719571/what-am-i-missing-for-using-hibernate-annotation
There are two sets of persistence annotations (@Entity and @Table) - JPA
annotations (in package javax.persistence) and Hibernate annotations
(in package org.hibernate.annotations). Note that example uses JPA
annotations, whereas your code uses Hibernate annotations, so your code
doesn't compile because these annotations have different sets of
attributes.

So, you need to change packages in your import statements.

Usually you should use JPA annotations unless you need some features provided only by Hibernate annotations.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐