Package org.apache.ibatis.annotations
Annotation Type Options
-
@Documented @Retention(RUNTIME) @Target(METHOD) @Repeatable(List.class) public @interface Options
The annotation that specify options for customizing default behaviors.How to use:
public interface UserMapper { @Options(useGeneratedKeys = true, keyProperty = "id") @Insert("INSERT INTO users (name) VALUES(#{name})") boolean insert(User user); }
- Author:
- Clinton Begin
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
databaseId
int
fetchSize
Returns the fetch size.Options.FlushCachePolicy
flushCache
Returns the 2nd cache flush strategy.String
keyColumn
Returns column names that retrieves a key value.String
keyProperty
Returns property names that holds a key value.String
resultSets
Returns result set names.ResultSetType
resultSetType
Returns the result set type.StatementType
statementType
Return the statement type.int
timeout
Returns the statement timeout.boolean
useCache
Returns whether use the 2nd cache feature if assigned the cache.boolean
useGeneratedKeys
Returns whether use the generated keys feature supported by JDBC 3.0
-
-
-
-
flushCache
Options.FlushCachePolicy flushCache
Returns the 2nd cache flush strategy.- Returns:
- the 2nd cache flush strategy
- Default:
- org.apache.ibatis.annotations.Options.FlushCachePolicy.DEFAULT
-
-
-
resultSetType
ResultSetType resultSetType
Returns the result set type.- Returns:
- the result set type
- Default:
- org.apache.ibatis.mapping.ResultSetType.DEFAULT
-
-
-
statementType
StatementType statementType
Return the statement type.- Returns:
- the statement type
- Default:
- org.apache.ibatis.mapping.StatementType.PREPARED
-
-
-
keyProperty
String keyProperty
Returns property names that holds a key value.If you specify multiple property, please separate using comma(',').
- Returns:
- property names that separate with comma(',')
- Default:
- ""
-
-
-
keyColumn
String keyColumn
Returns column names that retrieves a key value.If you specify multiple column, please separate using comma(',').
- Returns:
- column names that separate with comma(',')
- Default:
- ""
-
-
-
resultSets
String resultSets
Returns result set names.If you specify multiple result set, please separate using comma(',').
- Returns:
- result set names that separate with comma(',')
- Default:
- ""
-
-
-
databaseId
String databaseId
- Returns:
- A database id that correspond this options
- Since:
- 3.5.5
- Default:
- ""
-
-