Hint
This article is generated by AI translation.
@Call Annotation
Marks an interface method to execute a stored procedure call.
info
If you pass a string array, the elements are concatenated with a single space between them.
@Call implicitly uses CallableStatement, so it has no statementType attribute.
Example
@SimpleMapper
public interface UserMapper {
// Input/output argument
@Call("{call proc_select_user(#{abc, mode=inout, jdbcType=decimal})}")
Map<String, Object> callSelectUser1(@Param("abc") int argAbc);
// Output-only argument
@Call("{call proc_select_user(#{abc, mode=out, jdbcType=decimal})}")
Map<String, Object> callSelectUser2();
}
UserMapper mapper = ...
Map<String, Object> res1 = mapper.callSelectUser1(23);
// res1.get("abc") retrieves the INOUT argument "abc"
Map<String, Object> res2 = mapper.callSelectUser2();
// res2.get("abc") retrieves the OUT argument "abc"
- When using
@Callto invoke a stored procedure, the method return type should be Map<String,Object>. See Stored Procedures for SQL syntax.- Stored procedure input arguments: passed in through method arguments
- Stored procedure output arguments: read from the returned Map
- Result sets produced by the stored procedure: read from the returned Map
Properties
| Property | Description |
|---|---|
| value | 必选 Stored procedure call statement. |
| timeout | 可选 Set query timeout in seconds via Statement.setQueryTimeout(int). Default -1 means not set. |
| bindOut | 可选 Filter output arguments; only the specified argument names are received. If omitted, all output arguments are captured. |