CMR and Collections.sort - Weblogic

This is a discussion on CMR and Collections.sort - Weblogic ; Good day, I am trying to sort a CMR collection but without a spec compliant way (i.e. ORDER BY) I have to do it externally. I have been using Collections.sort(List) on a list created from the CMR Collection, but I ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: CMR and Collections.sort

  1. CMR and Collections.sort

    Good day,

    I am trying to sort a CMR collection but without a spec compliant way
    (i.e. ORDER BY) I have to do it externally. I have been using
    Collections.sort(List) on a list created from the CMR Collection, but I
    have noticed that it results in 3 calls to the DB for every element in
    the List. The CM entity bean defines its own compareTo() method which
    compares CMP fields to get a proper sort order.

    My question is whether this is expected behaviour and if so, is there a
    better way to do the sorting (outside of using WLS specific EJB-QL)?

    Thanks,
    Sean

  2. Re: CMR and Collections.sort


    If it matters, ORDER BY is now defined in EJB2.1.

    -thorick




+ Reply to Thread