Hi,
You have to add an alias for the table. Assuming the table is called Menu
and the relevamnt columns are ID and PARENT_ID, something like this should
work:
...
criteria.addAlias("parent", MenuPeer.TABLE_NAME);
criteria.addJoin("parent.ID", MenuPeer.PARENT_ID);
....
Thomas
"Kintzel Levente" <[EMAIL PROTECTED]> schrieb am 10.06.2005
09:51:47:
> Hi!
>
> I encoded a menu system in a database table. Each element has an ID,
> a Caption and the ParentID (the ID of the parent element in the menu
> item, it is an ID of an other record form the current table). Now I
> want to Join the table with him-self to make a list with the caption
> of the element and the caption of the parent element. Ok, that can
> be done without join, but I want to sort the lines of this list by
> the caption of the parent element. For this I think join is inevitable.
> Can anybody help me constructing this join? Thank you!
>
> Regards,
> Levy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]