শনিবার, ১৬ নভেম্বর, ২০১৩

Advantage of @Repository stereotype in Spring

Advantage of @Repository stereotype in Spring

1. @Repository is also a @Component and thus you can use component scanning to automatically detect your @Repository annotated beans and register them in the ApplicationContext.

2.  will get automatic exception translation not mere logging.

3. The exceptions for all persistence exceptions are converted to the consistent spring DataAccessException hierarchy so that  you only need to handle 1 kind of exception even you use  multiple strategies (often you mix hibernate/jpa with plain jdbc)

4.  Need less configurable.