66-mybatis data back to the main key inserted

It may simply point xml configuration, online tutorials and more.

Java annotated with less:

    // 动态插入
    @InsertProvider(type=UserDynaSqlProvider.class,method="insertUser")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insertUser(User user);

  

Note that: @ insertProvider instead: @SelectProvider

Guess you like

Origin www.cnblogs.com/zhumengdexiaobai/p/11280043.html