开发者

Is it possible to configure NHibernate at runtime setting the loading-technique (eager/lazy) for a collection

开发者 https://www.devze.com 2022-12-20 15:16 出处:网络
Ya 开发者_开发知识库is this possible :) ?You can change the fetch mode per query dynamically.

Ya 开发者_开发知识库is this possible :) ?


You can change the fetch mode per query dynamically.

IList cats = sess.CreateCriteria(typeof(Cat))
    .Add( Expression.Like("Name", "Fritz%") )
    .SetFetchMode("Mate", FetchMode.Eager)
    .SetFetchMode("Kittens", FetchMode.Eager)
    .List();

See section 12.5 of the documentation.


For queries - yes :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号