In general it is best to avoid paging if at all possible but if you
can't avoid it don't forget that different databases have different ways
of implementing a count. With Oracle you would use rownum if possible
and with DB2 you would add fetch first n rows only.

David Morris

>>> Chris Nelson <[EMAIL PROTECTED]> 12/1/2003 8:31:09 AM >>>
Gavin,

Thanks for getting back to me.  I read an earlier post
where you had said something like this, but I was
hoping you might reconsider.  I agree that having
something even more generic would be better, but
having a count method now is absolutely critical to
anyone wanting to use the Criteria API and needing to
do paging.  I also feel that the other methods like
avg(), max(), etc, are not nearly as important as
count() for most people.  I certainly understand the
slippery slope idea, but I'm not sure it has to apply
here.  I would be willing to commit to refactoring,
removing, or doing whatever is needed to adapt this
method to fit in with the aggregation functionality
when it comes along.  I'd much rather do that than
have to redo this patch for each release of Hibernate
in the meanwhile.  I also think there are people who
may need this method who may be uncomfortable with
using a patched version of Hibernate.

Incidentally, I'd be happy to be involved in
developing the aggregation functionality if I can be
helpful.  It seems like making the Select statement
objectb available to sublasses might be a first step
in that direction anyways.  Of course, there seems to
be some talk about having Criteria generate HQL and
SQL with the new AST stuff (an idea which I rather
like if it's feasible), so maybe not.

Thanks again,

Chris Nelson


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to