You can only have one input Object. For simple parameters I use a Map
object;
As larry said, the GRD (Get R' Done) approach to do this:
Map<String, Object> param = new HashMap<String, Object>();
param.put("id", yourInt);
param.put("description", yourString);
In you sqlmap you can revere to these parameters like #id# and
#description#, or $id$ and $description$ if you want to do a literary
replacement.
From: Fred Janon [mailto:[email protected]]
Sent: 02 July 2009 05:59 AM
To: [email protected]
Subject: queryForObject/queryForList where is the documentation for the
"Object parameter"?
Sorry for the basic question: how to write a query with mutiple parameters?
I am reading the iBatis in Action book, browsing the distribution, the wiki,
the Javadoc and I can't find documentation or examples for the different
forms of the parameter for queryForObject or queryForList
java.util.List queryForList(java.lang.String id,
java.lang.Object parameterObject,
int skip,
int max)
throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a
number of result objects within a certain range.
The parameter object is generally used to supply the input data for the
WHERE clause parameter(s) of the SELECT statement.
Parameters:
id - The name of the statement to execute.
parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.). <<<
Where in the doc or the book is that described in more details?
How do I pass several parameters to queryForList like for example name,
beginsearchdate, beginlastdate?
I see details for the resultMap, nothing but only exmaples with one input
parameter. I started looking in the code, but it's taking too much time
now...
Thanks
Fred
Checked by AVG - www.avg.com
Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 06/30/09
11:37:00