Hi,
I'm trying to work with custom PropertyAccessor. But I encountered a behavior that I don't quite understand. I'll appreciate if anybody can explain to me:
I have a class C with a list containing a couple of values that I want to store. While the value are stored vertically in memory(in a list) I would like to put them horizontally in the database, i.e. each value in the list will goto a separate column.
I implemented the PropertyAccessor, Setter and Getter, and put the class of the PropertyAccessor in the /hibernate-mapping/class/property/@access attribute:
<property
name="buffer"
column="BUFFER"
access="CustomParameterAccessor"/>
While loading the mapping file, hibernate complains about the property "BUFFER" was not found in the class, which is true, because BUFFER is one of the value stored in the list.
I add a getBuffer() method in the class every thing went smooth. I tried to save un instance of the class to see whether the CustomPropertyAccessor is used and IT IS.
What I don't understand is: why the getBuffer() method is required?
Thanks
|