玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal
2017-08-01 21:52
537 查看
近期用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;
这个错误是由实体类引起的。我一開始是这样写的:
@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
- 玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- Repeated column in mapping for entity: .... should be mapped with insert="false" update="false"
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- Repeated column in mapping for entity: XXpojo column: xx (should be mapped with insert="false" upda
- JPA-hibernate注解之 should be mapped with insert="false" update="false"
- hibernate column should be mapped with insert="false" update="false" 错误原因
- column: xxxxxx_ID (should be mapped with insert="false" update="false")
- should be mapped with insert="false" update="false"
- 出现should be mapped with insert="false" update="false"的解决方法
- should be mapped with insert="false" update="false"
- should be mapped with insert="false" update="false"
- should be mapped with insert="false" update="false"的解决方法 和对象产生默认值的解决方法
- Hibernate BeanCreationException 异常错误(should be mapped with insert="false" update="false")
- hibernate一多一关联配置出错org.hibernate.MappingException:should be mapped with insert="false"update="false
- msg_cp (should be mapped with insert="false" update="false")