注释类型 TransactionConfiguration
@Deprecated @Documented @Inherited @Retention(RUNTIME) @Target(TYPE) public @interface TransactionConfiguration
已过时。As of Spring Framework 4.2, use@Rollbackor@Commitat the class level and thetransactionManagerqualifier in@Transactional.TransactionConfigurationdefines class-level metadata for configuring transactional tests.As of Spring Framework 4.0, this annotation may be used as a meta-annotation to create custom composed annotations.
- 从以下版本开始:
- 2.5
- 作者:
- Sam Brannen
- 另请参阅:
TransactionalTestExecutionListener,Transactional,Commit,Rollback,Sql,SqlConfig,SqlConfig.transactionManager(),ContextConfiguration
可选元素概要
可选元素 修饰符和类型 可选元素 说明 booleandefaultRollback已过时。Whether test-managed transactions should be rolled back by default.StringtransactionManager已过时。The bean name of thePlatformTransactionManagerthat should be used to drive test-managed transactions.
元素详细资料
transactionManager
String transactionManager
已过时。The bean name of thePlatformTransactionManagerthat should be used to drive test-managed transactions.The name is only used if there is more than one bean of type
PlatformTransactionManagerin the test'sApplicationContext. If there is only one such bean, it is not necessary to specify a bean name.Defaults to an empty string, requiring that one of the following is true:
- There is only one bean of type
PlatformTransactionManagerin the test'sApplicationContext. TransactionManagementConfigurerhas been implemented to specify whichPlatformTransactionManagerbean should be used for annotation-driven transaction management.- The
PlatformTransactionManagerto use is named"transactionManager".
NOTE: The XML
<tx:annotation-driven>element also refers to a bean named"transactionManager"by default. If you are using both features in combination, make sure to point to the same transaction manager bean — here in@TransactionConfigurationand also in<tx:annotation-driven transaction-manager="...">.- 默认值:
- ""
- There is only one bean of type
defaultRollback
boolean defaultRollback
已过时。Whether test-managed transactions should be rolled back by default.- 默认值:
- true