Hi all, I had a problem about the mapping the one-to-many collection to NHibernate:
Suppose I had 2 entity A and B:
create table A (id int primary key);
create table B (id int primary key, aid int not null reference A);
A.hbm.xml
Code:
<set name="Bs" lazy="true" cascade="save-update" inverse="false">
<key column="aid"/>
<one-to-many class="A, test"/>
</set>
B.hbm.xmlCode:
No A related mapping in B, seems it is one way association
When I insert A, it will save B also, but I found that aid will not inserted to B. So it cannot be inserted, No this kind of problem when using inverse="true".
Did anyone know how to solve this problem?[/b]