@Delete
Marks an interface method to execute a DELETE statement.
info
value supports string arrays. Elements are joined with spaces, convenient for multi-line writing.
Example: delete a user by id
@SimpleMapper
public interface UserMapper {
@Delete({"delete from users ",
"where id = #{userId}"})
int deleteUserById(@Param("userId") int userId);
}
Properties
| Property | Description |
|---|---|
| value | Required The DELETE statement to be executed. |
| statementType | Optional JDBC execution mode. Default Prepared- Statement → java.sql.Statement- Prepared → java.sql.PreparedStatement- Callable → java.sql.CallableStatement |
| timeout | Optional Execution timeout in seconds. Default -1 |