We've got a set of mapping files setup with *no* lazy-instantiation. As noted in the docs, this is the easy way to avoid problems with querying on associated objects after a session has closed and has worked well so far while we're getting the system built and not focused on performance.
Later we are planning to shift everything to lazy-instantiated in our mapping documents and then override that as needed via code. That we know how to do.
But as a quick-fix (before we get our model and code using lazy-instantiation) is there a way to force lazy-instantiation on just a single query? I know you can do it the other way around (force non-lazy behavior when lazy is declared in the maping documents) but I'm uncelar if the reverse is true.
So, without all the preamble, here's the question:
Is it possible to override a non-lazy mapping definition, via code, for a particular query?
Many thanks,
- Gary
Hibernate version:
2.1
Name and version of the database you are using:
MySQL 4.1.8
|