openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
Subject RE: SELECT TOP n records Equilent in JPQL
Date Fri, 18 Jun 2010 11:07:52 GMT
OK assuming you have an entitymanager object called em

Query query = em.createQuery("select blah blah ....");
query.setMaxResults(1);
List ret = query.getResultList();

Returns the first record matching your query.

-----Original Message-----
From: SreeAsh [mailto:srinivasulu.kristnam@fs.mphasis.com] 
Sent: Friday, 18 June 2010 8:52 PM
To: users@openjpa.apache.org
Subject: RE: SELECT TOP n records Equilent in JPQL


Hi crispyoz ,

     i need to get TOp 1 record from table my query like this...

    SELECT TOP 1 * from tblName
-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/SELECT-TOP-n-records-Equilent-in-JPQL-tp
5194742p5194825.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message