In the finder query,
Hibernate returns PizzaOrder objects with a “proxy” for
the associated PizzaSize and a “collection wrapper” for the Toppings
collection
As long as the runtime
system is still alive, first access to such an association results in a DB hit for the actual
data
First access after the
runtime is shut down results in an exception:
it’s too late to be lazy
This default strategy can
be overridden in the mapping file: lazy=“false” for
PizzaOrder’s Toppings, for example.
EDM: no implicit database
access, so need to code what you need