You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Michael Simons <mi...@optitool.de> on 2009/10/29 19:13:12 UTC
Limit the size of the projection of a query
Hello,
Is there a way in JPA or OpenJPA to limit the number of rows returned by a query?
In our formerly used JDO-Implementation there was a function called maxrows doing so.
I know there are several databases that support a limitation of the projection.
But how can I achieve this in JPA?
Kind Regards,
Michael
Re: Limit the size of the projection of a query
Posted by Michael Simons <mi...@optitool.de>.
I beg your pardon for asking such a RTFM. I'm wondering how I could have missed that.
Thanks, Michael
Fay Wang schrieb:
> You can call the following API to limit the number of rows returned by the query:
>
> Query.setMaxResults(maxResults);
>
>
>
>
> ----- Original Message ----
> From: Michael Simons <mi...@optitool.de>
> To: users@openjpa.apache.org
> Sent: Thu, October 29, 2009 11:13:12 AM
> Subject: Limit the size of the projection of a query
>
> Hello,
>
> Is there a way in JPA or OpenJPA to limit the number of rows returned by a query?
> In our formerly used JDO-Implementation there was a function called maxrows doing so.
> I know there are several databases that support a limitation of the projection.
> But how can I achieve this in JPA?
>
> Kind Regards,
> Michael
Re: Limit the size of the projection of a query
Posted by Fay Wang <fy...@yahoo.com>.
You can call the following API to limit the number of rows returned by the query:
Query.setMaxResults(maxResults);
----- Original Message ----
From: Michael Simons <mi...@optitool.de>
To: users@openjpa.apache.org
Sent: Thu, October 29, 2009 11:13:12 AM
Subject: Limit the size of the projection of a query
Hello,
Is there a way in JPA or OpenJPA to limit the number of rows returned by a query?
In our formerly used JDO-Implementation there was a function called maxrows doing so.
I know there are several databases that support a limitation of the projection.
But how can I achieve this in JPA?
Kind Regards,
Michael