-->
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: Design problem: need to inject extra sql statements / transp
PostPosted: Tue Feb 21, 2006 5:29 am 
Newbie

Joined: Mon Dec 22, 2003 4:49 am
Posts: 16
Hi,

I would like to have your input on the following problem:

I need to retrieve data from the database which have all a common sql suffix. The common suffix part is used to retrieve data that passes the permission / security suffix

So for example (simplified) I need to do the following:

select * from tableA where <user has rights to read data in the collection>

This query should return only the records for which the security passes, so based upon the security sql suffix.

Now I'm looking for a way to inject this security suffix query, because I just want to write my statements like this:

select * from tableA

without having to specify the rest, keeping things kiss.

I already looked at filters (hibernate3), but those things need to be specified per class, per collection, which I find not very maintainable! Also it seems that teh filter def only specifies the params and you still need to specify the condition per class / collection?

So I was looking for a way to inject the suffix just before the query is executed, is this possible, which approaches can be taken?

Suggestions...

Grtz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 5:40 am 
Newbie

Joined: Wed Aug 03, 2005 11:04 am
Posts: 10
Perhaps the Interceptor could help you. You need to pass it when getting the Session from the SessionFactory. Look at the onPrepareStatement method:
http://www.hibernate.org/hib_docs/v3/ap ... ang.String)

Beware: the Interceptor API got extended over time, so check which API your Hibernate version has!


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.