Commit Graph

2745 Commits

Author SHA1 Message Date
p.anisimov
ccd56ef56e Simplify PreferredConstructorDiscovererUnitTests.
Leverage things like Java var keyword to simplify test cases.

Resolves #2695.
Related: #2694.
Original pull request: #2724.
2023-04-24 12:31:59 -05:00
Greg L. Turnquist
c71f2fb8fe After release cleanups.
See #2798
2023-04-14 12:00:00 -05:00
Greg L. Turnquist
c88de96f8b Prepare next development iteration.
See #2798
2023-04-14 11:59:54 -05:00
Greg L. Turnquist
ea706e6886 Release version 3.1 RC1 (2023.0.0).
See #2798
2023-04-14 11:53:57 -05:00
Greg L. Turnquist
9f2fc7570a Prepare 3.1 RC1 (2023.0.0).
See #2798
2023-04-14 11:53:16 -05:00
Mark Paluch
124930eaf5 Upgrade to Maven Wrapper 3.9.1.
See #2815
2023-04-06 16:16:22 +02:00
Oliver Drotbohm
c3b29a5644 Polish Javadoc of PersistentEntity regarding iteration order of PersistentProperty instances.
Fixes #2814.
2023-04-04 13:23:44 +02:00
Oliver Drotbohm
03a6a84bf9 Polishing in mapping package.
Nullable annotations and Objects.equals(…) and Objects.hash(…)/Objects.hashCode(…). Records for internal cache key.

Related issue: #2813.
2023-04-04 11:32:52 +02:00
Oliver Drotbohm
55e14952c8 Remove deprecations in PersistentPropertyAccessor.
Related issue: #2813.
2023-04-04 11:32:52 +02:00
Oliver Drotbohm
35a2f45736 Tighten nullability contract of PersistentPropertyPath.
We should change the definition of `PersistentPropertyPath` to — in its public API — not allow empty instances anymore. Those violate the concept and bleed into the concept's API by having to make all methods nullable (returning null in exactly that "empty" case). An empty property path doesn't make any actual sense as you cannot reasonably answer the methods declared on the interface except by returning null, which then causes client code having to verify the returned values all the time.

This is now changed into only making `PersistentPropertyPath.getParentPath()` nullable and letting it return null for single segment paths. Adapted client code accordingly. `….getRequiredLeadProperty()` is now deprecated in favour of `….getLeafProperty()` not returning null anymore.

Fixes #2813.
2023-04-04 11:32:43 +02:00
Oliver Drotbohm
83162b25c7 Improve lambda-based EntityCallback detection.
In case an EntityCallback is declared as lambda expression, the JVM does not expose any generics information about the target entity type the callback shall be applied to. This commit changes the callback lookup and processing so that in case the generics information is not detectable on the type, we fall back to the BeanDefinition's resolvable type (fed by the factory method's return type which carries the necessary reflection information). That generics information is then kept in the newly introduce EntityCallbackAdapter and the code inspecting the actual entity type for matches then uses the resolvable type held in that. Also, the actual callback invocation is done on the adapter's delegate.

Removed the ability of the discoverer to register EntityCallbacks by bean name as that was not used in the public API at all and it avoids duplicating the bean definition type detection. A couple of minor additional cleanups (records for cache key, methods static where possible and with lower visibility etc.)

Fixes #2812.
2023-04-04 09:23:29 +02:00
Michael J. Simons
a257a0399a Gracefully skip non-assignable reactive lambda callbacks on Java 18+.
Closes #2808, #2809.
2023-04-04 09:05:02 +02:00
Mark Paluch
e1ec982e88 Polishing.
Reorder null-handling and collection return types in documentation to improve topical flow.

