1

I have a one question.

I want to use limit for delete query with querydsl. Is there any way?

delete(wedul).where(wedul.id.eq(10)).limit(10)
1
  • your database don't allow delete query using limit. check out this question Commented May 14, 2021 at 7:08

1 Answer 1

1

JPA (on which hibernate and querydsl is built) does not support something like a limit or rownum for deletes, because it is not a universally supported database concept.

A common approach to solving this would be to delete from the table where the 'id' in contained within a subquery, and the place the limits on the subquery.

See this other answer

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.