You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Benjamin Klatt <be...@bar54.de> on 2009/07/15 13:44:20 UTC

Ibator: Generate table name as prefix for columns

Hi there, 

 

does anyone know a solution to generate the column name in the base list
prefixed with the name of the table?

I am extending the SQL  files with my own statements and need to prevent
ambiguous columns when joining other tables in the extended map files.

 

So I would like to manipulate the content of the

<sql id="Base_Column_List">

Tags.

 

I know I can do this with a plug-in, but if there is a way I would love to
save this effort ;)

 

Thanks in advance.

Benjamin 

 


AW: Ibator: Generate table name as prefix for columns

Posted by Benjamin Klatt <be...@bar54.de>.
Hi Iwao,

thanks, this solved the challenge.

Definign the alias (even with the same name as the table) changed the
columns to be fully qualified.
The generated data model stayed with the originial Column names. Perfect!
The only downgrade is, that the alias prefixing results in long names. (i.e.
longtablename_longcolumnname  instead of longcolumnname)
But that's no problem so far.

Thanks again and all the best
Benjamin


-----Ursprüngliche Nachricht-----
Von: Iwao AVE! [mailto:harawata@gmail.com] 
Gesendet: Mittwoch, 15. Juli 2009 14:51
An: user-java@ibatis.apache.org
Betreff: Re: Ibator: Generate table name as prefix for columns

Hi Benjamin,

Try specifying the 'alias' attribute of the <table> element.
http://ibatis.apache.org/docs/tools/ibator/configreference/table.html

Regards,
Iwao

on 09.7.15 8:44 PM Benjamin Klatt said the following:
> Hi there,
>
> does anyone know a solution to generate the column name in the base list
> prefixed with the name of the table?
>
> I am extending the SQL  files with my own statements and need to prevent
> ambiguous columns when joining other tables in the extended map files.
>
> So I would like to manipulate the content of the
>
> <sql id="Base_Column_List">
>
> Tags.
>
> I know I can do this with a plug-in, but if there is a way I would love
> to save this effort ;)
>
> Thanks in advance.
>
> Benjamin

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


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


Re: Ibator: Generate table name as prefix for columns

Posted by Iwao AVE! <ha...@gmail.com>.
Hi Benjamin,

Try specifying the 'alias' attribute of the <table> element.
http://ibatis.apache.org/docs/tools/ibator/configreference/table.html

Regards,
Iwao

on 09.7.15 8:44 PM Benjamin Klatt said the following:
> Hi there,
>
> does anyone know a solution to generate the column name in the base list
> prefixed with the name of the table?
>
> I am extending the SQL  files with my own statements and need to prevent
> ambiguous columns when joining other tables in the extended map files.
>
> So I would like to manipulate the content of the
>
> <sql id="Base_Column_List">
>
> Tags.
>
> I know I can do this with a plug-in, but if there is a way I would love
> to save this effort ;)
>
> Thanks in advance.
>
> Benjamin

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