`
wangqiang6028
  • 浏览: 86016 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论
阅读更多
出现错误提示:
Repeated column in mapping for entity
Repeated column in mapping for entity: CountSet column: SETID (should be mapped with insert="false" update="false")


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

例如:
    <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" />
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics