hi j�rgen,

this works for me:

    <collection-descriptor
        name="konti"
        orderby="saldo"
        sort="ASC"
        element-class-ref="brj.ojb.Konto"
        proxy="false"
        refresh="true"
        auto-retrieve="true"
        auto-update="false"
        auto-delete="true"
        >
        <inverse-foreignkey field-ref="idPerson"/>

</collection-descriptor>

results in the following sql:

SELECT A0.idPerson,A0.saldo,A0.nummer,A0.id FROM tabKonto A0 WHERE A0.idPerson = '2' ORDER BY 2

ordered by the second column (saldo).

the problem in your case is the abstract superclass ! ojb executes a select (including order by) for _each_ of the concrete classes, thus it can _not_ sort the whole result.

jakob

Juergen Ebert wrote:

Hi,

I defined a collection-descriptor, where the element-class is an abstract superclass containing the primary key field 'oid'. However, if I try to sort by this field, OJB ignores the orderby attribute and returns the elements in the sequence in which their corresponding concrete classes are defined in the extent definition. I'm using OJB RC4.

Is this a bug or am I missing something?


<collection-descriptor name="elements" element-class-ref="conv.bo.LvObject"
orderby="oid" sort="ASC"


 <inverse-foreignkey field-ref="parentId"/>
</collection-descriptor>

<class-descriptor class="conv.bo.LvObject">
 <extent-class class-ref="conv.bo.LvGroup" />
 <extent-class class-ref="conv.bo.LvText" />
 <extent-class class-ref="conv.bo.LvPosition" />
</class-descriptor>

Greetings,
J�rgen

__________________________________________________________________________
Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter,
Adressverifizierung, digitale Unterschrift: http://freemail.web.de


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to