Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-221

Can't store a List in a Map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.5
    • 2.1.7
    • Core
    • None
    • Windows XP, j2sdk1.4.2_08

    Description

      Nested selects (N+1 selects) with a 1:N relation work fine as long as the primary result set is mapped to a JavaBean, but when the primary result set is mapped to a Map, iBATIS ignores the javaType of the column with the select attribute and treats it as a simple Object. This is a problem for 1:N cases since it needs to treat the column as a List and use queryForList() instead of queryForObject() to load it.

      A small change to com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.java seems to take care of the problem in my case, but there may be a corresponging change required for LazyLoading that I haven't looked into.

      Attachments

        1. BasicResultMap.java
          20 kB
          Gary Bradshaw

        Activity

          People

            cbegin Clinton Begin
            gbradshaw Gary Bradshaw
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: