Skip to content

Commit f30392e

Browse files
committed
attempt to respecify dataSource
to reflect what we're actually doing with this in practice
1 parent f086d0d commit f30392e

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

api/src/main/java/jakarta/data/repository/Repository.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,23 @@
100100
* Interoperability with Jakarta Config is reserved for future versions
101101
* of Jakarta Data.
102102
* </li>
103-
* <li>If running in a Jakarta EE profile or platform and the entity annotations
104-
* indicate a relational database and the value begins with {@code java:} and
105-
* matches the name of a {@code jakarta.annotation.sql.DataSourceDefinition},
106-
* the JNDI name of a data source, or a resource reference to a data source,
107-
* then the corresponding {@code javax.sql.DataSource} is used as the data store.
108-
* If the same conditions are met but the value matches a persistence unit
109-
* reference, then the corresponding {@code jakarta.persistence.PersistenceUnit}
110-
* is used as the data store.
103+
* <li>In a Jakarta EE profile or platform environment, if the repository
104+
* implementation requires direct access to a {@code javax.sql.DataSource}
105+
* and if the value begins with {@code java:} and matches the name of a
106+
* {@code jakarta.annotation.sql.DataSourceDefinition}, the JNDI name of
107+
* a {@code DataSource}, or a resource reference to a {@code DataSource},
108+
* then the corresponding {@code DataSource} obtained from JNDI is used.
109+
* </li>
110+
* <li>In a Jakarta EE profile or platform environment, if the repository
111+
* implementation requires direct access to a Jakarta Persistence
112+
* {@code jakarta.persistence.EntityManagerFactory} and if the value does
113+
* not begin with {@code java:} and matches the name of a persistence unit,
114+
* then the container-managed {@code EntityManagerFactory} for that
115+
* persistence unit is used, obtained as if it had been injected using the
116+
* {@code PersistenceUnit} annotation. Or, if the value does begin with
117+
* {@code java:} and matches the name of a persistence unit reference,
118+
* then the corresponding {@code EntityManagerFactory} obtained from JNDI
119+
* is used.
111120
* </li>
112121
* <li>Otherwise, the value serves as an identifier linking to vendor-specific
113122
* configuration for the Jakarta Data provider to interpret in a vendor-specific

0 commit comments

Comments
 (0)