The PersistenceExceptionTranslatorPostProcessor automatically adds the PersistenceExceptionTranslationInterceptor to beans annotated with @Repository. The interceptor is the thing that takes care of the translation, and an interceptor is plain AOP. (You have to know a little of the internals for spring for this
).
You can also add the exception translation yourself by specifing a pointcut and the interceptor yourself.
Code:
<bean id="exceptionTranslationInterceptor" class="PersistenceExceptionTranslationInterceptor" />
<aop:config>
<aop:pointcut id="repositories" expression="execution(* com.your.package.*.(..))" />
<aop:advisor pointcut-ref="repositories" advice-ref="exceptionTranslationInterceptor" />
</aop:config>
Something like that...
The Spring reference guide is a must read and I suggest Spring in Action and/or Pro Spring 3 for Spring.