mybatis / mybatis-3

MyBatis SQL mapper framework for Java
http://mybatis.github.io/mybatis-3/
Apache License 2.0
19.7k stars 12.81k forks source link

A mechanism to allow returning custom collections and/or implementations from mapper functions #2877

Open acanthite1855 opened 1 year ago

acanthite1855 commented 1 year ago

I tried using Guava's immutable collections, specifically ImmutableList as return type in mapper functions, but obviously MyBatis does not know how to construct them. Unfortunately, it looks like currently there is no way make it work (see my question on stackoverflow for more details).

It would be really nice to have a mechanism to allow mapping results to custom collections or custom implementations of JDK's collection interfaces.

XenoAmess commented 1 month ago

seems you can just add a SPI mechenism here. image