Two things:
I don't see where you are declaring that that class is to be cached.
(Maybe you have this configured somewhere else) I normally do it on the mapping file like this:
Code:
<class name="com.test.Parent" table=...
<cache usage="read-only"/>
Also, since your class has so many bags attached to it, notice that
collections have to be declared independently in your cache file.
This is a little piece of information that no one bothers to tell you.
For example, if you have a Parent with Child elements, don't do this in your ehcache.xml file:
Code:
<cache name="com.test.Parent" maxElementsInMemory=...
<cache name="com.test.Child" maxElementsInMemory=...
.. but this ...
Code:
<cache name="com.test.Parent" maxElementsInMemory=...
<cache name="com.test.Parent.children" maxElementsInMemory=...
Weird, isn't it? You cache the Child class, but the dependent collection from the Parent object.