See #2804
2023-03-29 11:20:26 +02:00
Mark Paluch
f903ddcddc Refine documentation of Paging, Sorting and Scrolling.
Closes #2804
2023-03-29 11:20:26 +02:00
Greg L. Turnquist
3ba098604f Polishing. 2023-03-28 15:46:00 -05:00
Greg L. Turnquist
233edd88fd Test against Java 20 in CI.
See #2803.
2023-03-28 15:29:18 -05:00
Greg L. Turnquist
08b039e0fa Update CI properties.
See #2798
2023-03-28 13:58:08 -05:00
Christoph Strobl
6328b4cd19 After release cleanups.
See #2778
2023-03-20 15:05:35 +01:00
Christoph Strobl
5b690b2684 Prepare next development iteration.
See #2778
2023-03-20 15:05:33 +01:00
Christoph Strobl
695412ed60 Release version 3.1 M3 (2023.0.0).
See #2778
2023-03-20 15:01:47 +01:00
Christoph Strobl
712e7821a2 Prepare 3.1 M3 (2023.0.0).
See #2778
2023-03-20 15:01:19 +01:00
Mark Paluch
755bd19744 Fix broken and known-redirect links in reference documentation.
See #2774
2023-03-20 11:00:38 +01:00
Mark Paluch
02ce74f86f Polishing.
Tweak wording.

See #2794
Original pull request: #2794
2023-03-20 10:14:02 +01:00
Tim Feuerbach
959bde4d37 Recommend Java records instead of Lombok for class-based projections.
Closes #2793
Original pull request: #2794
2023-03-20 10:08:40 +01:00
Oliver Drotbohm
77de8aafff Clarification on the the term CRUD methods in reference documentation.
Fixes #2792.
2023-03-19 12:45:15 +01:00
Mark Paluch
2564f6a049 Polishing.
Refactor WindowIterator to return individual objects during scrolling.

Original Pull Request: #2787
2023-03-16 13:11:50 +01:00
Christoph Strobl
0c0c1afc8e Add WindowIterator and rename Scroll to Window.
The intend of WindowIterator is to support users who need to iterate multiple windows. It keeps track of the position and loads the next window if needed so that the user does not have to interact with the position at all.

Also remove the Window methods to get the first/last position and enforce the index based variant.

Update the documentation to make use of the newly introduced API.

See: #2151
Original Pull Request: #2787
2023-03-16 13:10:40 +01:00
Mark Paluch
035965a3a2 Introduce Scroll API.
See: #2151
Original Pull Request: #2787
2023-03-16 13:09:39 +01:00
Oliver Drotbohm
a5de842460 Update section of the reference documentation regarding Page and Slice.
Update to latest addition in support for Slice. Also update to renamed methods and types in Spring HATEOAS.

Related ticket: #1307
2023-03-01 15:13:55 +01:00
Oliver Drotbohm
116730c168 Polishing.
Imports, Javadoc, ticket references in test cases.

Removed the need for MethodParameterAware… flavors of the ResourceAssemblers by keeping the MethodParameter reference in the original assemblers in the first place. Extracted common Pageable MethodParameter lookup code into PageableMethodParameterUtils.

Related ticket: #1307.
2023-02-28 17:00:37 +01:00
Michael Schout
70f21bda9f Add SlicedResourcesAssembler for web integration.
Added SlicedResourcesAssembler to esaily convert Slice instances into SlicedResource instances and automatically build the required previous/next link based on PageableHandlerMethodArgumentResolver present in the MVC configuration. The assembler can either be injected into a Spring MVC controller or a controller method. The latter will then assume the controller methods URI to be used as pagination link base.

Added necessary SlicedResourcesAssemblerArgumentResolver and MethodParameterAwareSlicedResourcesAssembler classes and wire up HateoasAwareSpringDataWebConfiguration configuration beans to that SlicedResourcesAssembler's can be auto-injected into controllers.

Closes #1307
2023-02-28 10:06:10 +01:00
Mark Paluch
83655663ea Refine QuerydslRepositoryInvokerAdapter nullability assertions.
QuerydslRepositoryInvokerAdapter now rejects null predicates to enforce nullability constraints.

