Why is NHibernate creating a table without primary key?

丶灬走出姿态 提交于 2019-12-07 00:53:33

The table is not mapped as an entity and as such will never be fetched from the database by itself, therefore NHibernate does not need and will not create a primary key for that table.

Edit:

If you want to have a primary key in that table I suggest adding an extra column for that. Using ParamId as a primary key will not work for you. NHibernate will create the table with a primary key, if you create a class and a corresponding mapping file for RouteParams.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!