An interface is implemented by more than one root-entity or no-root-entity, and thus by its own hierarchies, and it is used as a bidirection-one-to-manyTo explain the case I’ll use a chunk of Ayende’s nhibernate-blog-model a little bit complicated for the show-case.
Let me highlight some things:
- ITagable is implemented by two root-entities (two different hierarchies).
- In Blog and in Post the property Summary does not need to be persisted.
- Blog and in Post has a collection of Tag.
- Tag has a property of type ITagable where I can assign a Blog or a Post.
You can implements the class NHibernateInitializer as you want, what is important is that you have to create the DB using NHibernate without touch it by hands and then, obviously, you have to see right results.
One dream one soul one prize one goal
The mapping using ConfORM is:
When something exceeds your ability to understand how it works, it becomes magical.
ConfORM a kind of magic.