Unmapped Columns in NHibernate?

后端 未结 5 927
梦如初夏
梦如初夏 2020-12-20 07:31

I\'m working with a legacy database in Oracle and some of my tables have columns that are set to NOT-NULL that I don\'t want in my domain model, but, obviously, I need to sp

5条回答
  •  误落风尘
    2020-12-20 08:15

    I always thought this kind of problems is best resolved with specifying a default value for a column.

    That way you can forget about it whatsoever and not implement some Interceptor, which even sounds scary.

    Heres sample SQL code: alter table with default value

    I am guessing that even though DB is legacy, you got some control over it since you can insert new rows. This is very cheap and lightweight solution.

提交回复
热议问题