From the hibernate reference:
Quote:
6.1.10. many-to-one
...
(12) lazy (optional - defaults to proxy): By default, single point associations are proxied. lazy="true" specifies that the property should be fetched lazily when the instance variable is first accessed (requires build-time bytecode instrumentation). lazy="false" specifies that the association will always be eagerly fetched.
If I understand correctly, lazy="true" should still specify lazy fetching, just using bytecode instrumentation rather than proxies. It still shouldn't hit the database.
Also, having "true","false",and "proxy" options is more than a little confusing!
I am now having a similar problem where a collection is being fetched along with the parent.
I have a bidirectional (many-to-many) association, with each end (supposedly) defaulting to lazy (I have also tried setting lazy=true).
doing a "from child" causes a select on the association table for each child returned! Surely this should happen on a per-child basis, when the collection is accessed?
Thanks for your help[/quote]