should be mapped with insert="false" update="false" 解决办法
来源:互联网 发布:2016中国服装出口数据 编辑:程序博客网 时间:2024/06/06 04:29
Hibernate 异常:should be mapped with insert="false" update="false"
此异常出现情况
<property name="mobile" column="mobile" type="string" not-null="false" length="32"/>
<many-to-one name="mpuser" column="mobile" property-ref="mobile" class="MpUser" fetch="select" lazy="false"/>
解决思路:
此处可以看到有两个属性(“mobile”,“mpuser”)去映射了同一个字段“mobile”。这时对于hibernate来说就是让两个属性去操作一个字段,所以这是行不通的,必须一对一修改。那么我们就必须告诉hibernate,哪一个属性不参与对字段的操作。
解决方法:
在属性中加上( update="false" insert="false")。
如:
<property name="mobile" column="mobile" type="string" not-null="false" length="32" />
<many-to-one name="mpuser" column="mobile" property-ref="mobile" class="MpUser" fetch="select" lazy="false" update="false" insert="false"/>
此异常出现情况
<property name="mobile" column="mobile" type="string" not-null="false" length="32"/>
<many-to-one name="mpuser" column="mobile" property-ref="mobile" class="MpUser" fetch="select" lazy="false"/>
解决思路:
此处可以看到有两个属性(“mobile”,“mpuser”)去映射了同一个字段“mobile”。这时对于hibernate来说就是让两个属性去操作一个字段,所以这是行不通的,必须一对一修改。那么我们就必须告诉hibernate,哪一个属性不参与对字段的操作。
解决方法:
在属性中加上( update="false" insert="false")。
如:
<property name="mobile" column="mobile" type="string" not-null="false" length="32" />
<many-to-one name="mpuser" column="mobile" property-ref="mobile" class="MpUser" fetch="select" lazy="false" update="false" insert="false"/>
0 0
- 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"
- should be mapped with insert="false" update="false"
- should be mapped with insert="false" update="false" 解决办法
- Hibernate中should be mapped with insert="false" update="false"错误
- Hibernate BeanCreationException 异常错误(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")
- column: xxxxxx_ID (should be mapped with insert="false" update="false")
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- hibernate column 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")
- hibernate映射文件出现should be mapped with insert="false" update="false"
- Java中的枚举详解
- 网络请求错误状态码
- stl学习(二)集合 set 的使用
- windows下git服务器搭建及常见问题
- Android-ProductFavorl 多变种多渠道打包
- should be mapped with insert="false" update="false" 解决办法
- js判断访问是电脑,安卓,苹果手机
- github ssh key
- l线程中 CreateEvent 和 SetEvent及WaitForSingleObject的两种用法
- ZCMU1551
- Linux+AS Android源码apk的Robotium自动化测试
- html中的<label>标签有什么用?
- Android之listview下拉刷新
- (LeetCode)String to Integer (atoi) --- ascii 转换为 整数