jakartaee / persistence

https://jakartaee.github.io/persistence/
Other
196 stars 58 forks source link

Configurable persistence.xml #357

Open hantsy opened 2 years ago

hantsy commented 2 years ago

Consider to integrate Config spec and make the item in the persistence.xml can be configured as expression language.

<jta-data-source>${app.jndi.dataSource}</jta-data-source>

BTW, consider environmental variants for the persistence.xml.

For example,

  1. Configure profile in the persistence.xml.

    <persistence-unit profile="prod" ....>
  2. profile based file naming. eg. persistence-default.xml , persistence-prod.xml , persistence-openshift.xml .