ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: table name as parameter
Date Mon, 08 Feb 2010 23:17:03 GMT
Well, I wasn't quite right in what I said.  RowBounds is the exception
to the rule - so if you pass more than one parameter in addition to
RowBounds, then you must use the @Param annotation.  In your case, you
don't need to annotate and "value" is the right default.

Jeff Butler


On Mon, Feb 8, 2010 at 5:12 PM, Tom Carchrae <carchrae@gmail.com> wrote:
>
>
>
> Jeff Butler-2 wrote:
>>
>> Look at the @Param annotation.  If you pass more than one parameter to
>> a mapper method, them you must annotate ALL parameters:
>>
>> List<Map> selectAllFromTable(@Param("rowBounds") RowBounds rowBounds,
>> @Param("tableName") String tableName);
>>
>> Whenever I forget to do this, I see errors about NULL values.
>>
>
> This makes sense.  I had wondered what magic it was using to make the
> mapping between the parameter name and the select statement.  (ie, none, or
> as Larry pointed out, 'value' is a default mapping name)
>
> Thanks for the tip. :)
>
> Tom
> --
> View this message in context: http://old.nabble.com/table-name-as-parameter-tp27505213p27507890.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message