Forums Register Login

lazy loading of subclass in hibernate

+Pie Number of slices to send: Send
I have a super class Disc and two child classes : AudioDisc and VideoDisc. I am trying both the strategy Union subclass and join Subclass but i could not find any way to lazy load the subClass.

My classes are something like this :




Now when i am calling
List<Reservation>reservations = query.list();
in main()
and calling getDiscs() overs each reservation object the sql is fired to join or union (based on the strategy defined in mapping) to fetch the data from DB. can we set the lazy loading of these subclass ?? i mean to say that the sql corresponding to that subclass should not be fired untill we have not accessed the property of the class . If it is not possible then what is the use of providing the lazy attribute in the metadata definition of joinsubclass or unionsubclass (which holds the default value "false").

Any help is appreciated .

Thanks.
Yes, my master! Here is the tiny ad you asked for:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1407 times.
Similar Threads
polymormsim related demos
How to set ID and Value for a JCombobox
primitive question
Can't able to insert row in table per concrete class strategy .
Encapsulation ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:20:23.