users@glassfish.java.net

Re: JPA: how to fetch first 10 rows?

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Wed, 09 Jul 2008 14:52:57 -0700

You can use Query#setFirstResult(), SetMaxResults() to achieve similar
results. A persistence provider may or may not optimize access to
database using database specific limit clause as in your example below

glassfish_at_javadesktop.org wrote:
> If I use JDBC with mysql, I can just write a statement like this this select a from abc a limit 0,10
> Does anyone how to do the same thing with JPA query language? thanks in advance.
>
> Bo
> [Message sent by forum member 'bobxu' (bobxu)]
>
> http://forums.java.net/jive/thread.jspa?messageID=285390
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>