-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Feature request
PostPosted: Thu May 25, 2006 12:04 pm 
Newbie

Joined: Thu Mar 02, 2006 11:45 am
Posts: 5
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.