This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In my application i have two tables PRIMARY_TABLE, SECOND_TABLE.
PRIMARY_TABLE has a foreign key of SECOND_TABLE which has a one to many mapping.
For a single transaction it will have 15 child records, so for a single transaction i have to create 15 + 1 mapping objects in the memory. Is there any alternative approach available which will give all the child records for a single transaction in a single object itself.
Please let me know if have any clarification on what i discussed.
The Lazy Fetching or Automatic Collection Fetching of Hibernate ensures that the collection (Child records) are fetched only when they are used. That should keep you from bothering about the number of collections as you may not use all the relations in a single situation.