I am trying to set the name of my tables in the entities using parameters from the application.yml
This is the entity
:
@Entity
@Table(name = "${database.tableName}")
public class enitityName {...}
And this would be the application.yml
:
database:
tableName: entityName
This doesn't work to me. Is there any way to achieve this? Can someone give me some ideas?
I need to do it because i have the tables for my differents enviroments in the same database, so the name of the tables are like these: table_test
, table
. And they would be the same class
in my code
Thanks