I have code similar to the code in section 6.1.5 of Java Persistence with Hibernate. This is the case where an owning class (let's call this Class1) uses a Map to store many instances of a second class (let's call this Class2). The objects of both classes are being persisted as I can see the data in Oracle using an external program. I can fetch the Class1 objects and their attributes are set correctly.
But when I access each Class1 map and drill down to the contents of Class2 objects, the Class2 attributes are not set. The keys to the maps are set correctly. The size of the maps are set correctly. I read the SQL created by Hibernate and the SQL looks right. It would seem that Hibernate is working only to a point.
I've tried batch-size="10" and fetch="subselect". The SQL looks right, but the attributes in Class2 are not there.
Any help would be appreciated. Thanks.
|