|
Hi all,
Basically i have two classes - say User and SupplementaryUserInfo with many-to-one association from first to second and no lazy fetching. When they are loaded by Session's get method supplied with User's Id, hibernate issues "User left join SupplementaryUserInfo" query as it is seen from logs; the problem is that if there was no SupplementaryUserInfo row for this User, hibernate issues second query to SupplementaryUserInfo table apparently trying to load it again and only then populates the reference to it from User with null. It is very very unlikely that corresponding row will appear in such a short time between two queries. I even believe that such behavior is useless in almost all situations. I wonder if it is possible to supress second query and to do the job just with one. Hibernate version 3.1. Thanks in advance!
|