|
Hi All!
I have 2 tables that have a n:m relation
through a matchtable.
table1 contains a definition like
this:
<list
role="categories" table="tema_x_vtrm"
lazy="true">
<key column="vtrmid"/> <index column="srtpos"/> <many-to-many class="at.mcg.clubticket.db.Tema" column="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 =
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.
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
|
