Hibernate fetching strategy - when to use “join” and when to use “select”?

前端 未结 6 2113
栀梦
栀梦 2020-12-22 18:54

Most Hibernate associations support \"fetch\" parameter:

fetch=\"join|select\"

with \"select\" being default value.

How to decide

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 19:25

    fetching="join" If you do fetching="join" it will retrive all the information in a single select statement.

    fetching="select" if you want to paas the second select statement to fetch the associated collection than in that case you will use fetch="select".

    source :Hibernate Fetching Strategies

提交回复
热议问题