0

I have a rather large class hierarchy that I'd like to use table per hierarchy with, but with a slight twist. My hierarchy looks like:

Event --> [specific_events] --> Transaction --> [specific_transactions]

I'd like to split this hierarchy into two tables, Event and Transaction. However, all transactions are events, and I believe NHibernate will attempt to put the entire hierarchy in the Event table.

How can I tell it to split the hierarchy between Events and Transactions?

EDIT: I got the hierarchy slightly wrong. All specific_events derive from Event and all Transactions derive from Event, not specific_events.

Event --> [specific_events]
Event --> Transaction --> [specific_transactions]
4

1 回答 1

0

It is not possible as I know. Why do you want to split them in 2 different tables?

Also there is a very good explanation about different strategies for hierarchy mappings in NHibernate in Action book. It helped me a lot.

于 2012-04-03T21:26:33.347 回答