How do I limit JPQ output?

Posted by den-javamaniac on Stack Overflow See other posts from Stack Overflow or by den-javamaniac
Published on 2010-04-26T16:31:17Z Indexed on 2010/04/26 16:33 UTC
Read the original article Hit count: 206

Filed under:
|
|
|

I need to limit number of entities returned by a query to some certain value inside a JPA query (through JPQL). Particularly:

select m from Manual m //constraint

e.g. in sql (mysql syntax) I would do it like:

select * from Manual limit 1

The only solution that comes up is simply to get all entities and then choose first one, which is out of the issue. Any ideas?

© Stack Overflow or respective owner

Related posts about java

Related posts about jee6