Hibernate hibernate.max_fetch_depth属性:设置抓取深度

  • 内容
  • 评论
  • 相关

hibernate.max_fetch_depth 属性用于为单向关联(一对一或多对一)的外连接抓取(Outer Join Fetch)树设置最大深度。

语法:

hibernate.max_fetch_depth=属性值

采用Java属性文件格式的配置文件时,指定hibernate.max_fetch_depth属性。

hibernate.max_fetch_depth 属性的属性值为单向关联的外连接抓取树的最大深度。值为0意味着关闭默认的外连接抓取。建议在 0~3 之间取值。

示例

采用 XML 格式的配置文件连接数据库时,设置单向关联的外连接抓取树的最大深度为 1,关键代码如下:

<property name="hibernate.max_fetch_depth">
  1
</property>

采用 Java 属性文件格式的配置文件连接数据库时,设置单向关联的外连接抓取树的最大深度为 1,关键代码如下:

hibernate.max_fetch_depth=1

本文标题:Hibernate hibernate.max_fetch_depth属性:设置抓取深度

本文地址:http://www.hosteonscn.com/6525.html

评论

0条评论

发表评论

邮箱地址不会被公开。 必填项已用*标注