Annotation Type Select


@Documented
@Retention(RUNTIME)
@Target(METHOD)
@Repeatable(List.class)
public @interface Select
The annotation that specify an SQL for retrieving record(s).

How to use:

 public interface UserMapper {
   @Select("SELECT id, name FROM users WHERE id = #{id}")
   User selectById(int id);
 }
 
Author:
Clinton Begin
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  Select.List
    The container annotation for Select.
  • Required Element Summary

    Required Elements
    Modifier and Type Required Element Description
    String[] value
    Returns an SQL for retrieving record(s).
  • Optional Element Summary

    Optional Elements
    Modifier and Type Optional Element Description
    String databaseId  
  • Element Details

    • value

      String[] value
      Returns an SQL for retrieving record(s).
      Returns:
      an SQL for retrieving record(s)
    • databaseId

      String databaseId
      Returns:
      A database id that correspond this statement
      Since:
      3.5.5
      Default:
      ""