Hello,
Warning: I am basically a hibernate "newbie", although I have considerable experience with O/R mapping. Hopefully I will explain my issue clearly and completely.....
I have defined a custom UserType and I am using it as a property within another object which has a corresponding mapping file. This is the first time I attempted to do this in Hibernate.
ALMOST everything is working fine. I can write the property to the database column when I persist the parent object. When a read is performed on the parent object, I can see my UserType property in the result set and the setter method for the property gets executed properly. That is, it gets executed properly when I define the property in the mapping file as one of the first <property> elements. By "properly", I mean that the parameter for the setter method contains the Object that I want to set.
The problem I am experiencing is when this <property> element is placed as the last <property> element in the mapping file for the parent object. When I do this, the value of the parameter in the setter method is always NULL. If I simply move the <property> so it is the first <property> of the parent object, I have no problems.
If you have any idea why this is happening, I would greatly appreciate your explanation. Here is the <property> element in question:
<property name="state" column="STATE" type="com.foo.hibernate.mapping.ProjectSampleStateUserType" />
|