tags:

views:

471

answers:

1

I have configured my application context as stated in the spring documentation to enable Exception Translation from jpa exceptions to spring DataAccessException. Should I also provide the implementation of PersistenceExceptionTranslator? If so, can anyone give me an example of how this is done?

+1  A: 

I do it only by putting the @Repository annotation on my DAO or Manager class that uses the EntityManager. Make sure that you enabled component scanning:

<context:component-scan base-package="org.example"/>
Gaël Marziou
is there a way to do it without the annotation?
tobsen