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.
在新项目就出错了。 查了一下才知道 有两个同名的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.
相关文章推荐
- cocos2dx通过用eclipse移植android时出现 error: undefined reference to "XXX类:XX()"
- Eclipse europa 更新时 Error retrieving "feature.xml". [error in opening zip file]的解决
- Hibernate 异常 : Error parsing JNDI name [xxx]
- Eclipse 报 “Exception in thread "main" java.lang.OutOfMemoryError: Java heap space ”错误的解决办法
- Android studio打包App报错:Error:(4) Error: "app_name" is not translated in "ar" (Arabic), "cs" (Czech)..
- 升级gitk后,Error in startup script: unknown color name "lime"
- [置顶] AndroidStudio与eclipse打包的时候报错。Error:(4) Error: "ssdk_instapager_login_html" is not translated in "en"
- [ERROR] InnoDB: Trying to access page number 7 in space 957, space name XXX which is outside the tablespace bounds
- Linker Error: _funcName defined in module XXX.c is duplicated in module XXX.c
- Error: "app_name" is not translated in "zh" (Chinese) [MissingTranslation]
- org.hibernate.exception.SQLGrammarException: could not inYou have an error in your SQL syntax;完美解决错误
- Error creating bean with name 'userService' defined in file [D:\eclipse-jee-neon-3-win32-x86_64\jav
- Mac下brew安装gitk遇到错误Error in startup script: unknown color name "lime"
- Eclipse运行程序提示:Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
- LinkageError之loader (instance of xxx) previously initiated loading for a different type with name "lib/MyData"
- Hibernate运行错误: Error parsing JNDI name [xxx]
- Android应用问题:ERROR: unknown virtual device name"XXX"
- Error: "Database 'XXX' is already open and can only have one user at a time"
- org.hibernate.exception.SQLGrammarException: could not inYou have an error in your SQL syntax;完美解决错误
- Eclipse 报 “Exception in thread "main" java.lang.OutOfMemoryError: Java heap space ”错误的解决办法