Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logical delete impl

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
When I delete entity I set "is_deleted" flag to true,
On each entity we have the @where(clause="not deleted") annotation,
Now I got new feature to display deleted entities,

is this mean I have to drop the @where annotation and use other implementation for logical delete?
Please advice
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the new feature makes you query deleted entities only in that particular use case or it affects the general behavior of the entity loading.
I'm not personally that great fan of annotations so have never attempted it.
You can try one of these,

1. Check if you can specify the entity manager to disable or neglect (by overriding or passing a value to omit the "@where" annotation) it.
2. If you can't try the same for that particular session.
3. If it is going to affect all, then we can move all common annotations to particular parent class and made all you classes inherit it. Disable it in the particular sub-class.
4. Worst case, extend the class and disable/override the "@where" clause.

These are just general ideas, but since I'm not that annotations savvy, you might need to consult someone before using it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic