iBATIS DataMapper
Added by Brandon Goodin, last edited by Gwyn Evans on Nov 13, 2007  (view change)

So much documentation to write, so little time...

The following features have yet to be documented. Feel free to make a wiki page for any of them and document them here. Good documentation will be promoted to the official Developer Guide.

  • Multiple result set support (resultMap="resultMap1, resultMap2" or resultClass="resultClass1, resultClass2")
  • Transactionmanagers
    • Isolation Level support
  • Cache models
    • Serialize option for cache models
  • XML/DOM result/param mappings
  • remapResults="true"                                                               (added to iBATIS developer guide)
  • DAO context id (for multiple DAO implementations)
  • DBCP 2.0 config docs                                                              (added to iBATIS developer guide)
  • <result ... resultMap="..."/>
  • Type handling
    • JDBC BLOB/CLOB support
  • SQL-fragment includes                                                           (added to iBATIS developer guide)
  • <discriminator> and <subMap> SqlMap elements
  • More on bytecode enhancement
  • More on dynamic statement prepend behavior
  • Installation and Configuration
  • Patterns and Best Practices
    • Naming conventions
    • Config Singleton
    • Simple solution first
    • N+1 Avoidance
    • RO/RW Cache Separation
  • Refactorings
    • Eliminate N+1 Selects
    • Lazy Load Associations
    • ResultClass to ResultMap
    • ParameterClass to ParameterMap
  • Issues
JDBC logging issues (iBATIS DataMapper)
Lazy loading issues (iBATIS DataMapper)
remapResults="true" (iBATIS DataMapper)

Does anyone know where this is documentation for that first item (Multiple result set support)?

I have scoured the internet and read every blog/forum post on using multiple result sets, but I cannot see how to get this to work.

I'm using MySQL and I have a mapped select statement with two selects running in sequence. The first uses SQL_CALC_FOUND_ROWS to store the total rows and the second does select FOUND_ROWS(); to return the total. This is typical in MySQL when paging through large data sets.

I have everything mapped correctly I think. My resultMap is resultMap="RowResult,int" and my mapper instance loads it fine. But I can't, for the life of me, figure out how to query out the right objects. Using QueryForList<T> works fine and retrieves the first result perfectly. But I can't find or figure out how to also extract the second (int) result for the FOUND_ROWS() value.


Posted by paul@getdt.com at Nov 29, 2008 10:01

Figured out one way of doing it - you can return QueryForList as an ArrayList and loop through it. The second result, an integer, is stuffed into the ArrayList after the other objects. Not as clean and intiutive as I would have imagined, but NO complaining here! Glad to have a solution.

Posted by paul@getdt.com at Dec 03, 2008 12:49
Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators