The Update annotation is used to decorate a method specifying an SQL update statement.
The method's return value can be an int or void.
Only if the return value type is int will the update count be returned.
Element | Type | Accessibility |
sql or value | String | The SQL statement to be executed |
keys | Generated Keys | Indicates if autogenerated keys are returned. The default value is GeneratedKeys.NO_KEYS_RETURNED |
import java.sql.BaseQuery;
import java.sql.DataSet;
import java.sql.Select;
public interface UserQueries extends BaseQuery {
// Delete user
@Update ("DELETE Users WHERE firstName={firstName}" +
"AND lastName={lastName}")
int deleteUser (String firstName, String lastName);
}