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:[EMAIL PROTECTED] 
Sent: donderdag 4 augustus 2005 18:09
To: [email protected]
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

Reply via email to