Reputation: 3696
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"
Upvotes: 1
Views: 82
Reputation: 52725
It's simple:
HasMany(x => x.YourCollection).Inverse().ForeignKeyCascadeOnDelete();
Upvotes: 2
Reputation: 61
On the column, use Cascade.Delete()
, there's other options as well.
Upvotes: 1