Mar 15th, 2013, 01:18 PM
@Repository and <mongo:repositories base-package/>
Should I use @Repository on my beans inside mongo:repositories base-package?
All of my repository beans extends MongoRepository, so they will be detected by mongo:repositories instruction, although I'm not sure about automatic exception translation (should I add @Repository for each of my repository bean), and will it work just with mongo:repositories? I use <context:component-scan base-package/> to activate @Repository lookup, but component-scan base-package is different from mongo:repositories base-package.
1. will mongo:repositories handle nicely @Repository annotation on my MongoRepository beans?
2. if yes, than will it provide automatic exception translation for my beans, or this is done by default, and I don't need @Repository at all.
Mar 18th, 2013, 07:49 AM
You don't need @Repository. The exception translation is automatically applied on the MongoTemplate level so that the repositories benefit from it transparently.
Tags for this Thread