Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Association on parent delete cascade

 Post Reply Post Reply
Author
VRACHIOLIS NIKOLAOS View Drop Down
New Member
New Member
Avatar

Joined: 15 Dec 2018
Posts: 9
Post Options Post Options   Quote VRACHIOLIS NIKOLAOS Quote  Post ReplyReply Direct Link To This Post Topic: Association on parent delete cascade
    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


Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2270
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down