Skip to main content

@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

PropertyDescription
valueRequired The DELETE statement to be executed.
statementTypeOptional JDBC execution mode. Default Prepared
- Statementjava.sql.Statement
- Preparedjava.sql.PreparedStatement
- Callablejava.sql.CallableStatement
timeoutOptional Execution timeout in seconds. Default -1