Package org.apache.ibatis.annotations
Annotation Type UpdateProvider
- 
@Documented @Retention(RUNTIME) @Target(METHOD) @Repeatable(List.class) public @interface UpdateProvider
The annotation that specify a method that provide an SQL for updating record(s).How to use:
public interface UserMapper { @UpdateProvider(type = SqlProvider.class, method = "update") boolean update(User user); public static class SqlProvider { public static String update() { return "UPDATE users SET name = #{name} WHERE id = #{id}"; } } }- Author:
 - Clinton Begin
 
 
- 
- 
- 
method
String method
Specify a method for providing an SQL.Since 3.5.1, this attribute can omit. If this attribute omit, the MyBatis will call a method that decide by following rules.
- 
     If class that specified the 
type()attribute implements theProviderMethodResolver, the MyBatis use a method that returned by it - 
     If cannot resolve a method by 
ProviderMethodResolver(= not implement it or it was returnednull), the MyBatis will search and use a fallback method that namedprovideSqlfrom specified type 
- Returns:
 - a method name of method for providing an SQL
 
- Default:
 - ""
 
 - 
     If class that specified the 
 
 - 
 
- 
- 
databaseId
String databaseId
- Returns:
 - A database id that correspond this provider
 - Since:
 - 3.5.5
 
- Default:
 - ""
 
 
 - 
 
 -