the attribute foo is of type int and your example would set foo as a string. I need 
foo to remian an int but have getters and setters that translate string to int.

public String getFoo(){
        return Integer.toString(this.foo);
}

public void setFoo(String num){
        this.foo = Integer.parseInt(num);
}

I am making sense or just overlooking an obvious?

-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 3:11 PM
To: Castor-User (E-mail)
Subject: Re: [castor-user] mapping methods question




Hi Bryan,

Maybe I'm missing the point here, but just specify the get-method and
set-method attributes on the <field> element:

eg:

<field name="foo" type="string" get-method="getFooAsString"
set-method="setFooAsString"/>

--Keith


Bryan LaPlante wrote:
> 
> Is there currently any way to map overloaded or convenience methods from the mapping 
> file. I have some classes that take int attributes and I want to provided the 
> overloaded methods for converting a string to an int. I can hard code them in the 
> generated classes but the next time the database changes I will have to hand code 
> them again after regenerating the model.
> 
> Bryan LaPlante
> 
>   ------------------------------------------------------------------------
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to