I have entities with lazy load set to True. If I want to use collections on the client side (Windows Forms) there is a problem with session and lazy loading - I can't get any data from the collections.
OK, one solution is to use FetchMode.Eager on the server side and create custom Load method. I have another idea - I just have to copy my original entity (hbm.xml and class definition) and in this copy I set lazy load to False. It is not a lot of work to do and in the end you have two entities - one with lazy load of collections (used for lists etc.) and another "Big" entity withhout lazy loading, which is useful for rich Win Forms (which i.e. has some entity's basic data on one tab and some tabs with lists of entity's collections).
Do you think this approach is good or will I get into troubles?
|