From: Christoph S. <ch...@mc...> - 2002-09-19 13:56:35
|
Hi All! I have 2 tables that have a n:m relation through a matchtable. table1 contains a definition like this: <list role=3D"categories" table=3D"tema_x_vtrm" lazy=3D"true"> <key column=3D"vtrmid"/> <index column=3D"srtpos"/> <many-to-many class=3D"at.mcg.clubticket.db.Tema" = column=3D"temaid"/> </list> and I'd like my elements to be sorted by srtpos. so I have to write select table from vtrm in class Table, cat in table.categories.elements = where cat.id =3D 2 order by cat0_.srtpos, because hibernate joins the matchtable as "cat0_". Now I dont like this, = because its an implementation detail that could change.=20 I often think that I dont understand all parts of the query language, so = maybe there's an easy solution to this, and someone can enlighten me ;) regards chris |