Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have Support to Map #104

Open
otaviojava opened this issue Aug 2, 2022 · 1 comment
Open

Have Support to Map #104

otaviojava opened this issue Aug 2, 2022 · 1 comment

Comments

@otaviojava
Copy link
Contributor

I believe shortly that a Jakarta Configuration will be a glue to configuration such as CDI does to communicate among specifications.

It is essential to have a unique configuration for the whole specification, to get reliability, and reusability, to reduce the number of bugs, and so on.

Looking at several platforms, we have several configurations that require more than properties, such as JPA connection, NoSQL client, JMS connection, etc.

It will be terrific if we have support for a more dynamic type such as a Map<String, String>.

It uses the prefix as an injection, and then it will put a key/pair dynamically. So, given this properties:

# datasource configuration
jakarta.datasource.db-kind = postgresql
jakarta.datasource.username = hibernate
jakarta.datasource.password = hibernate
jakarta.datasource.jdbc.url = jdbc:postgresql://localhost:5432/hibernate_db
jakarta.datasource.properties.dyamic=123

Using the injection:

@Inject
@ConfigProperty(name="jakarta.datasource") 
private Map<String, String> map;

It will provide the following keys:

db-kind = postgresql
username = hibernate
password = hibernate
jdbc.url = jdbc:postgresql://localhost:5432/hibernate_db
properties.dyamic=123
@radcortez
Copy link
Contributor

Object mappings are expected to deal with complex objects (including Map<String, String> and even Map<String, CustomType> and other combinations.

See: #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants