How do you programmatically turn off eager fetching with hibernate?

后端 未结 2 1207
迷失自我
迷失自我 2021-01-18 04:25

I have in my mapping an association to an eagerly loaded collection (lazy=\"false\" fetch=\"subselect\"). How can I turn that off programmatically with Hibernate when I do a

2条回答
  •  悲哀的现实
    2021-01-18 05:17

    In fact, it is supposed to be the other way around. You turn it off in the mapping, and activate it on specific use cases with a "fetch" in the query.

    That's the way the Hibernate team sees it. There is no way in Hibernate to create a request that specifies "no-fetch" for a property...

提交回复
热议问题