I have to agree with a lot of what Robert is saying here.  There doesn't seem
to be a good reason for not supporting the ORDER BY clause in EJB QL and, by
default, the List collection type.  A while ago, I posted a proposal for adding
the ORDER BY clause to EJB QL, but didn't get a satisfactory response from
vendors or Sun.  Why is that?  What is so difficult about the ORDER BY clause
and List collection type that they are not supported in the specification?

While this issue may seem trivial, it's not.  Ordered collections are
fundamental and their absence is troubling.  If there is a good explanation for
not including the ORDER BY clause in EJB QL and, by default, the List
collection type, I would like to hear it.

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

Robert Krueger wrote:

> What is the reason to not allow java.util.List as a valid return type for
> finders? This forces us to frequently write semantically incorrect programs
> as we rely on the order of items in the collection (because any O/R layer I
> know allows to specify the order for CMP finders). Why not allow List as a
> return type to get rid of this IMHO unnecessary incorrectness? Same holds
> for collection valued CMR fields. I disagree with the assessment that
> relying on the order of things is bad practice and agree with people
> arguing for an ORDER BY clause in EJB-QL in the thread started by RMH. I
> just don't see why? Looking at all EJB applications I've worked with for
> the past 2 years, I think this is completely against common practice and I
> don't even see a semantical problem with using ordered collections for
> finder results (and CMR fields btw). How many persistent stores that CMP
> engines are build on top of don't support ordering of query results? What
> this will lead to is that container providers will probably provide
> additional means to specify an order for finders because people need it,
> which again will lead to non-portable apps.
>
> Regards,
>
> Robert
>
> (-) Robert Kr�ger
> (-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
> (-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
> (-) Tel: 06151 665401, Fax: 06151 665373
> (-) [EMAIL PROTECTED], www.signal7.de
>
> ===========================================================================
> 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