NHibernate: Map one class to two identical tables

前端 未结 1 399
长发绾君心
长发绾君心 2021-01-28 02:07

I need to map one entity to two tables (Invoice and InvoiceHistory). It\'s not up to me to merge the two database tables in one and add a status column to differentiate them.

1条回答
  •  面向向阳花
    2021-01-28 02:38

    Create another entity which inherits the first entity you created and does nothing else. You can then map the new entity to InvoiceHistory, while the first one is still mapped to Invoice.

    0 讨论(0)
提交回复
热议问题