1
我們有2個班,親子流利NHibernate的一對多父刪除
,家長有沒有提到孩子,孩子在其流利的映射下定義:
References(x => x.Parent, "Parent_id").Not.Nullable();
當父記錄被刪除時,會生成以下錯誤:
The DELETE statement conflicted with the REFERENCE constraint "FKFF68C21EE06905B9". The conflict occurred in database "DatabaseName", table "dbo.tblChild", column 'Parent_id'.
The statement has been terminated.
什麼是正確的映射,使家長的缺失,因爲父模型沒有共同財產選擇類型的孩子?