Hi,
>>Now the question is because by Master POJO contains links to all the object does hibernate loads all the objects in the memory irrespective of the query.
It depends on the configuration.
Hibernate is very flexible in terms of fetching associations. We specify,
i) When to fetch. ( initially or later when required )
ii) How to fetch. ( an outer join or select )
Please refer to
http://www.hibernate.org/hib_docs/refer ... mance.html
>>If so what would be the best approach for all the above queries that to be followed in the hibernate.
a difficult question to answer.
It's a good idea to explore different options ( join fetch , select fetch, subselect fetch, batch fetch, lazy fetch ) and pick the one that suits the best.
Hibernate provides us with a lot of options and does what we ask it to do.
Performance is ( to a large extent ) our responsibility.
Hibernate In Action & Java Persistence With Hibernate are both good books.
My apologies if this answer is too vague!
-------------------------------------------
Rate the reply if you find it helpful