-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Custom Property Accessor
PostPosted: Tue Jul 24, 2007 9:25 am 
Newbie

Joined: Tue Jul 24, 2007 9:05 am
Posts: 2
Location: Paris, France
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.