Can you support read config from spring boot application.properties?
See original GitHub issuelike this(application.yml):
spring:
datasource:
# ...
jpa:
showSql: true
hibernate:
ddlAuto: validate
properties:
javax:
persistence:
sharedCache:
mode: ALL
hibernate:
cache:
use_second_level_cache: true
use_query_cache: true
transaction:
factory_class: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
region:
factory_class: org.hibernate.cache.redis.SingletonRedisRegionFactory
redis:
expiry_in_seconds: 0 #秒
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Spring Tips: Configuration
The first step for most Spring Boot developers is to use application.properties. The Spring Initializr even puts an empty application.properties ...
Read more >Springboot all possible ways to read props from Configuration ...
Reading a single property · Read bunch of properties then use can use @ConfigurationProperties. · Read entire YML/Property file.
Read more >Spring Boot Read Values from Application Properties File
using @Value annotation in a non-Spring class has no effect. It can be used only in @Component, @Service, @Configuration classes; You can't bind ......
Read more >Properties with Spring and Spring Boot - Baeldung
Boot applies its typical convention over configuration approach to property files. This means that we can simply put an application.properties ...
Read more >Reading application.properties in Spring Boot
Another way to read application properties in the Spring Boot application is to use the @ConfigurationProperties annotation. To do that, we will ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I will make it.
@Dreampie With the current pull request, I made it possible to configure hibernate via the “default” properties mechanism instead of the usage of an additional hibernate.properties file. In my use case, I am working with spring property files instead of yaml configuration which working fine. I guess that it should also work with yaml files because Using YAML instead of Properties is a feature of spring. However I have not try it and also did not investigate the spring sources regarding this.
Regarding the redis configuration. In my humble opinion it is good to keep the library framework independently. So I decided to reuse the injected properties instead of fetching any settings from the RedisCacheManager because this required an additional spring dependency. However @debop , as project owner, can give us a clear statement.
The next step I am going to reach is, that it is no more required to provide a redisson.yaml file. I try to find a solution that the settings contained in the redisson.yaml file can also used from files, maintained by spring. However this issue was not part of the pull request #67 .