最近用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的更多相关文章

  1. 由异常:Repeated column in mapping for entity/should be mapped with insert="false" update="false 引发对jpa关联的思考

    由异常:Repeated column in mapping for entity/should be mapped with insert="false" update=&quo ...

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

    近期用JPA遇到这样一个问题:Repeated column in mapping for entity: com.ketayao.security.entity.main.User column: ...

  3. Hibernate中的"Repeated column in mapping for entity"异常

    转:http://lijiejava.iteye.com/blog/786535 一对多双向关联(类Item与类Bid): Item类: public class Item { private int ...

  4. Java EE之Hibernate异常总结org.hibernate.MappingException: Repeated column in mapping for entity:

    解决方案/原因: 一个pojo(JavaBean)中不能有两个属性同时映射到一个数据库字段上 即使是一个属性的两个getter方法也不行 %%%% Error Creating SessionFact ...

  5. 错误解决Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: pers.zhb.domain.Student column: classno (should be mapped with insert="false" update="false")

    1.在学习hibernate的一对多多对一关系的时候,出现了一下错误: 2.错误原因: 这是因为在配置student.hbm.xml的配置文件的时候出现了将两个属性映射到同一个字段: <?xml ...

  6. 【MySQL 线上 BUG 分析】之 多表同字段异常:Column ‘xxx’ in field list is ambiguous

    一.生产出错! 今天早上11点左右,我在工作休息之余,撸了一下猫.突然,工作群响了,老大在里面说:APP出错了! 妈啊,这太吓人了,因为只是说了出错,但是没说错误的信息.所以我赶紧到APP上看看. 这 ...

  7. 错误/异常:org.hibernate.MappingException: Unknown entity: com.shore.entity.Student 的解决方法

    1.错误/异常视图 错误/异常描述:Hibernate配置文件 映射异常,不明实体类Student(org.hibernate.MappingException: Unknown entity: co ...

  8. Struts2异常:HTTP Status 404 - There is no Action mapped for action name addBook.

    HTTP Status 404 - There is no Action mapped for action name addBook. 在地址栏进行访问的时候,出现了这个错误信息,导致出现此异常的原 ...

  9. spring boot jpa没有自动生成表的原因——加上@Entity

    别人的项目弄了好久,竟然是忘记加注解,当然配置文件还是要配置jpa的,pom也要依赖jpa. @Entity jpa: hibernate: ddl-auto: update show-sql: tr ...

随机推荐

  1. 苹果新的编程语言 Swift 语言进阶(八)--属性

    属性是特定类.结构或枚举的相关值,属性根据作用域不同分为实例属性与类型属性,还可以根据是否存储分为存储属性和计算属性. 1.1 实例属性 为一个类.结构或枚举定义的属性默认属于实例属性,即该属性属于为 ...

  2. LeetCode(64)- Min Stack

    题目: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time ...

  3. Oracle经常用到的一些函数

    1.数字函数 NVL( string1, replace_with) :如果string1为NULL,则NVL函数返回replace_with的值,否则返回string1的值,如果两个参数都为NULL ...

  4. ELF 文件 动态连接 - 延迟绑定(PLT)

    PLT 全称:Procedure Linkage Table ,直译:过程连接表 由于在动态连接中,程序的模块之间包含了大量的函数引用,所以在程序开始执行前,动态链接会耗费较多的时间用于模块之间函数引 ...

  5. python之多继承与__mro__的使用

    1 class Base(object): def text(self): print('------text-----') class A(Base): def text(self): print( ...

  6. jQuery学习小结

    1.jQuery hide() 和 show() 通过 jQuery,您可以使用 hide() 和 show() 方法来隐藏和显示 HTML 元素: $("#hide").clic ...

  7. Windows下MySQL重装引起问题的解决

    解决了Plugin 'InnoDB' init function returned error问题和error1405那个安全设置密码登陆问题,我个人觉得关键点在于删除C:/Documents and ...

  8. Mac Launchpad出现两个相同快捷方式的解决办法

    进入以下目录 ~/Library/Application Support/Dock 把里面的.db文件删掉,然后注销重新登录即可.    

  9. 完整的WebRTC调用序列图

    说在前面的话:此图出自Rea-Time Communication with WebRTC: https://book.douban.com/subject/25849712/ 的第五章.

  10. Error:unsupported class file version 52.0问题的解决

    这个问题主要的原因是依赖包的编译版本比主程序的编译版本高,导致主程序无法正常编译或运行,解决这个问题无非两招: 1.提升主程序的编译器版本,用最新的编译器编译主程序,这样就可以兼容那个依赖包 2.降低 ...