I do not recall specific discussions on this clause in the expert group, but
a possible reason does occur to me for its omission:

Multi-object finders, regardless of ordering logic in the underlying EJB QL
and datastore, return Collections. Therefore they may be ordered initially
but are not guaranteed to maintain order over time. To counter my own
argument, it's true that Collections also don't generically imply duplicate
vs. unique element composition, but that EJB QL does include a DISTINCT
clause to enforce a rule on it anyway. But I would argue that DISTINCT is a
clause that belongs at the object factory layer (in this case, the EJB QL
interpreter and Connector being the factory) whereas the ordering belongs,
according to current Collections design, at the Collections layer. The
design of Java Collections suggests that the order of any Collection of
objects should not be pre-determined by the factory creating those objects,
which would tightly couple the factory to the Collection, but by the
Collection itself via Comparators applied in a more portable, looser
fashion. If the Comparators were implicit in an EJB QL ORDER BY clause, not
only would the Collection design be challenged (some folks might even view
that as a good thing!) but a single default Comparator implementation would
be implied for all underlying EIS's.

Still, I agree with your assessment that in practice traditional EIS's
handle ordering more efficiently than do container and other Java-based
solutions.

Sean


-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard Monson-Haefel
Sent: Monday, April 30, 2001 1:44 PM
To: [EMAIL PROTECTED]
Subject: EJB 2.0: EJB QL no ORDER BY clause


EJB QL is missing an ORDER BY clause.  I think this is an important
omissions. This feature should be supported by just about every target
environment, so why isn't included in EJB QL?

NOTE:
If you are interested in debating the virtues of EJB QL itself, kindly
do so in a separate thread.  I'm just looking for feedback on this one
issue.

Thanks,

Richard
--
Richard Monson-Haefel
Author of Enterprise JavaBeans, 2nd Edition  (O'Reilly 2000)
Co-Author of Java Message Service (O'Reilly 2000)
http://www.jMiddleware.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to