Commit Graph

1191 Commits

Author SHA1 Message Date
Yanming Zhou
affe99abc2 Fix obsoleted package name of Querydsl.
Original pull request #2378
2021-12-06 10:00:41 +01:00
heowc
81c87eba1e Polishing.
Move off deprecated classes.
Add Nullable annotations.
Correct mistakes in documentation.

Original pull request #2374
2021-12-03 17:58:22 +01:00
Jens Schauder
6d84fb2571 Correctly handle exists when it should return false.
In the previous implementation it would throw an exception.

Original pull request #2368
2021-12-03 11:29:04 +01:00
Yanming Zhou
24d69c5452 Optimize SimpleJpaRepository.exists(Example) for better performance.
1. Set max results to 1 to avoid full scan
2. Select 1 to reduce size of ResultSet

Original pull request #2368
2021-12-03 11:29:04 +01:00
Jens Schauder
a5f4bc0ebb Polishing.
Adding author tag.

See #2333
Original pull request #2373
2021-12-03 11:29:04 +01:00
Yanming Zhou
06cdd8acbb Optimize QuerydslJpaPredicateExecutor.exists.
Fixes #2333
Original pull request #2373
2021-12-03 10:57:58 +01:00
Diego Krupitza
98812cd600 Fixed typos in JpaRepositoryExtension class.
Fixed one typo in the JavaDoc of JpaRepositoryExtension#afterBeanDiscovery and JpaRepositoryExtension#processBean.

Original pull request #2367
2021-12-03 09:35:03 +01:00
Oliver Drotbohm
5f3b4e2155 Add support for DTO projections on derived query methods.
In case a derived query uses a DTO, we now create a select clause that uses a constructor expression for the DTO type. This wasn't supported before and expexted either an interface-based projection or an explicit query using a constructor expression.

Fixes #2363.
2021-12-03 09:35:03 +01:00
Jens Schauder
6a7d79b5da Prepare 2.6 GA (2021.1.0).
See #2340
2021-11-12 10:49:15 +01:00
Greg L. Turnquist
c3c3743fcd Disable EclipseLink test class that freezes entire test suite.
For some reason, EclipseLinkNamespaceUserRepositoryTests freezes. Can't figure out the source, so we are disabling it for now.

See #2329
Original pull request: #2345.
2021-11-04 10:16:03 -05:00
Mark Paluch
d637ce35df Polishing.
Rename Projector to EntityGraphFactory. Remove QuerydslProjector and TypedQueryProjector. Remove MappingContext creation.

See #2329
Original pull request: #2345.
2021-11-04 10:14:57 -05:00
Jens Schauder
83ba970465 Translate projected properties of the fluent query API into a fetchgraph.
When a property path based projection is specified we still return the root entity.
But we do provide a fetchgraph.
The JPA implementation will (should) load only the specified attributes eagerly.
It most likely will also load all other attributes from all selected tables.

Once we have infrastructure in place for for multilevel projections the same approach can and should be used for those.
Currently this is not the case.

Closes #2329
Original pull request: #2345.
2021-11-04 10:14:36 -05:00
Jens Schauder
43305f67cb Polishing.
Comments and formatting.
2021-11-04 10:14:27 -05:00
Mark Paluch
69f7fc1364 Prepare 2.6 RC1 (2021.1.0).
See #2302
2021-10-18 13:47:46 +02:00
Jens Schauder
9f827fa1ba Add a note about the new getById method.
See #2169
2021-10-18 11:30:50 +02:00
Mark Paluch
1a00e2f588 Polishing.
Make query factory methods non-nullable by moving conditionals to the lookup strategy.

See #2217
2021-10-13 12:14:34 +02:00
Mark Paluch
711482e715 Consider named count query for named queries.
We now consider `@Query(countName = "…")` when the actual query is a string query or named query using Properties to declare its query. Named queries using JPA named queries remain unchanged.

Closes #2217
2021-10-13 12:14:34 +02:00
Mark Paluch
87da84b7e7 Use @IdClass as identifier for IdClasses with a single attribute for repository operations.
We now use the IdClass type for lookups when the entity defines a `@IdClass`. Previously, we uses the type of the defined singular identifier attribute which lead to invalid queries.

Closes #2330
2021-10-12 16:09:57 +02:00
Mark Paluch
a31c39db7a Polishing.
Fix version reference to Spring Data Commons. Avoid stream creation when fetching all/one/first element. Move off deprecated API. Add override comments. Add null guargs.

See #2294
Original pull request: #2326.
2021-10-08 11:24:15 +02:00
Greg L. Turnquist
ea430f34aa Implement FluentQuery for Querydsl and Query by Example.
Add support for both QueryByExampleExecutor and QuerydslPredicateExecutor. This is used in SimpleJpaRepository and QuerydslJpaPredicateExecutor, resulting in various test cases proving support by both examples and Querydsl predicates.

NOTE: Class-based DTOs are NOT supported yet.

See #2294
Original pull request: #2326.
2021-10-08 11:24:08 +02:00
Greg L. Turnquist
58b73cf308 Polishing.
Related: #2288.
2021-10-07 16:01:41 -05:00
Réda Housni Alaoui
93705f1a9e EntityManagerBeanDefinitionRegistrarPostProcessor sets primary flag on EntityManager bean definitions.
Closes #2288.
2021-10-07 15:59:44 -05:00
Mark Paluch
648bd74be5 Polishing.
Move off deprecated API.

See #2319
2021-10-06 09:32:43 +02:00
Mark Paluch
fa11454bd9 Log a warning when a query method is annotated with a query and a query name.
We now log when a query method has an ambiguous declaration to clarify that the declared query is used.

