Hello again.
while trying to solve the issue i've mentioned here:
http://forum.hibernate.org/viewtopic.php?t=979668
I've also found this post, which looked promising:
http://sdesmedt.wordpress.com/2006/09/0 ... mment-2195
i want to do something similar to the first example. According to the author you can create a unidirection association between the 2 entities with the following hbm files:
<class name="UniDirectional.Customer, NHibernateOneToMany"
table="customer">
<!-- The usual things like an id tag -->
<bag name="OrderList" cascade="all">
<key column="CustomerId"/>
<one-to-many
class="UniDirectional.UOrder, NHibernateOneToMany"/>
</bag>
</class>
<class name="UniDirectional.UOrder,
NHibernateOneToMany"
table="`order`">
<!-- usual mapping members -->
</class>
what happens is that when nhibernate tries to generate the sql it won't generate the name of the foreign key, ie, it'll generate something like:
insert into order (number) @values(?)
and then it crashes since the idcustomer column isn't correctly filled.
I've managed to solve this by addind a bidirectional realtionship. However, that sucks and is not what i want. is there any way to generate a unidirectional relationship in the current release of nhibernate?
thanks