ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chandler <a...@chandlerfamily.org.uk>
Subject GroupBy with simple properties
Date Sat, 18 Feb 2006 18:13:28 GMT

I have a simple class 

public class User {
	private String name;
	private List<String> roles;
//getters and setters

and want to populate  a list of these it with the equally simple query

SELECT name,role FROM users LEFT JOIN roles USING (name)

I want to have some form of result map like this.

	<resultMap id="full-user" class="user" groupBy="name" >
		<result property="name" column="name"/>
		<result property="roles" resultMap="User.role" />
	<resultMap id="role" class="string">
		<result property=? column="role" />

How do you define the property for the role column ?

It would be easy if the my roles List was something more complex than 
List<String>, but I can't find any indication in the docs of how to deal with 
this simple case

Alan Chandler
Open Source. It's the difference between trust and antitrust.

View raw message