I am trying to load a table using a parameter to specify the table name:
select id=selectAllFromTable parameterType=String
resultType=hashmap
select * from #{id}
/select
But it seems iBatis does not like this. Any suggestions on what I am doing
wrong? Is there a better way to
I am trying to load a table using a parameter to specify the table name:
select id=selectAllFromTable parameterType=String
resultType=hashmap
select * from #{id}
/select
select * from ${id}
Thank you for the fast reply. I'm now onto a new error:
ERROR main Slf4jImpl.error
nmaves wrote:
I would double check that you are not sending in null as the table name.
I am passing in a non-null string. But it is definitely a problem caused by
the table name not being mapped correctly.
When i traced down inside the bowels of iBatis, it gobbles my string inside
Larry Meadors wrote:
Try this:
select * from ${value}
Excellent! It works. Thank you so much. I'm guessing it somehow got
confused and thought I was passing it some OGNL.
Tom
--
View this message in context:
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:
ListMap selectAllFromTable(@Param(rowBounds) RowBounds rowBounds,
@Param(tableName) String tableName);
Whenever I forget to do this, I
Hi,
I'm working my way through the 3.0 manual, and am new to iBatis. I wonder
if anyone could be so kind as to post a complete working example. There
seems to be a lot of examples in 2.x land, but not so many using the current
version. So a simple java class, config file, and map file.