Commit Graph

1944 Commits

Author SHA1 Message Date
Rob Winch
876e31901e Implement Antora-based reference docs.
See #2876
2023-07-18 21:44:54 -05:00
Mark Paluch
615d91af21 Prepare 3.2 M1 (2023.1.0).
See #2830
2023-07-14 14:52:11 +02:00
Jens Schauder
4650c9c68a Polishing.
Minor formatting changes.

Original pull request #2874
See #2719
2023-07-13 09:11:44 +02:00
Mark Paluch
dc999a8193 Polishing.
Remove outdated Javadoc.

Original pull request #2874
See #2719
2023-07-13 09:11:22 +02:00
Mark Paluch
d0ba125268 Introduce support to pass-thru TemporalAccessor auditing values.
We now allow passing-thru TemporalAccessor auditing values, bypassing conversion if the target value type matches the value provided from e.g. DateTimeProvider.

Refined the error messages and listing all commonly supported types for which we provide converters.

Closes #2719
Original pull request #2874
2023-07-13 09:10:38 +02:00
Mark Paluch
f2387f687a Polishing.
Introduce dedicated methods to express object creation intents. Remove unnecessary casts.

See #2837
Original pull request: #2838
2023-07-12 15:05:59 +02:00
Christoph Strobl
291ce083bd Cache invalid persistent property paths.
Cache failing resolution attempts to avoid reiterating on the same paths over and over again.

Closes #2837
Original pull request: #2838
2023-07-12 15:05:59 +02:00
Christoph Strobl
09281c7182 Polishing.
Guard usage of KotlinReflectUtils with type presence check.
Extend tests to cover primitive arrays.
Move methods from KotlinValueUtils to KotlinReflectUtils.
Move copy value cache to KotlinCopyMethod.

Original Pull Request: #2866
2023-07-07 10:01:55 +02:00
Mark Paluch
80ca2b47ca Add support for Kotlin value classes.
This commit introduces support for Kotlin Value Classes which are designed for a more expressive domain model to make underlying concepts explicit. Spring Data can now read and write types that define properties using Value Classes.
The support covers reflection based instantiation of Kotlin inline class, nullability and defaulting permutations as well as value classes with generics.

Closes: #1947
Original Pull Request: #2866
2023-07-07 09:32:45 +02:00
Mark Paluch
15bb8aa482 Polishing.
Refine documentation. Introduce isLimited method to mirror isPresent/isSorted semantics. Introduce Pageable.toLimit() method to deduplicate code.

See #2827
Original pull request: #2836
2023-07-05 10:23:56 +02:00
Christoph Strobl
a5408a478d Introduce Limit type to limit repository query results.
We now accept Limit as type to express dynamic repository query limits.

Closes #2827
Original pull request: #2836
2023-07-05 10:06:50 +02:00
Yanming Zhou
0d9a91123a Fix outdated Javadoc.
Closes #2860
2023-07-04 15:55:52 +02:00
Mark Paluch
3df0c3b5a6 Retain direction for empty KeysetScrollPosition.
We now retain the direction when an empty KeysetScrollPosition is created.

Closes #2840
2023-07-04 15:53:00 +02:00
Mark Paluch
80b8e12641 Polishing.
Allow nullable OffsetScrollPosition and add support for values wrapped within Optional.

Update tests. Reformat code. Add issue tags to tests.

See #2856
Original pull request: #2861
2023-07-04 15:45:23 +02:00
Yanming Zhou
391607bd14 Introduce argument resolver for OffsetScrollPosition.
Closes #2856
Original pull request: #2861
2023-07-04 15:45:06 +02:00
Oliver Drotbohm
ca9f9bfdc8 Fix query execution mode detection for aggregate types that implement Streamable.
We now short-circuit the QueryMethod.isCollectionQuery() algorithm in case we find the concrete domain type or any subclass of it.

Fixes #2869.
2023-07-01 01:55:59 +02:00
Mark Paluch
6ca3170bde Polishing.
Use ReverseListIterator instead of Stream API to reduce overhead. ListIterator provides means to iterate backwards so we're wrapping the existing iterator.

