Hi,
We have an hierarchy of entities:
Parent => A,B,C
Class A is potentially very large and dynamic population. Caching it would be very memory consuming and un-efficient.
On the other hand, B and C are really good candidates for caching as they are rarely modified and are recently read.
The mappings of A,B,C are defined as joined-subclasses of Parent.
How can I define the second level caching on the subclasses?
The dtd does not allow defining the <cache> element within the <joined-subclass> element. Only at the <class> level, and as I said I do not want all the subclasses to be cached.
p.s. EHCache is used as the second-level caching provider.
Thanks,
Revital.
|