When I want to get some statistics(with gourp by) or idToSth(eg. userIdToDeptName).
I want to get a map whose key is the first column, value is the second column.
I found there is not a good way to do it.
This is my way to do it now by MybatisKV.
https://paste.ubuntu.com/p/xfTzbHf8FJ/
I noticed there is an annotation @Mapkey.
Why not craete an annotation @MapValue.
With it, I could write code like this:
https://paste.ubuntu.com/p/9nQGQhHyvc/
When I want to get some statistics(with gourp by) or idToSth(eg. userIdToDeptName).
I want to get a map whose key is the first column, value is the second column.
I found there is not a good way to do it.
This is my way to do it now by MybatisKV.
https://paste.ubuntu.com/p/p9z5bvztkv/
I noticed there is an annotation @Mapkey.
Why not craete an annotation @MapValue.
With it, I could write code like this:
https://paste.ubuntu.com/p/9nQGQhHyvc/
public interface UserMapper {--
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 mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/0de14ae1-1fc4-46b1-ac43-dee53a677d07n%40googlegroups.com.
@MapKey("id")
@Select("SELECT id, name FROM test_data")
Map<Integer, String> testMap();
gso...@gmail.com |
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/emad512ed2-7c1d-41ef-aa10-7a16333edd7b%40asus.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/emad512ed2-7c1d-41ef-aa10-7a16333edd7b%40asus.