rkc wrote:
I appreciate your response. It was a good food for thought. But, Unfortunately, it does not resolves my problem.
The design is such that, I am searching for all accounts in my application. Now, each account has a "createdBy" field, which is basically references to User name.
When I put no search criteria, then due to many-to-one association in the above code example, each account record fetch will associate a user record with it. I desire do something that fetches user record only once for all the account records having reference to that user. No matter, if any other method of association mapping requires to be used in the hbm file.
This is basically a performance issue.
hi,
you could try implementing a second level cache strategy somehow although I'm not really sure how this can be applied to a many-to-one association.
cheers