码迷,mamicode.com
首页 > 移动开发 > 详细

玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal

时间:2014-07-22 23:47:28      阅读:378      评论:0      收藏:0      [点我收藏+]

标签:io   for   问题   re   c   app   

最近用JPA遇到这样一个问题:Repeated column in mapping for entity: com.ketayao.security.entity.main.User column: org_id (should be mapped with insert="false" update="false")

这个错误是由实体类引起的,我一开始是这样写的:

@Column
private long orgId;

@ManyToOne
@JoinColumn(name="orgId")
private Organization organization;

在这里get和set方法就省略了。

修改为下面这样就好:

@Column(insertable=false,updatable=false)
private long orgId;

@ManyToOne
@JoinColumn(name="orgId")
private Organization organization;

玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal,布布扣,bubuko.com

玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal

标签:io   for   问题   re   c   app   

原文地址:http://blog.csdn.net/u012116457/article/details/38052369

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!