{Hibernate} Outer-join attribute is not simple

xiaoxiao2021-03-06  38

[surroundings]

Hibernate-2.1.7c

JBuilderx

MS SQLServer 2K

[text]

Lazy Attributes As an important parameter for Hibernate's improvement performance ... IM wants to be well known ... Although hibernate2.1. * Does not support the latency load for Property ... but correct and flexible setting xxx- Lazy properties in To-Many, you can have a big improvement in program performance.

Please take a look at the configuration below.

As I wish, this code used for a long time in my procedure, I also thought I thought it was a latency load for the Moderators collection, but when I read Hibernate for my getObject () Methods Output SQL ... I found that I have achieved a big SQL list, there are more than 10

Is the LAZY settings failed? Repeated debugging, view documentation, google ........

Finally, I found the "culprit" after the analysis and output SQL:

Outer-join

In fact, it is very simple.

Outer-join is exactly, Hibernate will separate the N-SQL statements into a SQL submit to the database by table_namea left join table_nameb on (specific syntax by actual DBMS decision), and returns the PO object and the Collection's PO list This is also an optimization measures for Hibernate improvement performance reduction database access .. However, when getting Collection, Outer-Join has caused the Collection and PO objects to be submitted to the query at the same time, which also changed the effect of delayed loading. Multiple test When Outer-join = true, your Lazy property is set to any value, and the Collection will initially load (one-to-one no lazy, there is no need to consider ^ _ ^) Please carefully set out Outer-join = true

转载请注明原文地址:https://www.9cbs.com/read-63635.html

New Post(0)