0

Below is my entity class,here i want to access the table name dynamically at run time. Is it possible to access different table with same entity?

I have used following link to solve the problem but no use. Hibernate: Data Object with a dynamic table name by Annotations

Please guide me to solve this problem?

@Entity
@Table(name="tableName")
public class TestClass{

@Column(name="idPerson", nullable=false, unique=true)   
@Id 
...
StanislavL
  • 56,971
  • 9
  • 68
  • 98
Jeeva Raj
  • 3
  • 5
  • Maybe this answer can help: https://stackoverflow.com/questions/16755260/hibernate-two-tables-per-one-entity – Oles Pankiv Aug 22 '17 at 09:51
  • Thank for your reply. Actually every year the new table will be created, at runtime only i will come to which is going to be accessed. This is my problem. – Jeeva Raj Aug 22 '17 at 11:49

0 Answers0