Annotation Type 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
      java.lang.String value
      Returns the property name(or column name) for a key value of Map.
    • Element Detail

      • value

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