Table per concrete class (union subclass)

brandonbehrens's Avatar

brandonbehrens

12 Apr, 2010 03:39 PM via web

I saw this discussion on the topic, but it's closed:

http://support.fluentnhibernate.org/discussions/help/22-association...

I recently ran across a situation in our application where I needed this and had to resort to creating an hbm file. This is unattractive for obvious reasons. I've seen in a few places the only reason it's not in there is that nobody has really needed it yet. Is that still the current thinking or is there something particularly difficult with the implementation that's prevented its inclusion?

A real quick description of our issue:

Previously, we were using the table per class hierarchy strategy. This gave us one table called parent with child a and child b types. Our classes are now sufficiently different such that we want child a and child b. We do not want the parent table because the vast majority of our queries don't involve both types and we don't want to do a join every time we retrieve an item. We do however, require implicit polymorphism. The union subclass appears to be what we're after, so for the time being, I've created an hbm file that takes care of it and I manually include it.

Thanks in advance.

    Comments are currently closed for this discussion. You can start a new one.