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
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the property name(or column name) for a key value of Map.
  • Element Details

    • value

      String value
      Returns the property name(or column name) for a key value of Map.
      Returns:
      the property name(or column name)