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!