Explicit notes on class/method-level semantics in class hierarchies
Issue: SPR-17445
(cherry picked from commit ea3250c8d6)
This commit is contained in:
@@ -1090,6 +1090,12 @@ following class definition:
|
||||
}
|
||||
----
|
||||
|
||||
Used at the class level as above, the annotation indicates a default for all methods
|
||||
of the declaring class (as well as its subclasses). Alternatively, each method can
|
||||
get annotated individually. Note that a class-level annotation does not apply to
|
||||
ancestor classes up the class hierarchy; in such a scenario, methods need to be
|
||||
locally redeclared in order to participate in a subclass-level annotation.
|
||||
|
||||
When the above POJO is defined as a bean in a Spring IoC container, the bean instance
|
||||
can be made transactional by adding merely __one__ line of XML configuration:
|
||||
|
||||
@@ -1115,6 +1121,7 @@ can be made transactional by adding merely __one__ line of XML configuration:
|
||||
|
||||
<!-- enable the configuration of transactional behavior based on annotations -->
|
||||
__<tx:annotation-driven transaction-manager="txManager"/>__<!-- a PlatformTransactionManager is still required -->
|
||||
|
||||
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<!-- (this dependency is defined somewhere else) -->
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
|
||||
Reference in New Issue
Block a user