Originally posted by Rufus BugleWeed: java.util.Collections.sort( list, comparator );
So the process will be 1. use home business method to get a Collection/Set of users 2. Convert to List 3. Apply java.util.Collections.sort( list, comparator ); is it expensive to do all these in this way? As in plain jdbc, we could solve this problem simply by adding a "order by " clause in the sql command .... Anyone can share with me your opinion why EJB QL does not include a "order by" clause? What are the design issues involved? Is it because of cmr field? [ March 09, 2004: Message edited by: Yi Meng ]
Originally posted by Reid M. Pinchback: I don't know why Sun didn't include it in the spec, but you'll find some containers provide their own EJB-QL extensions to deal with stuff like this.
EJB QL has been enhanced in EJB 2.1 with the addition of aggregate functions, the ORDER BY clause , and other new features and clarifications. for e.g. EJB 2.1 does add some functions to the SELECT clause that EJB 2.0 is missing including COUNT(), SUM(), AVG(), MAX() and MIN(). (Refered from Rachard Monson-Haefel's Enterprise Java bean forthcoming 4th edition)
So the process will be is it expensive to do all these in this way? As in plain jdbc, we could solve this problem simply by adding a "order by " clause in the sql command .... [ March 09, 2004: Message edited by: Yi Meng ]
I think it is not expensive since the selects cost the same and the resultSet is sort in primary memory
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Anderson gave himself the promotion. So I gave myself this tiny ad: