In xml you can do the following
Code:
<bean id=“persistenceExceptionInterceptor”
class=“org.springframework.dao.support.
PersistenceExceptionTranslationInterceptor”/>
<aop:config>
<aop:advisor pointcut=“execution(* *..*Repository.*(..))”
advice-ref=“persistenceExceptionInterceptor” />
</aop:config>
This will use AOP pointcut expression that you write to match your dao classes, then Spring will create a proxy to wrap around your daos with the PersistenceExceptionTranslationInterceptor added to the proxy. Basically the same end result as using @Repository and <bean class=“org.springframework.dao.annotation.Persiste nceExceptionTranslationPostProcessor”/>
Hope that helps
Mark