I am developing a generic CRUD app , that can edit any Spring/JPA entities with a AbstractDao pattern's implementation , such as UserDaoImpl , ForumDaoImpl ...etc
In my wicket page : I have to use @SpringBean to identify which PlatformTransactionManager to use , such as : @SpringBean(name="transactionManagerUser") private PlatformTransactionManager transactionManagerUser; private TransactionTemplate txTemplate; public CrudPage(final PageParameters pps , final AbstractDao<T> dao) { super(pps); txTemplate= new TransactionTemplate(transactionManagerUser); } The problem is , these DAOs are using different transaction managers , such astransactionManagerUser , transactionManagerForum ...etc. I cannot hard-code these txManager's name in my code. I have to programmatically get the dao's txManager . How to achieve that ? Thanks a lot ! Environments : Spring 3.0.5 , Hibernate-3.6 , JPA2