The next version of JPA will allow specifying the FQN of a CDI annotation in persistence.xml, so that an EntityManager injection point can be qualified with that annotation to have specific persistence unit injected. See https://in.relation.to/2024/08/20/cdi-jpa/.
Since persistence.xml is not used much in Quarkus, and in any case discouraged in favor of application.properties, we should perhaps think of a similar feature in application.properties. And while we're at it, not limit it to
cc @gavinking
Implementation ideas
We could go with a simple transposition of the JPA feature to application.properties:
Though in that case, I don't see why we wouldn't go for full-blown stereotype support: #42488
I'm not sure what the pros and cons of each solution would be. They seem pretty similar to me, especially with Quarkus interpreting configuration at build time. The second one is perhaps a bit simpler as it only impacts one file (Users.java) as opposed to two with the first solution (Users.java + application.properties).
Description
The next version of JPA will allow specifying the FQN of a CDI annotation in
persistence.xml
, so that anEntityManager
injection point can be qualified with that annotation to have specific persistence unit injected. See https://in.relation.to/2024/08/20/cdi-jpa/.Since
persistence.xml
is not used much in Quarkus, and in any case discouraged in favor ofapplication.properties
, we should perhaps think of a similar feature inapplication.properties
. And while we're at it, not limit it tocc @gavinking
Implementation ideas
We could go with a simple transposition of the JPA feature to
application.properties
:Or we could go with a (perhaps more generic) limited stereotype feature:
Though in that case, I don't see why we wouldn't go for full-blown stereotype support: #42488
I'm not sure what the pros and cons of each solution would be. They seem pretty similar to me, especially with Quarkus interpreting configuration at build time. The second one is perhaps a bit simpler as it only impacts one file (
Users.java
) as opposed to two with the first solution (Users.java
+application.properties
).