Mybatis with springframework

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Mybatis with springframework

SianoWang
## MyBatis version
3.4.6

## Database vendor and version
MySQL 8.0.12

## Test case or example project
When worked with springframework 5.1.3-release & mybatis-spring 1.3.2,
The collection attribute in resultMap doesn't work.
<a imageanchor="1" href="about:invalid#zClosurez" style="clear: left; margin-bottom: 1em; float: left; margin-right: 1em;">微信图片_20190113105343.png





<a imageanchor="1" href="about:invalid#zClosurez" style="clear: left; margin-bottom: 1em; float: left; margin-right: 1em;">微信图片_20190113105530.png







## Actual result

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException

However,when I used Mybatis 3.2.8 with springframework, it worked.
When I use Mybatis3.4.6 without springframework, it also worked.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis with springframework

Kazuki Shimizu
Could you provide a small reproduce project on GitHub or Zip file? 

On Sunday, January 13, 2019 at 12:01:10 PM UTC+9, SianoWang wrote:
## MyBatis version
3.4.6

## Database vendor and version
MySQL 8.0.12

## Test case or example project
When worked with springframework 5.1.3-release & mybatis-spring 1.3.2,
The collection attribute in resultMap doesn't work.
微信图片_20190113105343.png





微信图片_20190113105530.png







## Actual result

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException

However,when I used Mybatis 3.2.8 with springframework, it worked.
When I use Mybatis3.4.6 without springframework, it also worked.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis with springframework

SianoWang

Oops, I forgot that! Here is the project. You can run the MybatisTest under the Test directory. Thanks for your reply.
the download link: https://drive.google.com/open?id=159zhxUB9TN0QUQopwfrIkXPIG1n9Z3Mm
在 2019年1月13日星期日 UTC+8下午12:04:06,Kazuki Shimizu写道:
Could you provide a small reproduce project on GitHub or Zip file? 

On Sunday, January 13, 2019 at 12:01:10 PM UTC+9, SianoWang wrote:
## MyBatis version
3.4.6

## Database vendor and version
MySQL 8.0.12

## Test case or example project
When worked with springframework 5.1.3-release & mybatis-spring 1.3.2,
The collection attribute in resultMap doesn't work.
微信图片_20190113105343.png





微信图片_20190113105530.png







## Actual result

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException

However,when I used Mybatis 3.2.8 with springframework, it worked.
When I use Mybatis3.4.6 without springframework, it also worked.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis with springframework

Kazuki Shimizu
Thanks for providing reproduce project!

I've tried your demo application. I could reproduce this issue.
I founded wrong result map settings at ResultMapper.routeinfo:
There is not 'uid' property in Route class. I think that you should specify  to 'rid' instead of 'uid' as follow:

Current Settings:
<id property="uid" column="uid"></id>

Valid Settings:
<id property="rid" column="rid"></id>


In above changes, I've resolved this issue.
Please try my suggestion.


On Sunday, January 13, 2019 at 5:17:44 PM UTC+9, SianoWang wrote:

Oops, I forgot that! Here is the project. You can run the MybatisTest under the Test directory. Thanks for your reply.
the download link: <a href="https://drive.google.com/open?id=159zhxUB9TN0QUQopwfrIkXPIG1n9Z3Mm" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://drive.google.com/open?id\x3d159zhxUB9TN0QUQopwfrIkXPIG1n9Z3Mm&#39;;return true;" onclick="this.href=&#39;https://drive.google.com/open?id\x3d159zhxUB9TN0QUQopwfrIkXPIG1n9Z3Mm&#39;;return true;">https://drive.google.com/open?id=159zhxUB9TN0QUQopwfrIkXPIG1n9Z3Mm
在 2019年1月13日星期日 UTC+8下午12:04:06,Kazuki Shimizu写道:
Could you provide a small reproduce project on GitHub or Zip file? 

On Sunday, January 13, 2019 at 12:01:10 PM UTC+9, SianoWang wrote:
## MyBatis version
3.4.6

## Database vendor and version
MySQL 8.0.12

## Test case or example project
When worked with springframework 5.1.3-release & mybatis-spring 1.3.2,
The collection attribute in resultMap doesn't work.
微信图片_20190113105343.png





微信图片_20190113105530.png







## Actual result

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException

However,when I used Mybatis 3.2.8 with springframework, it worked.
When I use Mybatis3.4.6 without springframework, it also worked.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.