ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Schall (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Created: (IBATISNET-274) Allow Multiple Resultset Queries to be appended to different lists
Date Tue, 24 Jun 2008 21:24:45 GMT
Allow Multiple Resultset Queries to be appended to different lists

                 Key: IBATISNET-274
                 URL: https://issues.apache.org/jira/browse/IBATISNET-274
             Project: iBatis for .NET
          Issue Type: Improvement
    Affects Versions: DataMapper 1.6.1
            Reporter: Michael Schall
            Assignee: Gilles Bayon

Currently if I have a query that returns multiple resultsets, each object returned is added
to a single ArrayList.  

<select id="GetMultipleResultMap" resultMap="account,category">
select * from accounts
select * from categories

IList list = sqlMap.QueryForList("GetMultipleResultMap", null);

This will return a single list with n+m objects in it (n customers + m categories).  

I would like a way to get a list of lists. The returned object would be a list with 2 objects
in it (list of n Customers, list of m categories).  Which would allow for the following code.

IList list = sqlMap.QueryForList("GetMultipleResultMap", null);
IList<Account> accountList = (IList<Account>) list[0];
IList<Category> categoryList = (IList<Category>) list[1];

In order to keep backwards compatibility we would need new syntax in the resultMap attribute,
possibly the following:

<select id="GetMultipleResultMap" resultMap="account[],category[]">
select * from accounts
select * from categories

Also notice I would like the inner lists to be generic lists if possible.  We can create the
correct generic list type from the resultMap types.

I posted a "quick and dirty" patch that breaks backwards compatibility on the mailing list
that shows what I'm thinking.

I would be willing to code the change and submit the patch if this is something you think
is worth while.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message