Closes #1501
2023-02-24 11:04:11 +01:00
Mark Paluch
34f212ff61 Upgrade to Maven Wrapper 3.9.0.
See #2779
2023-02-20 11:58:05 +01:00
Christoph Strobl
81f9cef672 After release cleanups.
See #2777
2023-02-17 14:25:48 +01:00
Christoph Strobl
6fc56c4b88 Prepare next development iteration.
See #2777
2023-02-17 14:25:46 +01:00
Christoph Strobl
f1ebce258c Release version 3.1 M2 (2023.0.0).
See #2777
2023-02-17 14:22:30 +01:00
Christoph Strobl
09e25a417a Prepare 3.1 M2 (2023.0.0).
See #2777
2023-02-17 14:22:15 +01:00
Christoph Strobl
2fd7afce3d After release cleanups.
See #2734
2023-02-17 13:31:54 +01:00
Christoph Strobl
a36dbd52b7 Prepare next development iteration.
See #2734
2023-02-17 13:31:52 +01:00
Christoph Strobl
7b9a91d251 Release version 3.1 M1 (2023.0.0).
See #2734
2023-02-17 13:27:49 +01:00
Christoph Strobl
44ad6e8480 Prepare 3.1 M1 (2023.0.0).
See #2734
2023-02-17 13:27:08 +01:00
Mark Paluch
028d312c39 Fix broken and known-redirect links in reference documentation.
Closes #2774
2023-02-15 11:08:35 +01:00
Mark Paluch
f82a48454e Polishing.
Use consistently domain type instead of introducing a new terminology to repository infrastructure.

Rename Kotlin variant of ParameterUnitTests to KParameterUnitTests to avoid duplicate classes.

See #2770
Original pull request: #2771
2023-02-14 14:29:12 +01:00
Oliver Drotbohm
16e7e7c79b Query method parameters are now aware of aggregate reference type.
To support the binding of Class parameters to queries for declared query methods, we have to be able to differentiate them from Class parameters that are supposed to represent projections. We can do that by relating the declared Class' element type to the aggregate root type as a Class typed to that or any subtype of it will never trigger a projection by definition.

So far the Parameter(s) abstraction was solely created from a query method's Method. We now changed that for QueryMethod to forward the aggregate type detected on the RepositoryMetadata and consider it during the detection of dynamic projection parameters.

As a mitigating measure, we now also support @Param on Class-typed parameters to explicitly mark them for query binding. This is primarily to be able to add this support to the 2.7

The changes are built in a way that modules extending that mechanism will continue to work as is but see deprecation warnings on methods and constructors involved. Adapting extending code to the new APIs will automatically enable the support for bindable Class parameters on query methods.

Fixes #2770.
Original pull request: #2771
2023-02-14 14:28:05 +01:00
Mark Paluch
9bc6d2b6df Update CI properties.
See #2734
2023-01-30 10:49:49 +01:00
Mark Paluch
942fc6a319 Upgrade to Maven Wrapper 3.8.7.
See #2769
2023-01-30 10:48:07 +01:00
ByungjunYou
7cf4cf9baa Fix a typo in javadoc.
Closes #2739
2023-01-23 14:13:37 +01:00
John Blum
7fedd5f3ec Fix Spring Boot dependency version property name.
The version property used by Spring Boot to manage Spring Data modules pulled in transitively by the Spring Data BOM has changed from 'spring-data-releasetrain.version' to 'spring-data-bom.version'.

Closes #2766
2023-01-18 15:43:43 -08:00
Mark Paluch
b3dcbbe1a7 Polishing.
Reorder statements for higher cohesion.

See #2760
Original pull request: #2762
2023-01-11 11:15:39 +01:00
Christoph Strobl
0bd2714595 Use unique bean name for configuration post processors.
Closes #2760
Original pull request: #2762
2023-01-11 11:15:39 +01:00