>> >You can do that in the XML Mapping file...
>> >
>> >add reference="true" to the field mapping as such:
>> >
>> ><field name="Level" type="test.Level">
>> > <bind-xml name="lid" node="attribute" reference="true"/>
>> ></field>
>> >
>> >and make sure you mark the identity field for the test.Level class
>> >mapping:
>> >
>> ><class name="test.Level" ... identity="Id"/>
>>
>> That didn't work. I get a mapping exception
>> "No field descriptor found for the identity field ID in class test.Level"
>> BTW, the getID method returns an Integer not an int.
>
>
>Well...since the method is called getID...change it to the following:
>
><class name="test.Level" ... identity="ID"/>
Yes. Of course. That's what I did. My mapping looks like
<field name="Level" type="test.Level">
<bind-xml name="lid" node="attribute" reference="true"/>
</field>
<class name="test.Level" verify-constructable="false" identity="ID"/>
>> >> There are no sample files on how to write the FieldHandler. I have gone through
>> >> the archives and got
very
>> >> confused. Is there any sample code for FieldHandlers somewhere.
>> >
>> >There should be samples in the archives...but I'll place one up on the
>> >FTP server later when I get some time.
>>
>> Which archives? I couldn't find anything on the site.
>
>There are a few archives listed on this page:
>
>http://castor.exolab.org/lists.html
I have already been through the message archives. I found snippets of code, but no
full samples. So I was
able to create a fieldhandler redefining getValue() and setValue(), but didn't know
what the other methods
did. The javadocs are not very clear.
Thanks
Regards
Milind
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev