Annotation Type Insert


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

    How to use:

     public interface UserMapper {
       @Insert("INSERT INTO users (id, name) VALUES(#{id}, #{name})")
       void insert(User user);
     }
     
    Author:
    Clinton Begin
    • Required Element Summary

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

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

      • value

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

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