开发者

Nhibernate Common columns in base class

开发者 https://www.devze.com 2022-12-19 21:09 出处:网络
I want to design following scenario Base class (Id, Name, order, Value) 3 Derived classes derive1, derive2, derive3 inheriting properties from base

I want to design following scenario

Base class (Id, Name, order, Value)

3 Derived classes derive1, derive2, derive3 inheriting properties from base

There is no table for base class. And 1 table for each derived class. 3 tables have same columns.

How can I create mapping file ignoring base class? Do I need to create 1 mapping file for each derived class? can I achieve this using o开发者_开发百科nly 1 mapping file?


You need 3 mapping files. Check out this reference:

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/inheritance.html#inheritance-tableperconcrete

0

精彩评论

暂无评论...
验证码 换一张
取 消