-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to change the way hibernate deletes entities?
PostPosted: Wed Apr 04, 2007 5:17 pm 
Newbie

Joined: Wed Apr 04, 2007 5:02 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.3 (in JBoss4.0.5)

Mapping documents: anntoations

Name and version of the database you are using: MSSQL 2005 Express

Hi there,

I was wondering if there is a generic / well known / best practice to archieve the following:

One requirement in my current project is that most entities (lets call 'em dbitems) shall just be set inactive when deleted. I guess this is not too uncommon and sometimes even handy when it comes to constraints and nasty cascades.
For now I just added a (@)Where clause (active =1) to all queries, named queries and mapped collections in order to exclusively load the active entries. I also changed the way my (Seam) home objects delete dbitems, by just setting active to 0. Slowly but surely this gets really ugly and hard to maintain.
I know about @SQLDelete in the latest release, but afaik it only takes plain sql which won't work on a @MappedSuperClass I guess. I also tried @Loader on a mapped superclass which I had the impression was not even noticed by hibernate...

Even the slightest suggestions, ideas or hints are greatly appreciated...

Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.