views:

143

answers:

2

How would I go about mapping three classes to one table with fluent NHibernate. A "Type" column should indicate which class should be mapped. Is it even possble?

  • Kristoffer
A: 

Are you in a situation where your data could be normalized? What you're trying to do seems like a dead giveaway that this is the actual problem.

Jon Seigel
Well, I'm basically just curious. I was thinking about how I could denormalize the database (for increased performance) without touching the object model.
Kristoffer
+2  A: 

It's certainly possible, assuming that your classes extend a common base class. This is called table-per-class strategy and instructions on how to map it are in the documentation.

Jamie Ide
Thanks! The're is an example of it at the end of the documentation.The properties are not virtual in the documentation, but they must be.
Kristoffer

related questions