See #2857.
Original pull request: #2858.
2023-06-16 10:14:28 +02:00
Christoph Strobl
d1568198d8 WindowIterator should emit items in order when scrolling backwards.
Closes #2857
Original pull request: #2858
2023-06-16 10:14:10 +02:00
Oliver Drotbohm
8aff631032 Improve reference documentation on repository methods triggering event publication.
Fixes #2855.
2023-06-14 16:29:49 +02:00
Mark Paluch
f9c1ef9493 Polishing.
Reorganize imports.

See #2854
2023-06-14 15:25:43 +02:00
Mark Paluch
1eda9c497f De-lombok test code.
Closes #2854
2023-06-14 15:23:50 +02:00
Mark Paluch
f1b7952ea5 Use merged bean definitions for EntityCallback type lookup.
We now use the merged bean definition to resolve the defined EntityCallback type.

Previously, we used just the bean definition that might have contained no type hints because of ASM-parsed configuration classes.

Closes #2853
2023-06-14 09:25:26 +02:00
Mark Paluch
2cbf0fb189 Extend documentation on sorting for Keyset scrolling.
Closes #2846
2023-06-13 12:00:57 +02:00
Mark Paluch
05d68a0eab Consider KeysetScrollPosition direction in WindowIterator.
We now consider the scroll direction in the iterator to properly continue Keyset backward scrolling.

Closes #2851
2023-06-13 11:52:34 +02:00
Mark Paluch
bfcb2ffeae Unwrap nested collections in default Querydsl binding.
When binding values to collection-like paths, we now unwrap potentially double-wrapped collections as QuerydslPredicateBuilder attempts to convert the binding value to the type of the path.

Our default is a contains binding for single elements.

Closes #2834
2023-06-02 10:29:57 +02:00
Mark Paluch
2937d620ad Remove CloseableIterator from supported repository return types.
`CloseableIterator` wasn't intended to be here in the first place as it is only an intermediate type.

Closes #2835
2023-05-30 10:16:30 +02:00
Mark Paluch
9b9d01c1a0 Adopt to changed AwaitKt utility.
Closes #2832
2023-05-23 11:59:20 +02:00
Mark Paluch
c6879a8bf6 Refine allocation of DefaultMethodInvokingMethodInterceptor.
We now reduce allocations of DefaultMethodInvokingMethodInterceptor by reusing DefaultMethodInvokingMethodInterceptor within a ProxyProjectionFactory. We also reduced allocations during default method discovery and reuse the default methods information within the projection information cache.

Closes #2831
2023-05-17 10:33:07 +02:00
Christoph Strobl
807323d115 Prepare 3.1 GA (2023.0.0).
See #2821
2023-05-12 14:14:06 +02:00
Mark Paluch
46ff9d25a6 Allow reversing Sort.
We now allow reversing the sort order of Sort instances to flip ASC and DESC sort orders.

Closes #2805
2023-05-11 16:13:19 +02:00
Mark Paluch
1ba2932275 Polishing.
Reorder methods.

See #2823
2023-05-11 16:13:18 +02:00
Jens Schauder
fd0964ab72 Make all args Sort.Order constructor public.
The other constructors are already public, and this one is actually needed by subclasses.

Closes #2823
2023-05-11 16:12:59 +02:00
Mark Paluch
69dbb75896 Polishing.
Remove superfluous declarations, fix toString description.

See #2824
2023-05-11 11:10:44 +02:00
Stefano Cordio
63fecdd06e Fix Sort JavaDoc.
Original pull request #2825
2023-05-03 10:38:29 +02:00
Oliver Drotbohm
979e0f401b Fix too restrictive entity callback matching.
We now properly support generic entity callbacks defined via lambda declarations.

Fixes #2822.
2023-05-02 20:54:49 +02:00
Oliver Drotbohm
cac1c211ef Polishing Window scrolling API.
Moved general-purpose factory methods to the common ScrollPosition interface. Introduced a couple of domain specific methods to conveniently work with both Keyset- (to e.g. change direction) and OffsetScrollPosition (to e.g. advance the offset). Consolidated unit tests accordingly.

Moved WindowIterator to ….data.support package. Fixed case of Direction enum values.

Fixes #2824.
2023-04-27 18:02:30 +02:00
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
9f2fc7570a Prepare 3.1 RC1 (2023.0.0).
See #2798
2023-04-14 11:53:16 -05: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
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