In CMP, how do i write SQL or ejbSelect/Find methods to limit the number of rows returned. for example, instead of returning all rows using findAll(), i want to return the first 100 rows.
Thanks
-
How to limit the number of rows returned (3 messages)
- Posted by: Dart Long
- Posted on: August 12 2004 19:50 EDT
Threaded Messages (3)
- How to limit the number of rows returned by Somu Balasundar on August 13 2004 04:56 EDT
- How to limit the number of rows returned by Dart Long on August 13 2004 11:55 EDT
- How to limit the number of rows returned by Somu Balasundar on August 16 2004 09:21 EDT
-
How to limit the number of rows returned[ Go to top ]
- Posted by: Somu Balasundar
- Posted on: August 13 2004 04:56 EDT
- in response to Dart Long
In CMP, how do i write SQL or ejbSelect/Find methods to limit the number of rows returned. for exsample, instead of returning all rows using findAll(), i want to return the first 100 rows.Thanks
Write a Custom finder method by name findfirst100rows() . and use EQB-QL to write your customised query. -
How to limit the number of rows returned[ Go to top ]
- Posted by: Dart Long
- Posted on: August 13 2004 11:55 EDT
- in response to Dart Long
In CMP, how do i write SQL or ejbSelect/Find methods to limit the number of rows returned. for example, instead of returning all rows using findAll(), i want to return the first 100 rows.Thanks
Can you point out to me how to write such EJB-QL? Thanks a lot. -
How to limit the number of rows returned[ Go to top ]
- Posted by: Somu Balasundar
- Posted on: August 16 2004 09:21 EDT
- in response to Dart Long
This should go into the ejb-jar.xml
<query>
<query-method>
<method-name>findfirst100</method-name>
<method-params>
<method-param>int</method-param>
</method-params></query-method>
<ejb-ql>
SELECT Column FROM Object ob WHERE ob.rownum <= ?1
</ejb-ql>
</query>
Define the Following signature in the local home interface.
public Collection findfirst100(int NoOfRows)
throws FinderException;