[jira] Commented: (IBATIS-28) Support multiple results from Stored Procedures

2005-12-20 Thread John Purcell (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-28?page=comments#action_12360919 ] 

John Purcell commented on IBATIS-28:


I would say this would be a very useful  since a number of databases (MSSQL, 
Sybase, and now even MySQL) support this kind of feature. While I'm less 
concerned on how the resultMaps are assigned in the xml files 
(resultMap="resultMapOne,resultMap2" or a  tag is fine), I think 
that the above suggestions to the API are a bit kludgy at best since they would 
envolve a huge amount of casting (at least in 1.4.x era code). 

Why not use what's at the heart of the API anyway: the RowHandler

I'd say change queryWithRowHandler(String statementName, Object 
parameterOjbect, RowHandler rowHandler) to
queryWithRowHandler(String statementName, Object parameterOjbect, RowHandler[] 
rowHandler), where each entry in the rowHandler array corresponds with each 
resultSet. DefaultRowHandler could be made public (as in moved to 
com.ibatis.sqlmap.client.event) and extended to have a getObject() method to 
get the first entry in the list (which is what queryForObject does anyway) and 
other RowHandlers could be added (such as a MapRowHandler).

The above would get around some thornier aspects of using multiple resultsets. 
For instance, say you had a proc/select statement that returned three result 
sets and you wanted them to be mapped to a list, an object, and a map. The 
example code would be the following:


DefaultRowHandler listHandler = new DefaultRowHandler();
DefaultRowHandler objectHandler = new DefaultRowHandler();
MapRowHandler mapHandler = new MapHandler("ID"); // where "ID" is the column in 
the resultSet that corresponds to the map key

sqlMapClient.queryWithRowHandler("myProcStatemet", null, RowHandler[] { 
listHandler, objectHandler, mapHandler });

List myList = listHandler.getList();
Object myObject = objectHandler.getObject();
Map myMap = mapHandler.getMap();


It would, of course, be up to the user to make sure that the order of the 
RowHandlers are correct. queryWithRowHandler(String statementName, Object 
parameterOjbect, RowHandler rowHandler)  would internally call 
queryWithRowHandler(statementName, parameterOjbect, RowHandler[] { rowHandler}) 
and be deprecated. 

Thoughts?


> Support multiple results from Stored Procedures
> ---
>
>  Key: IBATIS-28
>  URL: http://issues.apache.org/jira/browse/IBATIS-28
>  Project: iBatis for Java
> Type: Improvement
>   Components: SQL Maps
> Versions: 2.0.8
>  Environment: All
> Reporter: Christopher John Gores

>
> It seems there is no support for multiple results being returned by a stored 
> procedure (i.e. statement.getMoreResults()).  Unfortunately, that's a 
> showstopper for my new project that needs to call legacy procedures.
> Suggested solution:  Allow a statement to use an ordered collection of 
> resultMaps, either by creating a new  tag, allowing  
> to nest, or by allowing the statement's resultMap attribute to hold a 
> comma-separated list of resultMaps.  The resulting object would have to be a 
> List of mapped result objects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATIS-28) Support multiple results from Stored Procedures

2006-06-05 Thread Brandon Goodin (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-28?page=comments#action_12414911 ] 

Brandon Goodin commented on IBATIS-28:
--

HSQLDB does not support getMoreResults in a way we can use to test with. I have 
introduced derby (derby.jar) and setup a DerbySqlMapConfig.properties for it. 
Next step is to setup the full test scenario(s).

> Support multiple results from Stored Procedures
> ---
>
>  Key: IBATIS-28
>  URL: http://issues.apache.org/jira/browse/IBATIS-28
>  Project: iBatis for Java
> Type: Improvement

>   Components: SQL Maps
> Versions: 2.0.8
>  Environment: All
> Reporter: Christopher John Gores
> Assignee: Brandon Goodin

>
> It seems there is no support for multiple results being returned by a stored 
> procedure (i.e. statement.getMoreResults()).  Unfortunately, that's a 
> showstopper for my new project that needs to call legacy procedures.
> Suggested solution:  Allow a statement to use an ordered collection of 
> resultMaps, either by creating a new  tag, allowing  
> to nest, or by allowing the statement's resultMap attribute to hold a 
> comma-separated list of resultMaps.  The resulting object would have to be a 
> List of mapped result objects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATIS-28) Support multiple results from Stored Procedures

