Hi, when I have following classes and mappings:
Code:
class Party {
int id;
List taxPayers;
... getters and setters.
}
class TaxPayer {
int id;
Party party;
... getters and setters.
}
Party.hbm.xml:
Code:
......
<list name="taxPayers" inverse="true" cascade="save-update">
<key-column="party_id" not-null="true"/>
<list-index column="id"/>
<one-to-many class="TaxPayer"/>
</list>
TaxPayer.hbm.xml:
Code:
....
<many-to-one name="party" column="party_id" class="Party" not-null="true"/>
Following Query gives me some strange result:
Code:
Query query = session.createQuery("select p from Party p inner join p.taxPayers where something like ?").setString(0, "some value");
List result = query.list();
Result list is populated with
first 3 null objects then with good object. Why?
Thanks a lot.
Andrija.