table name as parameter

2010-02-08 Thread Tom Carchrae
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

Re: table name as parameter

2010-02-08 Thread Tom Carchrae
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

Re: table name as parameter

2010-02-08 Thread Tom Carchrae
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

Re: table name as parameter

2010-02-08 Thread Tom Carchrae
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:

Re: table name as parameter

2010-02-08 Thread Tom Carchrae
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

iBatis 3.0 minimal complete example

2010-02-01 Thread Tom Carchrae
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.