ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "meindert" <meind...@eduflex.com>
Subject RE: queryForObject/queryForList where is the documentation for the "Object parameter"?
Date Thu, 02 Jul 2009 08:06:53 GMT
Hi Fred,

 

The XML parameter object is quite interesting, it doesn't look like ibatis
can handle a 'XML object' the same way as it can return a XML string object;

http://www.mail-archive.com/user-java@ibatis.apache.org/msg13636 

 

Just a note, the XML returned from ibatis is quite limited, I personally use
XStream to serialize java beans  to XML (or JSON) and back to java beans

 

meindert

From: Fred Janon [mailto:fjanon@gmail.com] 
Sent: 02 July 2009 09:53 AM
To: user-java@ibatis.apache.org
Subject: Re: queryForObject/queryForList where is the documentation for the
"Object parameter"?

 

Thanks. It seems though that there are more facets to it, like XML which is
particularly interesting for RESTful services.

Fred



On Thu, Jul 2, 2009 at 14:49, meindert <meindert@eduflex.com> wrote:

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:fjanon@gmail.com] 
Sent: 02 July 2009 05:59 AM
To: user-java@ibatis.apache.org
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

 

Checked by AVG - www.avg.com
Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 07/01/09
18:07:00


Mime
View raw message