posted 11 years ago
Hi,
The version of hibernate is 3.6.10.
To provide further information on this issue. The out of memory was due to hibernate returning hundreds of thousands of rows for my sky subscription list. I checked this by doing a lazy load on my List and checking the list size.
In the H2 database I have only one user account, with only one associated sky subscription.
I changed the sky table to include an auto increment id (which is now pk) and have a unique key of sky_viewing_card_id.
Findings
When my "one to many" mapping in user_account looks like this, it returns hundreds of thousands of skysubscriptions:
However, when I change the list-index column to active, it returns the one association -Great!.
So what I want to understand is
1) why does hibernate do this when it indexs my unique key? <list-index column="sky_viewing_card_id"/>
2) when I change to <list-index column="active"/>, it returns a list count of 2 entries - One is my skysubscription and the other is null.. what does it return a null record?
Thanks for the help, and im wondering if using HQL would be a better option?