1 Reply Latest reply on Aug 6, 2004 4:36 AM by aloubyansky

    CMR sorted?

      Hi,

      I need to call an ABean.getBBeans() and
      obtain BBean ORDERED BY infoB. Is this
      possibile without write ad-hoc finder but
      with getBBeans() overload?

      TIA!

      I have this situation:
      ABean (.get/setId: Int/PK .get/setInfoA: String
      get/setBBeans())
      BBean (.get/setId: Int/PK .get/setInfoB: String
      get/setABean())


      This is CMR Xdoclet-definition.

      ABean
      /**
      * @ejb.interface-method
      *
      * @ejb.relation
      * name="BBean-ABean"
      * role-name="ABean-has-many-BBean"
      * cascade-delete="no"
      */
      public abstract Set getBBeans();


      BBean
      /**
      * @ejb.interface-method
      * @ejb.relation name="BBean-ABean"
      * role-name="BBean-belongs-to-ABean"
      * cascade-delete="no"
      * @jboss.relation fk-constraint="true"
      * related-pk-field="id"
      * fk-column="idA"
      **/
      public abstract ABeanLocal getABean();

        • 1. Re: CMR sorted?
          aloubyansky

          No, ordered CMR are not supported. It's not enough to keep a CMR collection ordered by loading it with SQL ORDER BY. The collection should maintain the order when you add/remove elements. You have to handle this yourself.