Commit Graph

1384 Commits

Author SHA1 Message Date
mawen12
3ab8c66e0f Add parameter to exception message format.
Closes: #2956
Original pull request: #2958
2023-10-17 11:25:22 +02:00
Mark Paluch
cbcb848fab Introduce Lock utility.
The Lock utility is an adapter for Java's Lock and ReadWrite Lock types providing an easier to consume programming model (callback-style and try-with-resources).

Closes: #2944
2023-10-05 09:33:45 +02:00
Oliver Drotbohm
8328517cc9 Fix detection of @DomainEvents and @AfterDomainEventPublication on native.
We now unconditionally process the aggregate root types declared on repositories for @Reflective annotations, which @DE and @ADEP got meta-annotated with.

Fixes #2939.
2023-09-21 16:12:19 +02:00
Oliver Drotbohm
5f64564db5 Properly emit domain events from calls to saveAll(…).
We now treat CrudRepository.saveAll(…) properly by unwrapping the given *Iterable*. This previously already worked for collections handed into the method but not for types only implementing Iterable directly (like Page or Window).

Fixes #3153.
Related tickets #2931, #2927.
2023-09-20 14:21:42 +02:00
Mark Paluch
b1a0bb4ff6 Polishing.
Refine Javadoc. Add unit tests.

See #2929
Original pull request: #2930
2023-09-14 10:35:51 +02:00
Greg L. Turnquist
107f268eb5 Make Lazy.orElseGet(Supplier) public.
Closes #2929
Original pull request: #2930
2023-09-14 10:35:41 +02:00
Mark Paluch
d5cd46c1d5 Polishing.
Add reactive type translation to Coroutine methods to return the expected type for AOP processing.

See #2926
2023-09-12 16:29:48 +02:00
Sébastien Deleuze
110756a40a Adapt for Spring Framework Coroutines AOP support.
This commit adapts Spring Data RepositoryMethodInvoker
and related tests in order to remove most of the
Coroutines specific code and rely on Spring Framework
Coroutines AOP support.

Closes #2926
2023-09-12 14:44:51 +02:00
Christoph Strobl
050d8ff508 Update ManagedTypesRegistrationAotContribution to match signature changes.
Closes: #2925
2023-09-12 08:09:13 +02:00
Mark Paluch
8c342a56e8 Polishing.
Fix Javadoc references.

See #2915
Original pull request: #2916
2023-08-31 08:16:49 +02:00
Mark Paluch
df543cd50e Introduce PersistentProperty.isReadable.
isReadable reports whether a property can be read through PersistentPropertyAccessor, by either using property access through setters, a wither, Kotlin Copy method or by accessing the field directly.

Closes #2915
Original pull request: #2916
2023-08-31 08:16:41 +02:00
Mark Paluch
ea9bf5bf86 Replace Stream usage with iteration to avoid non-null requirements.
SpelEvaluator now iterates over the parameter map instead of using the Java 8 Stream API. Previously, expressions resulting in a null value failed in the collector as Java 8 streams require non-null values for map values.

Closes #2904
2023-08-16 15:11:22 +02:00
shin-mallang
b0ffb1a046 Document event publication from repository delete methods in AbstractAggregateRoot.
Added additional comment regarding registerEvent and andEvent in AbstractAggregateRoot.

Closes: #2903
2023-08-16 10:40:07 +02:00
John Blum
1dc18a8a3c Fix line break in CustomConversions.collectPotentialConverterRegistrations(..) method.
Closes #2902
2023-08-15 16:26:48 -07:00
Oliver Drotbohm
98f20a4457 Drop using FACTORY_BEAN_OBJECT_TYPE attribute entirely.
We now constantly use RootBeanDefinition.setBeanClass(…) (for the raw factory type) and ….setTargetType(…) to declare the full repository factory type including the user defined repository. Any other generics are simply filled with Object.class.

Ticket: #2894.
2023-08-02 17:20:19 +02:00
Oliver Drotbohm
d98eeef745 Set FACTORY_BEAN_OBJECT_TYPE as Class in RepositoryConfigurationDelegate.
This is to accommodate spring-projects/spring-framework#30917.
2023-08-01 22:41:56 +02:00
Thach Le
91093780dc Fix misordered modifiers 'final static'.
Per the Java Language Specification (Java 17; https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.3.1), 'static' should appear before 'final'.

This is also consistent with source code analysis tools, like Checkstyle, rules: https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.html.

Fixes #2881.
2023-07-24 16:36:54 +02:00
Mark Paluch
a11e78dca5 Polishing.
Tweak Javadoc wording, revert visibility changes, add missing Override annotations.

See #2882
2023-07-20 15:37:32 +02:00
Thach Le
8ad79b240d Refine parameter and field names to align with PageRequest property names.
Align parameter naming with properties to not mix using page with pageNumber, size with pageSize names.

Closes #2882
2023-07-20 15:36:29 +02:00
Mark Paluch
0f08311b2e Return the number of SpEL expressions created by SpelExtractor.
Closes #2885
2023-07-20 14:06:17 +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
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
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
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
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
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