You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Gary Bradshaw (JIRA)" <ib...@incubator.apache.org> on 2005/11/10 22:38:03 UTC

[jira] Created: (IBATIS-221) Can't store a List in a Map

Can't store a List in a Map
---------------------------

         Key: IBATIS-221
         URL: http://issues.apache.org/jira/browse/IBATIS-221
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.1.5    
 Environment: Windows XP, j2sdk1.4.2_08
    Reporter: Gary Bradshaw
    Priority: Minor


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.

-- 
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] Closed: (IBATIS-221) Can't store a List in a Map

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-221?page=all ]
     
Clinton Begin closed IBATIS-221:
--------------------------------

    Fix Version: 2.2.0
     Resolution: Fixed
      Assign To: Clinton Begin

Fixed as described

> Can't store a List in a Map
> ---------------------------
>
>          Key: IBATIS-221
>          URL: http://issues.apache.org/jira/browse/IBATIS-221
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.5
>  Environment: Windows XP, j2sdk1.4.2_08
>     Reporter: Gary Bradshaw
>     Assignee: Clinton Begin
>     Priority: Minor
>      Fix For: 2.2.0
>  Attachments: BasicResultMap.java
>
> 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.

-- 
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-221) Can't store a List in a Map

Posted by "Gary Bradshaw (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-221?page=comments#action_12357588 ] 

Gary Bradshaw commented on IBATIS-221:
--------------------------------------

After a little more browsing, it looks to me like this change will work for lazy loading, too.

> Can't store a List in a Map
> ---------------------------
>
>          Key: IBATIS-221
>          URL: http://issues.apache.org/jira/browse/IBATIS-221
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.5
>  Environment: Windows XP, j2sdk1.4.2_08
>     Reporter: Gary Bradshaw
>     Priority: Minor
>  Attachments: BasicResultMap.java
>
> 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.

-- 
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] Updated: (IBATIS-221) Can't store a List in a Map

Posted by "Gary Bradshaw (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-221?page=all ]

Gary Bradshaw updated IBATIS-221:
---------------------------------

    Attachment: BasicResultMap.java

> Can't store a List in a Map
> ---------------------------
>
>          Key: IBATIS-221
>          URL: http://issues.apache.org/jira/browse/IBATIS-221
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.5
>  Environment: Windows XP, j2sdk1.4.2_08
>     Reporter: Gary Bradshaw
>     Priority: Minor
>  Attachments: BasicResultMap.java
>
> 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.

-- 
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