Lazy Loading in NHibernate

前端 未结 5 1042
不知归路
不知归路 2021-01-19 10:47

If a Customer has many Orders attached to them. How would you lazy load the Orders List using NHibernate.

Is it something that needs to be set up mapping file? any

5条回答
  •  盖世英雄少女心
    2021-01-19 10:57

    Heres a good article:

    http://blogs.chayachronicles.com/sonofnun/archive/2007/03/30/230.aspx

    From the above article:

    The most common is to simply mark the class with the 'lazy="true"' attribute or place 'default-lazy="true"' in the mapping declaration:

    
    

    Or

    
    

提交回复
热议问题