ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: More complex example of a queryForMap call
Date Thu, 04 Aug 2005 19:00:59 GMT
I would hope it is that simple but that leads me to ask about the  
last parameter of the

queryForMap(String statementName, Object parameterObject, String  
keyProperty, String valueProperty);


When using it with your below example would

queryForMap("studentStatement", null, "id", "fname");

return a Map of

1 - Niels
2 - Nathan

On Aug 4, 2005, at 12:29 PM, Niels Beekman wrote:

> I would say:
>
> <select id="studentStatement" resultClass="Student">
>   SELECT id, fname, lname
>   FROM students
> </select>
>
> queryForMap("studentStatement", null, "id");
>
> this would result in for example:
>
> 1 - Student1
> 2 - Student2
>
> Or is this too simpleminded?
>
> Niels
>
> -----Original Message-----
> From: Nathan Maves [mailto:Nathan.Maves@Sun.COM]
> Sent: donderdag 4 augustus 2005 18:09
> To: user-java@ibatis.apache.org
> Subject: More complex example of a queryForMap call
>
> Given a student table....
>
> id,fname,lname....
>
>
> how would you make the call to return a Map of Students keys on the
> studentId?
>
> I think the manual is a bit confusing and I am going to create a wiki
> on the topic.
>
> Nathan
>
>


Mime
View raw message