Print Page | Close Window

Association on parent delete cascade

Printed From: TMS Software
Category: Business Tools
Forum Name: Data Modeler
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=13371
Printed Date: 25 May 2020 at 11:11pm


Topic: Association on parent delete cascade
Posted By: VRACHIOLIS NIKOLAOS
Subject: Association on parent delete cascade
Date Posted: 05 May 2019 at 4:40pm
Hi all,

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')]
    FPERFORMANCEID: Proxy<TPERFORMANCE>;

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?

Regards,
Nikos





Replies:
Posted By: Wagner R. Landgraf
Date 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.



Print Page | Close Window