jakartaee / jakartaee/common-annotations-api
Allow use EL in DataSourceDefinition
- Dominant language
- Java
- Stars
- 67
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Currently, Payara/GF and WildFly add reading env variable support in `DataSourceDefinition`, but it is better to support standard EL in the `DataSourceDefinition` properties.
eg.
Read from system properties or system environment variables. The `web.xml/data-source` has already supported this way, not sure why not defined the same behaviour in this annotation.
```java
@DataSourceDefinition(name="bookstoreDs",
className="#{env.DS_CLASSNAME}",
port="#{env.DS_PORT}",
host="#{env.DS_HOST}",
user="#{env.DS_USERNAME}",
password="#{env.DS_PASSWORD}",
)
```
Read from Jakarta Config properties or Java system properties.
```java
@DataSourceDefinition(name="bookstoreDs",
className="#{datasource.classname}",
port="#{datasource.port}",
host="#{datasource.host}",
user="#{datasource.username}",
password="#{datasource.password}",
)
```
Contributor guide
Research direction
Start by locating DataSourceDefinition and comparing its property handling with the existing web.xml/data-source behavior. Trace how annotation properties are consumed, then determine how standard EL should resolve environment, system, and Jakarta Config values. Done means the example className, port, host, user, and password expressions resolve consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100