Package org.apache.ibatis.annotations
Annotation 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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The options for theflushCache()
.static @interface
The container annotation forOptions
. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
Returns the fetch size.Returns the 2nd cache flush strategy.Returns column names that retrieves a key value.Returns property names that holds a key value.Returns result set names.Returns the result set type.Return the statement type.int
Returns the statement timeout.boolean
Returns whether use the 2nd cache feature if assigned the cache.boolean
Returns whether use the generated keys feature supported by JDBC 3.0
-
Element Details
-
useCache
boolean useCacheReturns whether use the 2nd cache feature if assigned the cache.- Returns:
true
if use;false
if otherwise
- Default:
- true
-
flushCache
Options.FlushCachePolicy flushCacheReturns the 2nd cache flush strategy.- Returns:
- the 2nd cache flush strategy
- Default:
- DEFAULT
-
resultSetType
ResultSetType resultSetTypeReturns the result set type.- Returns:
- the result set type
- Default:
- DEFAULT
-
statementType
StatementType statementTypeReturn the statement type.- Returns:
- the statement type
- Default:
- PREPARED
-
fetchSize
int fetchSizeReturns the fetch size.- Returns:
- the fetch size
- Default:
- -1
-
timeout
int timeoutReturns the statement timeout.- Returns:
- the statement timeout
- Default:
- -1
-
useGeneratedKeys
boolean useGeneratedKeysReturns whether use the generated keys feature supported by JDBC 3.0- Returns:
true
if use;false
if otherwise
- Default:
- false
-
keyProperty
String keyPropertyReturns 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 keyColumnReturns 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 resultSetsReturns 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:
- ""
-