Sophia Aceves
Sophia Aceves

Reputation: 187

jOOQ - returning() without where() not available

I noticed that the returning() operation is not available without a where(). Is this intentional?

This works:

context.deleteFrom(...).where(...).returning().fetch()

This doesn't work:

context.deleteFrom(...).returning().fetch()

Should I consider this 'hack'?

context.deleteFrom(...).where(DSL.true()).returning().fetch()

Upvotes: 1

Views: 81

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220762

This isn't intentional but a bug: https://github.com/jOOQ/jOOQ/issues/4428

As a workaround, you should use:

context.deleteFrom(...).where(DSL.trueCondition()).returning().fetch()

Upvotes: 1

Related Questions