common-annotations-api icon indicating copy to clipboard operation
common-annotations-api copied to clipboard

Allow use EL in DataSourceDefinition

Open hantsy opened this issue 4 years ago • 1 comments

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 Jakarta Config properties via System environment variables.

  @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.

  @DataSourceDefinition(name="bookstoreDs",
      className="#{datasource.classname}",
      port="#{datasource.port}",
      host="#{datasource.host}",
      user="#{datasource.username}",
      password="#{datasource.password}",
    )

hantsy avatar Nov 30 '21 03:11 hantsy

I am not sure why this annotation is not located in Jdbc.

hantsy avatar Nov 30 '21 03:11 hantsy