I'm using Spring with Hibernate in my project. Because of secrecy reasons we need to run a procedure before retrieving objects from the database. The procedure sets the user privileges in the db, so that when the call to the db is done, it retrieves the appropiate data for that user. It is not a question of changing user in every call, just a question of running a procedure before every call.
In order to call this procedure (before my HibernateTemplate executes any method) i'm trying to use Preinterceptors, which i haven't used yet and i'm not sure if i'm using correctly or even if they're the right solution.
Can anyone give me advice on this matter? if the interceptors are the right option, how can i call the method that calls the procedure?
<bean id="explorerSearchService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<prop key="get*">PROPAGATION_REQUIRED, readOnly</prop>
<bean id="authorise" class="com.csfb.fao.clr.backend.dao.hibernate.Auth orizationInterceptor">
My class AuthorizationInterceptor implements Interceptor and contains a method called setClientIdentifier() that it's supposed to run the procedure. Everything compiles, but the method is never called. what am i doing wrong?