title: How to programmatically get PlatformTransactionManager of a DAO?
body: <p>I am developing a generic CRUD app with wicket , that can edit any Spring/JPA entities with a  AbstractDao pattern's implementation , such as UserDaoImpl , ForumDaoImpl ...etc</p>
  
  <p>In my wicket page :
  I have to use @SpringBean to identify which <code>PlatformTransactionManager</code> to use , such as :</p>
  
  <pre><code>@SpringBean(name="transactionManagerUser")
  private PlatformTransactionManager transactionManagerUser;
  private TransactionTemplate txTemplate;
  
  public CrudPage(final PageParameters pps , final AbstractDao&lt;T&gt; dao)
  {
    super(pps);
    txTemplate= new TransactionTemplate(transactionManagerUser);
  }
  </code></pre>
  
  <p>The problem is , these DAOs are using different transaction managers , such as <code>transactionManagerUser</code> , <code>transactionManagerForum</code> ...etc.</p>
  
  <p>I cannot hard-code these txManager's name in my code.
  I have to programmatically get the dao's txManager . How to achieve that ?</p>
  
  <p>Thanks a lot !</p>
  
  <p>------- updated -------</p>
  
  <p>Well , I've solved this problem by passing <code>PlatformTransactionManager</code> to the CRUD page ( and use <code>transactionTemplate = new TransactionTemplate(platformTransactionManager)</code> to generate a txTemplate ' , and it works well. Although not directly solve the problem , anyway , it works.</p>