Here's the challenge with multiple result sets: How do we know what to map each result set to? That is, unless all of the result sets are the same (which would be easy to implement), there's no way without complicating the mappings.
Thoughts?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Either way though, if a union can be done, that suggests that the results are mapped to the same type, which would not be a problem for us to implement (just an additional outer iteration).
The problem (for both the UNION and SQL Maps) is where the result sets are different and therefore need to be mapped to different results. There's no easy way to describe the mappings --it will almost certainly be nested and verbose (i.e. yuck).
Clinton
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One thing (along these lines) I have been wondering about was how could we map an sql statement to multiple beans. So you would get a List of Maps where the entries were beans for multiple results, or just a single Map where the entries were beans for a single result.
This sounds sort of hibernate-ish, but could be handy when doing a multi-table join where you wanted type safety or calculated fields that were already in the beans or too complex to express in SQL.
Like multiple result set support vertically instead of horizontally. ;-)
Larry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would be nice and not too hard to implement (procs and normal sql).
Here's the challenge with multiple result sets: How do we know what to map each result set to? That is, unless all of the result sets are the same (which would be easy to implement), there's no way without complicating the mappings.
Thoughts?
I am not sure I understand the value of this. Can someone provide an example?
If all of the result sets are the same, why not just do a UNION in the SQL?
Larry
Agreed...
Either way though, if a union can be done, that suggests that the results are mapped to the same type, which would not be a problem for us to implement (just an additional outer iteration).
The problem (for both the UNION and SQL Maps) is where the result sets are different and therefore need to be mapped to different results. There's no easy way to describe the mappings --it will almost certainly be nested and verbose (i.e. yuck).
Clinton
One thing (along these lines) I have been wondering about was how could we map an sql statement to multiple beans. So you would get a List of Maps where the entries were beans for multiple results, or just a single Map where the entries were beans for a single result.
This sounds sort of hibernate-ish, but could be handy when doing a multi-table join where you wanted type safety or calculated fields that were already in the beans or too complex to express in SQL.
Like multiple result set support vertically instead of horizontally. ;-)
Larry