【发布时间】:2018-10-15 12:47:57
【问题描述】:
我有带有属性的 YAMl 配置文件:
send-executor:
thread-max-count: 5
我还有另一个财产:
ready-query: SELECT * From ...(another conditions).. where ROWNUM >= 5
我可以在ROWNUM >= 5我的另一个属性thread-max-count中设置5吗?
类似这样的:
ready-query: SELECT * From ...(another conditions).. where ROWNUM >= {$thread-max-count}
或者我需要设置占位符并仅在 java 代码中进行更改?
【问题讨论】:
-
您可以使用 @Value("${thread-max-count}") 然后在查询中使用该变量。
标签: spring-boot yaml spring-config