Hi,
I have a class Hierarchy, lets call A to the father, and a1, a2, a3... to its children (mapped with one-table-per-class strategy). And I have a class B which has a foreign key (many-to-one) to a1.
Initially, a1, a2, a3... were didn't belong to an hierarchy and everything worked fine. When I turned these classes in an extension for A, I got the following error:
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of B.?
I tried to comment the foreign key B->a1 attribute, and I got a runtime error in another relation many-to-one to a class A children.
I then tried to change B java class code, and changed the type of the foreign key attribute from a1 to A, and it worked.
It seems that there is some kind of bug in many-to-one relations in which the target is an hierarchy class (not the root).
Another thing: I tried do disable reflection optimizer, but it didn't work. I added the following line to my hibernate.cfg.xml:
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
I would like to ask for your assistance.
Thanks,
Joao Rangel
|