This makes sense if you want your business logic to be responsive to specific types DataAccessException, independent of Morphia / Mongo types.
The easiest way to do this is to write a class that implements PersistenceExceptionTranslatorand that knows how to translate Morphia / Mongo exceptions into DataAccessException. Declare this class as a bean, and Spring will automatically ask it to throw exceptions if your DAO class is annotated with @Repository.
However, if your business logic or exception handling logic really doesn't care about what type of exception will be thrown, then there seems to be little point.
source
share