简体   繁体   中英

Database “on delete cascade” mapping

Anybody know if fluent NHibernate can be used to generate keys with "on delete cascade", when using XML mappings for NHibernate it is called "on-delete='cascade'".

Reason I want this is that the other end of my mapping holds a large blob so it would be convenient if it just "disappeared"

这很简单:

HasMany(x => x.YourCollection).Inverse().ForeignKeyCascadeOnDelete();

在列上,使用Cascade.Delete() ,还有其他选项。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM