db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject Re: provide a central place for parsing column names in SQLBuilder
Date Tue, 14 Dec 2004 08:43:11 GMT




Richard Bayet <bayet@enseirb.fr> schrieb am 14.12.2004 08:42:17:

> Henning P. Schmiedehausen wrote:
> >
> >>Just out of curiosity : have you tried what happens if one puts
> >>"schemaname.tablename" as tablename into schema.xml ? That might also
be
> >>interesting for some people.
> >
> >
> > No. Testers welcome.
> >

Just tried it, but fails miserably :-( . Not that I really expected it to
succeed...

> >
> As for Torque Gen 3.1, this might be a bad idea.
> Because the class and packages names will contain this extra dot
character.
> Not very annoying for the packages names : the classes will be tagged as
> in package 'com.yourproject.schemaname' instead of 'com.yourproject',
> but the classes will be named like 'schemaname.yourtable';
>

This is not the problem and can be prevented by using the javaName
attribute in the table description in xxx-schema.xml. There are some
problems in the generation of sql, the generator tries to generate
constaints which are applied on columns like schemaname.columnname and not
schemaname.tablename.columnname. It seems that someone looks for dots
there....

> The technique I used a few month ago, where I add to generate the OM of
> several FrontBase schema (not officially supported : I used the
> InterBase adapter), was :
> 1) modify the Torque runtime to support "really fully qualified
> columnnames", that is "schema.table.column".
> It was quickly done, just looking for every string "table.column"
> splitting (this is made using "indexOf('.')" tests) and adding a test on
> the presence of two dots.

In the latest version in CVS in TORQUE_3_1_BRANCH, there still seem to be a
few places where this is done, and this is the reason why the rutimetest
fails at the moment. As you said, it should not be too difficult to track
these down.

>
> 2) write procedure which consisted in :
>    + prefixing every table name in the schema.xml by
"SCHEMA_MYSCHEMANAME_"
>    + generating the java code
>    + using perl rewriting commands (perl -pi.bak -s ....) to change back
> the table and column names
>    + using a "mass rename" zsh script to change or remove some incorrect
> prefix of the filenames
>
> If anyone is interested, I might post the complete story, and name a few
>   drawbacks...
>
> Regards,
> Richard.
>

Thomas


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


Mime
View raw message