Reputation: 47
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)
Upvotes: 1
Views: 1929
Reputation: 3367
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
Upvotes: 1