Do you have to specify the table for an abstract and table-less baseclass when using union-subclass with NHibernate?

37 views
Skip to first unread message

Peter

unread,
May 25, 2012, 6:05:36 AM5/25/12
to nhu...@googlegroups.com
In this post, Ayende explains an approach for inheritance using union-subclass. I noticed in the mapping, he added a 'table' attribute to his abstract Party class mapping. In the image below it, where he shows the database schema, there is no such table however.

So, when using union-subclass, where your base class doesn't map to a separate table, is specifying the table necessary? Or will NHibernate just ignore whatever you specify?

I posted this on StackOverflow, but we now chose a different approach. If nobody answers the question, I might just remove it from SO, but I'm still curious for the answer.

Ricardo Peres

unread,
May 25, 2012, 11:26:19 AM5/25/12
to nhu...@googlegroups.com
Peter,

AFAIK, union-subclass corresponds to the Table Per Concrete Class/Concrete Table Inheritance (http://martinfowler.com/eaaCatalog/concreteTableInheritance.html) pattern, which, as it name implies, only needs tables for the actual concrete classes. So, I assume it was a mistake.

RP

Peter

unread,
May 29, 2012, 4:00:24 AM5/29/12
to nhu...@googlegroups.com
Thanks Ricardo.

Op vrijdag 25 mei 2012 17:26:19 UTC+2 schreef Ricardo Peres het volgende:
Reply all
Reply to author
Forward
0 new messages