Association on parent delete cascade
Joined: 15 Dec 2018
Topic: Association on parent delete cascade
Posted: 05 May 2019 at 4:40pm
on relationship options I set on parent delete - cascade and export to aurelius classes.
Below the produced code
[Association([TAssociationProp.Lazy], CascadeTypeAll - [TCascadeType.Remove])]
[JoinColumn('PERFORMANCEID', , 'PERFORMANCEID')]
However at sql server the relationship that is created on delete rule has none and no cascade that it should be.
As a consequence when I delete the master record I got an relationship error from sql server.
Is this a bug, or my misundestanding?
Wagner R. Landgraf
Joined: 18 May 2010
|Post Options Quote Reply Posted: 07 May 2019 at 3:56pm|
TMS Aurelius doesn't create foreign keys with ON DELETE CASCADE.
The TCascadeType.Remove simply indicates if Aurelius itself should delete the associated record in PERFORMANCE table if the parent object is deleted. Aurelius does it manually.
If you removed TCascadeType.Remove from the Association, you will have to do it yourself.
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum