Annotation Interface MapKey


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface MapKey
The annotation that specify the property name(or column name) for a key value of Map.

How to use:

 public interface UserMapper {
   @MapKey("id")
   @Select("SELECT id, name FROM users WHERE name LIKE #{name} || '%")
   Map<Integer, User> selectByStartingWithName(String name);
 }
 
Author:
Clinton Begin