Delete record using JooqTemplate

작성자

카테고리:

← 피드로
DEV Community · ts5432 · 2026-06-10 개발(SW)

ts5432

ts5432

Posted on Jun 10 • Edited on Jun 19

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)

Enter fullscreen mode Exit fullscreen mode

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)));

Enter fullscreen mode Exit fullscreen mode

2. deletev (varargs conditions)

Specify delete conditions via varargs.

public int deletev(String table, Object... conditions)
public int deletev(Table table, Object... conditions)

Enter fullscreen mode Exit fullscreen mode

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);

Enter fullscreen mode Exit fullscreen mode

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다