Repeated column in mapping for entity
2010-03-29 17:45
323 查看
1、
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: com.xindeco.myregister.pojo.MyRegisterInfo column: password (should be mapped with insert="false" update="false")
百分百配置文件 属性 错误
<property name="pensionNumber" type="string" column="50"></property>
本人 不小心 写成 column 了 应该是 length
出错原因:1、数据库的字段值和javaBean中的属性类型不统一。对于基本类型,要用wrapper类型而不是primitive类型。2、hibernate的配置文件xxx.hbm.xml中的属性配置不为空,而数据库中的字段却为空。3.两个字段对应同一列,如:password 和repassword同时对应数据库表中的password一列,同时update和insert都设为true。
xml文件如下:
<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"
/>
解决的方法:
将repassword的insert和update设为false。
4:.hbm.xml的映射文件出错,具体字段出错,比如长度,或者少写,或者多写
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: com.xindeco.myregister.pojo.MyRegisterInfo column: password (should be mapped with insert="false" update="false")
百分百配置文件 属性 错误
<property name="pensionNumber" type="string" column="50"></property>
本人 不小心 写成 column 了 应该是 length
出错原因:1、数据库的字段值和javaBean中的属性类型不统一。对于基本类型,要用wrapper类型而不是primitive类型。2、hibernate的配置文件xxx.hbm.xml中的属性配置不为空,而数据库中的字段却为空。3.两个字段对应同一列,如:password 和repassword同时对应数据库表中的password一列,同时update和insert都设为true。
xml文件如下:
<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"
/>
解决的方法:
将repassword的insert和update设为false。
4:.hbm.xml的映射文件出错,具体字段出错,比如长度,或者少写,或者多写
相关文章推荐
- 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
- 实体添加重复列错误(Repeated column in mapping for entity)
- 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
- 玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal
- Repeated column in mapping for entity: cn.cnic.qlms.entity.User column: id (should be mapped with in
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- Repeated column in mapping for entity@Column(name = "type_id") private Long typeId = 0L; // //
- 玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal
- Hibernate中的"Repeated column in mapping for entity"异常
- Repeated column in mapping for entity
- caused by org.hibernate.mappingexception repeated column in mapping for entity
- 玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert="false" update="fal
- org.hibernate.MappingException: Repeated column in mapping for entity
- Repeated column in mapping for entity:(should be mapped with insert="false" update="false")
- hibernate文件配置出现Repeated column in mapping for entity的Mapping异常处理
- Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.yyf.entity.Cus