Repeated column in mapping for entity

[size=large]出现错误提示:[/size]
[size=large]Repeated column in mapping for entity
Repeated column in mapping for entity: CountSet column: SETID (should be mapped with insert="false" update="false")[/size]

[size=large]出错原因:[/size]
[size=medium]1、两个属性同时对应了数据库的一列 或者有重复
2、数据库的字段值和javaBean中的属性类型不统一。对于基本类型,要用wrapper类型而不是primitive类型。2、hibernate的配置文件xxx.hbm.xml中的属性配置不为空,而数据库中的字段却为空。3.两个字段对应同一列,如:password 和repassword同时对应数据库表中的password一列,同时update和insert都设为true。[/size]
例如:

<property name="password"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="password"
length = "32" />

<property name="repassword"
type="java.lang.String"
update="false"
insert="false"
access="property"
column="password"
length = "32" />
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值