|
Hibernate version: 3.1.2
I have an object with an one-to-one association. This one-to-one object have several subclasses using a discriminator value. Some of the subclasses have join table.
When I do a refresh of the first object, I got a ClassCastException because, for some reason, Hibernate tries to set a value from the subclassed object to the one-to-one.
I got the following exception:
19:12:04,631 ERROR BasicPropertyAccessor:94 - IllegalArgumentException in class: br.com.visanet.scu.vo.prsr.PrivateLabelVO, setter method of property: qtMinimaParcela
19:12:04,646 ERROR BasicPropertyAccessor:98 - expected type: java.lang.Integer, actual value: java.lang.Integer
PrivateLabelVO has the property qtMinimaParcela and the setters and getters and the value for both is an Integer.
The problem is that Hibernate tries to set this value to his extend class, which doesn't have this property. I realized that Loader.loadEntity at line 1785 when tries to doQueryAndInitializeNonLazyCollections sends an optionalObject as parameter and this optionalObject points to the extended class and not to its subclass.
Is this right?
Why this problem occurs only at the refreshment?
Thanks in advance.
Luiz.
|