I have a Entity Class like this
@Entity
@Table(name = "USER")
public class Users {
...
}
During production deployemnt i want to read from this user table. But during Stage Environment deployement i want to read from USER_STAGE table.
@Entity
@Table(name = if (env=='prod') ? "USER" : "USER_STAGE")
public class Users {
...
}
How can i achieve this with out any service level logic?