Builder for Delete and Update statements

9 views
Skip to first unread message

sca...@live.com

unread,
Dec 6, 2017, 8:55:43 AM12/6/17
to jOOQ User Group
There is a convenient builder for Select queries, e.g. SelectQuery query = selectDistinct().from( myTable ).getQuery(); and then query.addConditions(...); query.addFrom(...) etc.

Is there a similar builder for Delete and Update statements? Like deleteFrom(table).getQuery().addConditions(...).

Lukas Eder

unread,
Dec 6, 2017, 12:12:52 PM12/6/17
to jooq...@googlegroups.com
Hello,

In fact, that getQuery() method is a leftover from early jOOQ versions, which exposes jOOQ's internal model API from the DSL API [1]. The standard way to access the model API is by using DSLContext.selectQuery(), DSLContext.insertQuery(), DSLContext.deleteQuery(), DSLContext.updateQuery().

I hope this helps,
Lukas

sca...@live.com

unread,
Dec 6, 2017, 12:21:38 PM12/6/17
to jOOQ User Group
Awesome, thanks! Wasn't aware of these methods before, and that's right the uniformity I needed.
Reply all
Reply to author
Forward
0 new messages