> I am brand new to Castor, so please forgive me if this question is too
> basic.
>
> Consider this class;
>
> public class Foo {
> java.net.URL location;
> }
>
> The field is stored in the database as URL_LOC, type varchar. How can I
> map this? The main problem I have is the lack of a no-argument
> constructor in java.net.URL. Do I use a FieldHandler?
> Do FieldHandlers work with JDO? The FieldHandler API is not very well
> documented. Assuming I need a FieldHandler, I have the following
> questions:
>
> 1. For getValue, do I do this?
>
> Object getValue(Object obj) { // obj is URL, return String
> return object.toString();
> }
>
> or this:
>
> Object getValue(Object obj) { // obj is String, return URL
> return new URL(obj.toString());
> }
>
> 2. In setValue(Object obj, Object value), is obj the URL and value the
> String? If so, what can I do, since URL does not have public set methods?
> For resetValue(Object obj), I have the same problem.
>
> 3. For newInstance, I assume I do the following: ???
>
> Object newInstance(Object parent) {
> return new URL(((URL)parent).toString());
> }
>
> Thanks in advance for your help.
>
>
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev