|
Hibernate version:2.x
Name and version of the database you are using:Oracle 9x
I wonder if anybody ever ran into this situation before. I have a many-to-many association that I need to eager fetch. I have second level caching enable using OSCache.
So i set outer-join=true in the <set> element as well as in its (nested) <many-to-many> element. Also set <cache-usage> elements in the class as well as the set.
This works fine first time as hibernate uses a left outer join to fetch the set. But when i hit refresh, I see the n+1 selects for the same query.
I understand that setting cache-usage in the set will cache the associations too for a one-to-many type deal. Is there some way to do this for many to many.
I must mention that my join table is not mapped or modeled as it contains only primary key info on both sides.
Thanks,
Pratik
|