2006-06-10 Thread Brandon Goodin (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-28?page=comments#action_12415726 ] 

Brandon Goodin commented on IBATIS-28:
--

- added a devbin directory containing files to start derby command line to 
manage derby test databse 
- added working test that returns multiple resultsets
- added new DerbySqlMapConfig.xml, DerbyProc.xml
- added derby tools jar for derby db management
- updated MultiResultSetTest to create multiple resultset return scenario
- added test/com/ibatis/sqlmap/proc/DerbyProcs class that is the procedure used 
by derby. derby uses java for it's procedures.
- added test/scripts/derby-proc-init.sql

> Support multiple results from Stored Procedures
> ---
>
>  Key: IBATIS-28
>  URL: http://issues.apache.org/jira/browse/IBATIS-28
>  Project: iBatis for Java
> Type: Improvement

>   Components: SQL Maps
> Versions: 2.0.8
>  Environment: All
> Reporter: Christopher John Gores
> Assignee: Brandon Goodin

>
> It seems there is no support for multiple results being returned by a stored 
> procedure (i.e. statement.getMoreResults()).  Unfortunately, that's a 
> showstopper for my new project that needs to call legacy procedures.
> Suggested solution:  Allow a statement to use an ordered collection of 
> resultMaps, either by creating a new  tag, allowing  
> to nest, or by allowing the statement's resultMap attribute to hold a 
> comma-separated list of resultMaps.  The resulting object would have to be a 
> List of mapped result objects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATIS-28) Support multiple results from Stored Procedures

2006-06-21 Thread John Purcell (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-28?page=comments#action_12417187 ] 

John Purcell commented on IBATIS-28:


MySQL 5.x also supports getMoreResults too. Which way did you decided to 
support this? 

> Support multiple results from Stored Procedures
> ---
>
>  Key: IBATIS-28
>  URL: http://issues.apache.org/jira/browse/IBATIS-28
>  Project: iBatis for Java
> Type: Improvement

>   Components: SQL Maps
> Versions: 2.0.8
>  Environment: All
> Reporter: Christopher John Gores
> Assignee: Brandon Goodin

>
> It seems there is no support for multiple results being returned by a stored 
> procedure (i.e. statement.getMoreResults()).  Unfortunately, that's a 
> showstopper for my new project that needs to call legacy procedures.
> Suggested solution:  Allow a statement to use an ordered collection of 
> resultMaps, either by creating a new  tag, allowing  
> to nest, or by allowing the statement's resultMap attribute to hold a 
> comma-separated list of resultMaps.  The resulting object would have to be a 
> List of mapped result objects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATIS-28) Support multiple results from Stored Procedures

2006-06-21 Thread Clinton Begin (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-28?page=comments#action_12417227 ] 

Clinton Begin commented on IBATIS-28:
-


AFAIK, we're using getMoreResults.

> Support multiple results from Stored Procedures
> ---
>
>  Key: IBATIS-28
>  URL: http://issues.apache.org/jira/browse/IBATIS-28
>  Project: iBatis for Java
> Type: Improvement

>   Components: SQL Maps
> Versions: 2.0.8
>  Environment: All
> Reporter: Christopher John Gores
> Assignee: Brandon Goodin

>
> It seems there is no support for multiple results being returned by a stored 
> procedure (i.e. statement.getMoreResults()).  Unfortunately, that's a 
> showstopper for my new project that needs to call legacy procedures.
> Suggested solution:  Allow a statement to use an ordered collection of 
> resultMaps, either by creating a new  tag, allowing  
> to nest, or by allowing the statement's resultMap attribute to hold a 
> comma-separated list of resultMaps.  The resulting object would have to be a 
> List of mapped result objects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira