'Spring JPA @Table schema, get value from applicaiton.properties
Is it possible?
I have tried with the sample code below but not working.
I want to set the value to the schema as a dynamic value gets from application.properties.
Or have any solutions?
@Entity
@Table(schema = "${test-scname}", name = "XXX")
public class ABCTable implements Serializable {
private static final long serialVersionUID = -7418875659416987527L;
@Id
private Long id;
private String name;
}
In application.properties
test-scname=ABC
JPA LOGS
Hibernate:
select
abctable0.ID as id1_0,
abctable0.NAME as name2_0
from
${test-scname}.XXX abctable0
where
abctable0.ID=?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
