Hi,
While looking at the NHibernate documentation I noticed it does not support collections (one-to-many) in the case the foreign key does not accept nulls without using a bi-directional association. I think this feature in Hibernate 3.0 is very important and simplifies the object model when a reference to the parent is not needed. The approach in Hibernate 3.0 of adding a "not-null=true" to the key definition is simple and does exactly what is needed to do:
Code:
class A {
...
ISet children;
}
class B {
...
}
<set name="children">
<key column="A" not-null="true">
<one-to-many class="B">
</set>
Using a bi-directional association is not the best solution in many cases:
- It adds complexity to the object model (reference to parent)
- It adds complexity to the code using the object model (reference to parent must be explicit set at the time of adding a child to the collection)
Is there any plans to add this to NHibernate in the near future?
How complex is to add a similar solution to NHibernate?
Thanks,
RJB