mappedBy reference an unknown target entity property解决方法
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleDaoImpl': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.wangzhe.model.Keyword.Articles in com.wangzhe.model.Article.keywords
上面是错误的关键部分
错误原因:在one-to-many注解配置: @OneToMany (mappedBy = "Articles"),mappedBy指向的是要关联的属性,而不是要关联的类,
如果这样配置,hibernate则会找com.wangzhe.model.Keyword类下面的Articles 属性。但实际上没有这个属性,就会报上面的异常
方法:指定到实际关联的属性:即:@OneToMany (mappedBy = "articles ")
mappedBy reference an unknown target entity property解决方法的更多相关文章
- org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.entity.annotations.House.district in
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.entity. ...
- org.hibernate.AnnotationException: mappedBy reference an unknown target entity property
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: xxxxxxx 原因是 ...
- Module 'mysql' already loaded in Unknown on line 0解决方法
Module 'mysql' already loaded in Unknown on line 0解决方法 直接进入php.ini 把;extension=mysql.so注释掉就好了
- Cannot make a static reference to the non-static method的解决方法
报错原因:在一个类中写了一个public String getContent()方法和一个main()方法,getContent()方法中包含了getClass()方法,在main()方法中直接调用了 ...
- mysql碰到unknown variable 'xxxx' 的解决方法
在使用mysqlbinlog查看日志的时候碰到了一个问题, 错误提示如下: /usr/local/mysql/bin/mysqlbinlog: unknown variable 'default-ch ...
- File targeting 'AMD64' is not compatible with the project's target platform 'x86' 解决方法
我在使用vs2010制作64位安装包时出现了以下问题: File targeting 'AMD64' is not compatible with the project's target plat ...
- mount: unknown filesystem type ‘ntfs’ 解决方法
问题: mount –t ntfs /dev/sde1 /mnt/mount: unknown filesystem type ‘ntfs’ 这是由于CentOS release 6.6(Final) ...
- centos7执行umount提示:device is busy或者target is busy解决方法
问题描述: 因为挂载错了,想取消挂载,但是umount报告如下错误: [root@zabbix /]# umount /dev/sdc1 umount: /data1: target is busy. ...
- java.lang.IllegalStateException: Unknown Priority XXXX 的解决方法
异常信息: java.lang.IllegalStateException: Unknown Priority SYS_ERR_SMS at org.apache.log4j.Category.pri ...
随机推荐
- 学习Shell脚本编程(第2期)_编写修改权限及执行Shell程序的步骤
编写Shell程序 执行Shell程序 Shell程序有很多类似C语言和其他程序设计语言的特征,但是又没有程序语言那样复杂.Shell程序是指放在一个文件中的一系列Linux命令和实用程序.在执行的时 ...
- C#脚本引擎 CS-Script 之(一)——初识
最近在做新产品,这个产品需要满足不同项目对于系统的定制性数据处理需求,比如有的要统计一段时间内某开关打开关闭了多少次,有的要统计一段时间内空调的使用率,有的希望根据温度来控制空调的开还是关,有的则是希 ...
- 关于个人博客和Github地址提交
请大家尽快按照http://www.cnblogs.com/SivilTaram/p/5857858.html的要求提交个人博客和Github地址.谢谢!
- IOS开发之—— 客服QQ(调用qq网页聊天),客服热线(拨打电话)
@property (nonatomic,strong) UIButton *but;@property (nonatomic,strong) UIButton *but1;@property (st ...
- 20145208 实验四 Android开发基础
20145208 实验四 Android开发基础 安装Android Studio 安装的具体步骤在老师的链接中已经很详细了,在此就不做赘述了. 在此提出我觉得安装的时候需要注意的两个地方 一是安装地 ...
- JavaScript事件详解
1.事件传播机制:事件冒泡,事件捕获. 2.注册事件处理程序方式: 设置html标签属性为事件处理程序,文档元素的事件处理程序属性,名字由“on”后面跟着事件名组成,例如:onclick,o ...
- openMP的一点使用经验【非原创】
按照百科上说的,针对于openmp的编程,最简单的就是在开头加个#include<omp.h>,然后在后面的for上加一行#pragma omp parallel for即可,下面的是较为 ...
- css动画之波纹
样式定义: #ContactAbout { height: auto; position: relative; overflow: hidden; } #sectioncontact { displa ...
- js中的运动
缓慢隐藏与出现 效果: 鼠标移至分享上黄色区域自动向左隐藏. <!DOCTYPE html> <html> <head> <title></tit ...
- css知识点补充、css属性、
1.媒体查询的css代码的优先级要比其他的高! 2.text-overflow: 定义文本溢出父级元素如何处理! clip/ellipsis/string 3.overflow: visible ...