Closes #2319
2021-10-06 09:32:25 +02:00
Mark Paluch
60299b6033 Prepare 2.6 M3 (2021.1.0).
See #2277
2021-09-17 09:44:34 +02:00
Christoph Strobl
6cf6835db8 Change visibility of JpaMetamodelMappingContextFactoryBean.
Closes #2299
2021-09-15 15:45:21 +02:00
Mark Paluch
01a99f40f0 Move documentation bits regarding AbstractAuditable into JPA-specific documentation.
Closes #2284
2021-09-07 09:19:08 +02:00
Jens Schauder
d54056cdd1 Prepare 2.6 M2 (2021.1.0).
See #2264
2021-08-12 15:02:55 +02:00
Greg L. Turnquist
e9c118506f Remove changelog.
Closes #2267.
2021-07-23 16:40:59 -05:00
Greg L. Turnquist
a4ef56d83c Add support for MySQL and Postgres testing.
* Introduce Testcontainers as the mechanism to test against real data stores.
* Alter CI to handle running Testcontainers in reduced privilege mode.
* Run the data store specific test cases ONLY for the baseline Java 8 test execution.

See #2256.
2021-07-23 11:27:55 -05:00
Jens Schauder
9f210e0ee1 Prepare 2.6 M1 (2021.1.0).
See #2201
2021-07-16 14:08:58 +02:00
Jens Schauder
2e1f1a45f4 Updated changelog.
See #2201
2021-07-16 14:08:34 +02:00
Jens Schauder
0215782490 Updated changelog.
See #2246
2021-07-16 10:48:16 +02:00
Oliver Drotbohm
400aa0e042 Adapt to API consolidation in Spring Data Commons' PersistentProperty.
Closes: #2254
Original Pull Request: #2255
Related to: spring-projects/spring-data-commons#2408
2021-07-12 09:10:15 +02:00
Greg L. Turnquist
8d6634430f Polishing.
See: #1959, #409.
2021-07-09 11:32:21 -05:00
Greg L. Turnquist
0a81bc6a5d Polishing.
See: #1959, #409.
2021-07-09 11:31:58 -05:00
Gabriel Basilio Brito
554bd3d6ed Add REF_CURSOR support for stored procedures.
When registered procedure output parameters, if the method annotated with @Procedure has a collection return type or an entity return type, then use ResultSet. Otherwise, handle either the array (Object[]) or the primitive types.

* Throw a proper exception when using an @Procedure-annotated method and no transaction is active.
* Introduce refCursor as a boolean flag to @Procedure denoting when to use REF_CURSORs for OUT parameters..
* Extract a ProcedureParameter command object to ease usage of a parameter's name, type and mode. (NOTE: javax.persistence already has "StoredProcedureParameter".)

NOTE: Integration testing of stored procedures is very limited by lack of HSQL's support for REF CURSORS. See ##2256 to track future work for potential testing against MySQL, Oracle, Postgres, or SQL Server.

See: #1959, #409.
Related: #2014.
2021-07-09 11:28:24 -05:00
Greg L. Turnquist
2e30a353c9 Drop serialVersionUID from AbstractPersistable.
Considering it's not serializable, there is no need to maintain serialVersionUID.

See #2245.
2021-07-02 14:36:54 -05:00
DaniBa1
05cce6d135 Fixing small mistake in documentation
Changed a wrong description.

Closes #2251
2021-07-01 16:59:09 +02:00
Mark Paluch
cde430e9fb Updated changelog.
See #2215
2021-06-22 16:07:24 +02:00
Mark Paluch
e2e50ac63a Updated changelog.
See #2214
2021-06-22 15:29:50 +02:00
Mark Paluch
bf8e8a1eac Polishing.
Update placeholder name to reflect its position instead of the content that is being added by using modules.

Original pull request: #2237.
See #2009
2021-06-17 12:05:45 +02:00
Jens Schauder
fcc1d8b317 Add a note that DTO projections are not supported with native queries.
Closes #2009
Related ticket: spring-projects/spring-data-commons#2382
Original pull request: #2237
2021-06-17 12:04:24 +02:00
Mark Paluch
dfdb528458 Use Spring nullability annotations instead of JSR305.
Closes #2239.
2021-06-17 09:01:51 +02:00
Manuel Doninger
316d0ce7e4 Remove superfluous @Repository annotation from examples.
Remove the @Repository annotation from interfaces in the examples, since it is not necessary on Spring Data interfaces (and creates a warning log anyway).

Closes #2234
Original pull request #2235
2021-06-15 11:58:44 +02:00
Michael Simons
dec2a43736 Polishing.
Original pull request #2229
See #2228
2021-06-09 14:56:42 +02:00
Michael Simons
5a00192ecd Escape JDBC styled parameters.
Closes #2228
Original pull request #2229
2021-06-09 14:56:06 +02:00
Jens Schauder
39e72af2d5 Fix build failures with Java 16.
A few test that used reflection to access the actual SQL executed by a Query object failed with `java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not "opens java.lang.reflect" to unnamed module @1b9e1916`.
This change replaces the reflection used by a proper call to `unwrap`.

Original pull request #2231
2021-06-09 12:10:22 +02:00
Jens Schauder
aa10c46c7b Fix documenation of entity state-detection strategies.
Closes #2230
2021-06-09 10:59:05 +02:00
Mark Paluch
da9eddd83f Updated changelog.
See #2199
2021-05-14 12:36:34 +02:00