|
I'm trying to create a general class (says Page) which
would help other objects to speparte datas among pages. My thought is before
invoking db.getOQLQuery(sql), using JDO to get the number of total records, and
change the sql to only load the required datas of that page, 20 records per
page for example.
If I use "select count(u) from model.User
u where ...", how can I retrive the record number? I learned from the
mailing list that QueryResults.size() might not work properly.
And will "CALL SQL select count(u.user_id) as totalRows from
user_table where ... AS model.Page" return me a Page object with property
totalRows been set?
Is there anyone could provide me an example about
this?
Thanks in advance.
Xiaoyong
|
