Enable isolation of config properties into a separate POJO
See original GitHub issueHi,
i think it would be a nice feature to add another annotation e.g. @ConfigProperties
which would allow injecting a group of properties with the same prefix into a separate POJO. This would reduce the amount of @Inject
and @ConfigProperty
annotations and would allow better usage of the same set of properties across multiple classes.
microprofile-config.properties:
person.data.firstName=John
person.data.lastName=Smith
Example class:
@ConfigProperties(prefix = "person.data")
public class PersonData {
private String firstName;
private String lastName;
...
}
Referencing PersonData:
public class Person {
@Inject
private PersonData personData;
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:23 (14 by maintainers)
Top Results From Across the Web
Guide to @ConfigurationProperties in Spring Boot - Baeldung
The official documentation advises that we isolate configuration properties into separate POJOs. So let's start by doing that:
Read more >Binding external configurations to POJO classes - CalliCoder
Enter config-properties-demo in the Artifact field. · Set Package name to com.example.demo · Add Web and Validation in the dependencies section.
Read more >Use application.properties in a non-spring injected class
You can start by isolating configuration properties into separate POJOs. Then let spring boot inject the values into the POJO. You can use...
Read more >Externalized Configuration of Spring Boot application with ...
The official documentation advises to isolate the configuration properties in separate POJOs. If you define a set of configuration keys for ...
Read more >3.4. Optional configuration properties
There are a number of other properties that control the behaviour of Hibernate at runtime. All are optional and have reasonable default values....
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
Issue with a pojo is you cant do much and actually just stay on the existing features whereas a proxy enables to:
Getters are then not needed at all and you just used methods, trivial model and efficient 😃
Need to reopen this for further update based on some feedback and discussion on the google group mailinglist.