Skip to main content

@Call

Marks an interface method to execute a stored procedure call.

info

@Call implicitly uses CallableStatement and has no statementType attribute. value supports string arrays.

Example
@SimpleMapper
public interface UserMapper {
// Input and output parameters
@Call("{call proc_select_user(#{abc, mode=inout, jdbcType=decimal})}")
Map<String, Object> callSelectUser1(@Param("abc") int argAbc);

// Output-only parameter
@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"); // Get the INOUT parameter

Map<String, Object> res2 = mapper.callSelectUser2();
res2.get("abc"); // Get the OUT parameter
  • Input parameters are passed through method arguments; output parameters and result sets are received through the returned Map
  • Return type must be Map<String, Object>
  • For SQL syntax, see Stored Procedure Call

Properties

PropertyDescription
valueRequired Stored procedure call statement.
timeoutOptional Execution timeout in seconds. Default -1
bindOutOptional Filter output parameters; only receive arguments with the specified names. If not set, all output parameters are received.