Quantcast

select using annotation and dynamic table name

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

select using annotation and dynamic table name

oruchovets
Hi ,
I want to use mybatis with annotations.
In my use case table name can dynamically changed.(I need a way to
pass table name as parameters).
I am looking for example how can I select from table using mybatis +
annotations + dynamic table name.

Oleg










Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: select using annotation and dynamic table name

Nathan Maves
no different then with XML.  You need to pass the table name in as a
parameter.  The only trick is that the table name is not a valid spot
for a JDBC parameter so you need to use the MyBatis string
substitution with ${tableName} instead of #{tableName}

On Wed, Apr 4, 2012 at 4:55 AM, oruchovets <[hidden email]> wrote:

> Hi ,
> I want to use mybatis with annotations.
> In my use case table name can dynamically changed.(I need a way to
> pass table name as parameters).
> I am looking for example how can I select from table using mybatis +
> annotations + dynamic table name.
>
> Oleg
>
>
>
>
>
>
>
>
>
>
Loading...