You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Graham Stewart <gr...@graha.ms> on 2008/01/26 04:06:37 UTC

Plural Tables Names

This seems like it would be an FAQ, but I can't find the answer to it anywhere.

I have a database where the table names are all plural, but I'd really
prefer that my object names were not.

Is there any way to have Torque create an class called "SiteUser" to
represent the table site_users.

thanks,
Graham

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Plural Tables Names

Posted by Graham Stewart <gr...@graha.ms>.
Thanks,

I might try to patch the generator to add a singularize option to
defaultJavaNamingMethod, it seems like a reasonable thing to do,
although I'm not sure how to implement it in a language-independent
manner.

Graham

On Jan 28, 2008 1:29 AM, Hidde Boonstra [Us Media]
<hi...@usmedia.nl> wrote:
> Hi Graham,
>
> you can specify the java name of your table in the schema xml. You can
> specify it using the javaName attribute on the table element. See:
>
> http://db.apache.org/torque/releases/torque-3.3/generator/schema-reference.html
>
> Kind regards,
>
>
> Graham Stewart wrote:
> > This seems like it would be an FAQ, but I can't find the answer to it anywhere.
> >
> > I have a database where the table names are all plural, but I'd really
> > prefer that my object names were not.
> >
> > Is there any way to have Torque create an class called "SiteUser" to
> > represent the table site_users.
>
> --
> Hidde Boonstra
> Us Media B.V.
> Stadhouderskade 115
> 1073 AX Amsterdam
>
> t: 020 428 68 68
> f: 020 470 69 05
> www.usmedia.nl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Plural Tables Names

Posted by "Hidde Boonstra [Us Media]" <hi...@usmedia.nl>.
Hi Graham,

you can specify the java name of your table in the schema xml. You can 
specify it using the javaName attribute on the table element. See:

http://db.apache.org/torque/releases/torque-3.3/generator/schema-reference.html

Kind regards,

Graham Stewart wrote:
> This seems like it would be an FAQ, but I can't find the answer to it anywhere.
> 
> I have a database where the table names are all plural, but I'd really
> prefer that my object names were not.
> 
> Is there any way to have Torque create an class called "SiteUser" to
> represent the table site_users.

-- 
Hidde Boonstra
Us Media B.V.
Stadhouderskade 115
1073 AX Amsterdam

t: 020 428 68 68
f: 020 470 69 05
www.usmedia.nl

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org