import javax.persistence.Entity; 与import org.hibernate.annotations.Entity; 在Spring注解中
来源:互联网 发布:java企业级开发面试题 编辑:程序博客网 时间:2024/05/01 22:44
今天犯了一个错误。
在写实体类的时候@Entity注解Myeclipse将自动导为import org.hibernate.annotations.Entity;
结果在测试的时候一直报这个实体类not Mapping ,我就纠结了,
1、<property name="packagesToScan">
<value>com.xxx.model</value>
</property>
我写了,
2、<context:annotation-config/>Spring注解我也打开了
3、HQL语句是实体类名称不是表名
结果到处询问,一位大神告诉我将Entity包改成import javax.persistence.Entity; ,因为import org.hibernate.annotations.Entity; 包不被Spring所识别,
问题解决了。
- import javax.persistence.Entity; 与import org.hibernate.annotations.Entity; 在Spring注解中
- import javax.persistence.Entity;
- org.hibernate.annotations.Entity和javax.persistence.Entity
- javax.persistence.Entity和org.hibernate.annotations.Entity的区别
- org.hibernate.annotations.Entity和javax.persistence.Entity 区别
- org.hibernate.annotations.Entity和javax.persistence.Entity区别、使用
- org.hibernate.annotations.Entity和javax.persistence.Entity 区别
- hibernate使用import javax.persistence.Entity是@符号不给提示
- 创建Query时引包问题import javax.persistence.Query和import org.hibernate.Query
- java.lang.NoClassDefFoundError: org/hibernate/annotations/Entity
- import javax.persistence.EntityManager;
- Spring整合Hibernate时出现如下错误Caused by: java.lang.NoClassDefFoundError: javax/persistence/Entity
- spring 整合hibernate Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
- Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.Entity
- Hibernate Entity / Persistence LifeCycle States
- java.lang.NoClassDefFoundError: javax/persistence/Entity
- java.lang.ClassNotFoundException: javax.persistence.Entity
- java.lang.ClassNotFoundException: javax.persistence.Entity
- C#中字符串的内存分配与驻留池
- C#基础知识梳理系列七:字符串
- 浅谈CHAR、WCHAR、TCHAR、LPCTSTR等
- typedef使用大全(指向函数的指针)
- Cocos2d-x学习笔记 (1) 2.1版本后如何利用CCFileUtils设置资源路径
- import javax.persistence.Entity; 与import org.hibernate.annotations.Entity; 在Spring注解中
- HOW TO : Select column in Notepad++
- Python文件夹与文件的操作
- APP被苹果App Store拒绝的79个原因(未完待续)
- 浏览器打不开无线网登录界面原因分析
- 深入了解Struts2返回JSON数据的原理及具体应用范例
- MFC dialog使其子控件CStatic等transparent的方法
- 几个数据分析网站
- MD5算法java实现