views:

285

answers:

0

I need to implement Pagintion of CMP2.1 Entity Beans. Is it possible to do it using EJB-QL ? Am using weblogic10.3 + Oracle DB.

I was planning to use "rownum >= min_row_size + PreparedQUery.setMaxResult()" to get desired result . But rownum in EJB-QL is not recognized by weblogic . Is there any way to specify psuedo column in EJb-QL ?

The exception I get is something like rownum is does not correspond to any cmr or cmp field ..reexamine your query !

Will rephrase the question as rownum >= minrowsize will not work in SQL !

Basically I need to achieve Pagination which should be possible in CMP2.1 days also ! EJB QL in weblogic doesnt support LIMIT or OFFSET . I have this SQL query which can get me desired result but I dont know how to translate it to EJBQL

select * from ( select /*+ FIRST_ROWS(n) / a., ROWNUM rnum from (your query goes here ) a where ROWNUM <=3 --MAX ) where rnum >= 1 --MIN

Been googling since some days now and unable to find a decent solution .. Anyone listening !!!