Discussions

EJB design: How to limit the number of rows returned

  1. How to limit the number of rows returned (3 messages)

    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
  2. 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.
  3. How to limit the number of rows returned[ Go to top ]

    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.
  4. 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;