Use case? I see (almost) none. Just as I see no use case for String.substring(0, 0). Is there any use case for returning all matching rows when 0 were requested?
However, consider following:
-
the query might be generated and the upper layer might decide it needs 0 rows, thus limit 0 is applied. Of course, in this case, query could be skipped altogether, but retuning "everything" is not the right way of saying this.
-
I could decidedly query with limit 0 just to retrieve metadata (it's not part of JPA I'm aware of, but Hibernate gives some information) – I might be interested in column names, types without actually fetching the data
|