ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: query to get records columns as List
Date Mon, 16 May 2005 02:04:52 GMT
You can't map columns to list elements...and that's probably a good thing. 
It doesn't really make sense semantically.

What you can do (which is significantly more useful) is map your results to 
a Map. That is, your employee table and its 5 columns will be represented as 
a Map (column1="whatever", column2="something"...etc.). You can also 
retrieve a list of these Maps, each list element will be one map that 
represents one row (i.e. one employee).

If you REALLY want a list of the columns, you can use map.values() to get 
the set of values and add the entire set to a list. 


On 5/13/05, uap001@yahoo.com <uap001@yahoo.com> wrote:
> Hello,
> I am new to ibatis and want to know how I can do this.
> I have a table "employee" and it has 5 columns. I want
> to query the "employee" table and I want the result
> either as a List of String[] (where the String[] has
> column1,column2,column3,column4,column5 values) or as
> a List of List (where the inner list will have the 5
> columns).
> thanks
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

View raw message