This content has been marked as final.
Show 1 reply
-
1. Re: Effective adding data to lazy collection
jeanluc Jun 4, 2009 5:33 AM (in response to markwigmans)Two options:
- Bags (declared in Java as Collection) do not cause Hibernate to load the collection before a new element is added. If you don't care about the order of the elements, you can use them.
- if you require the order but you don't need the entire list when you add an element, you can write a method (say, addEvent(Event e)) that issues an HQL query to write the event. You don't appear to need to have the events loaded at this time (otherwise you wouldn't have wanted to avoid that).