I'm not an advanced NHibernate user, so this may be somewhat important, and I just didn't discover it yet.. but what the heck.
Consider the class:
public class House
{
public int Id { get; set; }
public ISet<Room> Rooms
{
get;
set;
}
}
When specifying NHibernate Set element it's not enough to write:
<set name="Rooms" />
Instead I have to write at least:
<set name="Rooms">
<key column="RoomId"/>
<one-to-many class="Room"/>
</set>
This seems to be a violation of DRY principle. If it's a Set the default should be that it's a one-to-many relationship. The class should be inferred from generic type of the collection and as the key column, primary key of collection element's class should be used.
This seems to me like a reasonable defaults. Why then, NHiberbate is not smart about it, and requires me to type these extra 3 lines?