0
在從書春的例子在行動中,我發現事務管理的該配置是通過嵌套類實現?是否有比較像標準@Bean方法有什麼區別:Spring事務configruation(豆VS內部類)
@Configuration
@EnableTransactionManagement
public class DbConfig {
//EntityManagerFactory, JpaVendorAdapter, DataSource @Beans
@Bean
public JpaTransactionManager createTransactionManager(EntityManagerFactory emf) {
JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
jpaTransactionManager.setEntityManagerFactory(emf);
return jpaTransactionManager;
}
}
或者它僅僅是關於分離的責任呢?