在Hibernate中设置更新和插入属性 [英] Setting update and insert property in Hibernate

查看:150
本文介绍了在Hibernate中设置更新和插入属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在hibernate HBM文件中,设置以下属性的目的是什么?

  update =false
insert =false

它们的用途是什么?他们对表演有什么不同?何时使用它们?

/3.6/reference/en-US/html_single/#d0e6525rel =noreferrer>文档:


更新,insert(可选 - 默认为true):指定
映射列应该包含在SQL UPDATE和/或INSERT
语句中。将两者都设置为false允许一个纯粹的派生属性
,其值由映射到
相同列的某个其他属性或触发器或其他应用程序初始化。



In the hibernate HBM file, what is the purpose of setting the following properties?

update = "false"
insert = "false"

What purpose do they serve? What difference do they make to the performance? When should we use them?

解决方案

From the documentation:

update, insert (optional - defaults to true): specifies that the mapped columns should be included in SQL UPDATE and/or INSERT statements. Setting both to false allows a pure "derived" property whose value is initialized from some other property that maps to the same column(s), or by a trigger or other application.

这篇关于在Hibernate中设置更新和插入属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