0

I have legacy database. I need to add nhibernate but for several columns in a table. How can I make nhibernate not to complain that there are no properties for some columns. In the future it is possible that new columns will be added, but they are not needed in my project. How can I do this ?

Regards, Darko

4

2 回答 2

1

如果这些数据库列可以为,或者它们具有默认值,那么您应该不会有任何问题。当您考虑它时,当您尝试对表执行 SQL INSERT 时也是如此。

只需将您需要的列映射到类的属性。

于 2012-08-26T17:07:42.887 回答
1

如果您只需要阅读,请不要映射它们;

否则,如果需要写入它们,则需要映射它们(如果它们不可为空或没有默认值),以便提供数据库所需的值。

于 2012-08-26T17:10:17.200 回答