1. delete
Delete records matching the given condition.
// Single Condition
public int delete(String table, Condition condition)
public int delete(Table table, Condition condition)
// List<Condition>
public int delete(String table, List<Condition> conditions)
public int delete(Table table, List<Condition> conditions)
Returns: int — number of affected rows.
Example:
jt.delete("user_table", F("id").eq(100));
jt.delete("user_table", Arrays.asList(F("id").eq(100)));
2. deletev (varargs conditions)
Specify delete conditions via varargs.
public int deletev(String table, Object... conditions)
public int deletev(Table table, Object... conditions)
Returns: int — number of affected rows.
Example:
// Delete by equality
jt.deletev("user_table", "id", 100);
// Multiple conditions WHERE name = ? AND birthday >= ?
jt.deletev("user_table", "name", "John", "birthday>=", beginDate);
Top comments (0)