title: JPA, How to use the same class (entity) to map different tables?
body: <p>I have two tables: <code>Ta</code> and <code>Tb</code>. They have exactly the same table structure but different table names.</p>
  
  <p>I try to create one entity class to map the table structures.  Some of my common application modules will use this entity class to dynamically query and update either <code>Ta</code> or <code>Tb</code> based on parameters.  Can it be done in JPA?  How can I write the program to dynamically mapping the entity class to different tables at run time?</p>