-->
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.  [ 2 posts ] 
Author Message
 Post subject: Is possible a general restriction?
PostPosted: Wed May 07, 2008 5:26 am 
Newbie

Joined: Mon Jul 23, 2007 4:20 am
Posts: 5
Location: Romania
Hi all, I was wondering if there is possible a general restriction for my database using hibernate.
What I mean is that in my database all my tables have some common fields.
For example deletedflag. So I was wondering if is there any way to exclude all these records in my business logic somehow. So for any query that I execute via hibernate, a new condition should be implied, with deletedflag=0.
This should be applied for all the joins too. I was hoping for some easy setting in hibernate-config or something like that were I could add conditions for all my tables but couldn't find any.
Thank you very much, for your response.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 1:11 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
I have not worked on it personally. But you may want to look at session.createFilter(). I am not sure though. I assume it can filter out data based on some condition. If you have a single place for creating sessions in your application, you may create a filter at that single place and the filter will be applicable for every session that is ever created. You also have options to enable and disable filters.

_________________
Sukirtha


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

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.