|
66 | 66 | @Target(ElementType.TYPE) |
67 | 67 | public @interface Repository { |
68 | 68 | /** |
69 | | - * Value for the {@link Repository#provider()} attribute that allows the use |
70 | | - * of any available Jakarta Data provider that supports the type of entity |
71 | | - * annotation that is present on the repository's entity class. |
| 69 | + * Value for the {@link #provider()} attribute that allows the use of |
| 70 | + * any available Jakarta Data provider that supports the type of entity |
| 71 | + * annotation that is present on the repository's entity classes. |
72 | 72 | */ |
73 | 73 | String ANY_PROVIDER = ""; |
74 | 74 |
|
75 | 75 | /** |
76 | | - * <p>Value for the {@link Repository#dataStore()} attribute that indicates |
77 | | - * to use |
| 76 | + * <p>Value for the {@link #dataStore()} attribute that indicates use of |
78 | 77 | * a default data store.</p> |
79 | 78 | * |
80 | | - * <p>When running in a Jakarta EE profile or platform and the entity |
81 | | - * annotations |
82 | | - * indicate a relational database, the default data store is the Jakarta EE |
83 | | - * default data source, {@code java:comp/DefaultDataSource}. Otherwise, the |
84 | | - * default data store is determined by the Jakarta Data provider.</p> |
| 79 | + * <p>In a Jakarta EE profile or platform environment, if the repository |
| 80 | + * implementation requires direct access to a {@code javax.sql.DataSource}, |
| 81 | + * the default data store is the Jakarta EE default data source with name |
| 82 | + * {@code java:comp/DefaultDataSource}. Otherwise, the default data store |
| 83 | + * is determined by the Jakarta Data provider.</p> |
85 | 84 | * |
86 | 85 | * <p>The default data store might require additional vendor-specific |
87 | 86 | * configuration, depending on the vendor.</p> |
|
100 | 99 | * Interoperability with Jakarta Config is reserved for future versions |
101 | 100 | * of Jakarta Data. |
102 | 101 | * </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. |
| 102 | + * <li>In a Jakarta EE profile or platform environment, if the repository |
| 103 | + * implementation requires direct access to a {@code javax.sql.DataSource} |
| 104 | + * and if the value begins with {@code java:} and matches the name of a |
| 105 | + * {@code jakarta.annotation.sql.DataSourceDefinition}, the JNDI name of |
| 106 | + * a {@code DataSource}, or a resource reference to a {@code DataSource}, |
| 107 | + * then the corresponding {@code DataSource} obtained from JNDI is used. |
| 108 | + * </li> |
| 109 | + * <li>In a Jakarta EE profile or platform environment, if the repository |
| 110 | + * implementation requires direct access to a Jakarta Persistence |
| 111 | + * {@code jakarta.persistence.EntityManagerFactory} and if the value does |
| 112 | + * not begin with {@code java:} and matches the name of a persistence unit, |
| 113 | + * then the container-managed {@code EntityManagerFactory} for that |
| 114 | + * persistence unit is used, obtained as if it had been injected using the |
| 115 | + * {@code PersistenceUnit} annotation. Or, if the value does begin with |
| 116 | + * {@code java:} and matches the name of a persistence unit reference, |
| 117 | + * then the corresponding {@code EntityManagerFactory} obtained from JNDI |
| 118 | + * is used. |
111 | 119 | * </li> |
112 | 120 | * <li>Otherwise, the value serves as an identifier linking to vendor-specific |
113 | 121 | * configuration for the Jakarta Data provider to interpret in a vendor-specific |
|
0 commit comments