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
2009-07-03 22:07:29
is there a way to do it without the annotation?
tobsen
2010-03-05 20:40:39