Deleting entities

Posts   
 
    
Chaos
User
Posts: 33
Joined: 13-Jul-2006
# Posted on: 13-Jul-2006 15:12:47   

Hi Support, Let me just bother you for a while. I'm using MS SQL 2005, generated code with LLBLGen Pro 2.0.0.0 from 28 june, adapter logic, UnitOfWork2.

So straight to the point, here I lay out my problem: Say i have a tree like structure - parent with nodes which have subnodes ...etc. This is done in the db by having a parentNode table, childNode table and a relation table, with all the needed relationships set.

And my question is - what shall I do if I want to delete whole branch of nodes - deleting the parent should result in deleting of its children too (and children's children etc) but its not. I tried out different variants - added for deletion (in the UOW2) the main relation entity from which I want deletion to begin and the parent node - did not work - raises exception and says - "An exception was caught during the execution of an action query: The DELETE statement conflicted with the REFERENCE constraint "FK_.....". The conflict occurred in database blah-blah..." What am I supposed to do? Add the whole chain of relations and entities in the proper order? (first the relations and then the entities?) Or should I design this chain deletion in the sql - cascade delete?

Regards, Chaos.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Jul-2006 15:36:33   

I would have defined cascade deletes in SQL.

Please check the following thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5180

Chaos
User
Posts: 33
Joined: 13-Jul-2006
# Posted on: 13-Jul-2006 16:06:35   

Thanx for the ref, quick answer and the advice.

And listen to Evergrey.

Regards, Chaos

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 13-Jul-2006 16:30:18   

Chaos wrote:

And listen to Evergrey.

From which song is your signature quoted (which I might add, ruins the layout of the forum a bit wink )

I find the last album pretty lame, my fav. is still In Search of Truth

Frans Bouma | Lead developer LLBLGen Pro
Chaos
User
Posts: 33
Joined: 13-Jul-2006
# Posted on: 13-Jul-2006 17:08:43   

Naah, William Blake? simple_smile Does this ring a bell?

Yeah, the last one is kind of powerless, pale, I guess too new wave. The Inner Circle is my choice. Check out the last Eternal Tears of Sorrow.

Steve Vai, Building the Church - Salutations

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 13-Jul-2006 18:01:33   

Chaos wrote:

Naah, William Blake? simple_smile Does this ring a bell?

Vaguely. I'm not a native english speaker so the 'English' we had at school was pretty boring learning words and phrases.

Yeah, the last one is kind of powerless, pale, I guess too new wave. The Inner Circle is my choice. Check out the last Eternal Tears of Sorrow.

Also a good album indeed. simple_smile

You should check out Symphony X's albums (V for example). My personal favorite band simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Gabbo
User
Posts: 56
Joined: 12-Jun-2006
# Posted on: 13-Jul-2006 19:57:54   

Otis wrote:

Chaos wrote:

Naah, William Blake? simple_smile Does this ring a bell?

Vaguely. I'm not a native english speaker so the 'English' we had at school was pretty boring learning words and phrases.

Yeah, the last one is kind of powerless, pale, I guess too new wave. The Inner Circle is my choice. Check out the last Eternal Tears of Sorrow.

Also a good album indeed. simple_smile

You should check out Symphony X's albums (V for example). My personal favorite band simple_smile

Very excellent band (I have two of their CD's). I saw them last year at a concert here in the US. You should also like Dream Theater and DragonForce.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 13-Jul-2006 20:25:48   

Gabbo wrote:

Otis wrote:

Chaos wrote:

Naah, William Blake? simple_smile Does this ring a bell?

Vaguely. I'm not a native english speaker so the 'English' we had at school was pretty boring learning words and phrases.

Yeah, the last one is kind of powerless, pale, I guess too new wave. The Inner Circle is my choice. Check out the last Eternal Tears of Sorrow.

Also a good album indeed. simple_smile

You should check out Symphony X's albums (V for example). My personal favorite band simple_smile

Very excellent band (I have two of their CD's). I saw them last year at a concert here in the US. You should also like Dream Theater and DragonForce.

Haven't heard of dragonforce, but I indeed have all dreamtheater's albums simple_smile Symphony X is a great band live, I saw them twice here in the Netherlands. It's a shame they're not a headliner though.

Frans Bouma | Lead developer LLBLGen Pro
Chaos
User
Posts: 33
Joined: 13-Jul-2006
# Posted on: 14-Jul-2006 09:07:01   

lol, what a band vortex, heh

OK, feel out Warmen & Imperanon. And Children of Bodom - anyone? Now that's what I am talkinbout, COB 97, 98, 2000 - spins your brain.