There are three things you can do.
The legal way is to do a subselect:
Code:
<set name="children"...>
<subselect>select c.* from Child c inner join Parent p on c.ParentId = p.Id and c.SEQ_NUM = p.SEQ_NUM</subselect>
.....
</set>
Which is quite performance inefficient. Second option is write a custom loader which is both legal and efficient. The third option is to use hibernate generated aliases in the where property:
Code:
<set ..... where="parent_0.SEQ_NUM = child_0.SEQ_NUM" ...>
if you are wondering what the alias is going to be you need to run hibernate once and see the generated sql. However, this is cheating and since cheating is not a good thing you will be nailed at some point some how. So use this at your own responsibility or make sure you leave the company before they decide to upgrade hibernate jars.
Farzad-