I am using JPA and I need to make the \"tableName\" a variable.
In a database, I have many tables, and my code needs to access the table where I specify it to read.
If you want only to reference/read the table name, it is possible as in the code below. If you want to change, it is not possible as Pascal said.
@Entity
@Table(name = Database.tableName)
public class Database implements Serializable {
public static final String tableName = "TABLE_1";//this variable you can reference in other portions of your code. Of course you cannot change it.
...............
}