Commit Graph

1412 Commits

Author SHA1 Message Date
Mark Paluch
0093c9085b Consider enclosing class for dynamic projection parameter detection.
We now consider the enclosing class to determine correct generic typing.

Closes #3020
2024-01-11 11:04:56 +01:00
Mark Paluch
6623bd8d91 Polishing.
Add missing override annotations. Refactor TypeFilterFunction into function to avoid additional property references.
Move off deprecated code.

Closes #3016
2024-01-09 14:41:50 +01:00
Mark Paluch
2b684ce554 Extend license header copyright years to 2024.
See #3014
2024-01-02 13:54:18 +01:00
Mark Paluch
686868fe3c Resolve generics for Kotlin Value Boxing inspection.
To introspect value boxing rules, we now resolve Kotlin type parameters.

Closes #2986
2023-12-14 14:56:31 +01:00
Mark Paluch
25a24082dd Polishing.
Use IdentityHashMap for parameter lookup.

See #3000
2023-12-14 14:35:30 +01:00
leeyohan93
2642609ccb Enhance Kotlin Class Conversion by Minimizing Equals Comparisons.
Closes #3000
2023-12-14 14:35:29 +01:00
Mark Paluch
4ec7e98ae5 Polishing.
Fix Javadoc reference. Reorder tags.

See #2531
2023-12-13 08:46:45 +01:00
Oliver Drotbohm
9c99164ad6 Revert "Properly render sort variable variable as composite."
This reverts commit fa9d7bdce7 as the change has too many side effects to be included in a bugfix version.

Related ticket: GH-2531.
2023-12-12 21:13:25 +01:00
Mark Paluch
52cdfe2631 Introduce ParametersSource to Parameters.
We now provide a ParametersSource object to create MethodParameter objects associated with the enclosing class so parameters can resolve generics properly.

Closes #2996
2023-12-08 11:04:48 +01:00
Oliver Drotbohm
ba4526edb6 Avoid records as cache keys for performance reasons.
Fixes GH-2997.
2023-12-05 14:17:20 +01:00
Julien Béti
fa9d7bdce7 Properly render sort variable variable as composite.
HateoasSortHandlerMethodArgumentResolver now renders the sort template variable as composite to properly indicate that it can be submitted multiple times.

Fixes GH-2531.
Original pull request GH-2945.
2023-12-01 21:29:33 +01:00
Mark Paluch
78267402bf Omit asymmetric Kotlin properties.
We now skip adding asymmetric Kotlin properties if the getter returns a different type than the setter (e.g. due to value boxing).

Closes #2993
2023-11-29 15:51:27 +01:00
Mark Paluch
8db69931e4 Include inherited non-Kotlin properties in KotlinBeanInfoFactory.
We now include properties from non-Kotlin supertypes if the supertype is not a Kotlin type and not Object.

Closes #2994
2023-11-29 15:51:21 +01:00
Mark Paluch
5ac30bf620 Backoff KotlinBeanInfoFactory for enum types.
We now no longer contribute properties for enum types.

Closes #2990
2023-11-29 10:51:22 +01:00
Mark Paluch
801dac992e Polishing.
Use for-loop instead of Java Stream API for concatenation of paths to reduce GC and CPU pressure.

See #2992
2023-11-29 09:21:41 +01:00
Mark Paluch
49f2af2b2f Allow reuse of TypeInformation when obtaining a PersistentPropertyPath.
Closes #2992
2023-11-29 09:21:40 +01:00
Jens Schauder
7fab81b406 Fix broken logging message.
Closes #2977
2023-11-16 16:06:11 +01:00
Mark Paluch
97be53bd85 Remove superfluous @NonNull annotations.
Closes #2976
2023-11-13 14:51:12 +01:00
Jens Schauder
3eda7e9e66 Revert "AbstractPersistentProperty now considers the owner for equals."
This reverts commit 633d125f1d.

The change caused build failures for Spring Data JDBC.

See #2972
Original pull request #2973
See spring-projects/spring-data-relational#1657
2023-11-12 11:02:46 +01:00
Mark Paluch
3c872ae7cb Polishing.
Extract singular/plural form into String.format(…) for easier readability.

See #2967
2023-11-09 14:46:50 +01:00
Luis Carilla Ternero
c52520a783 Refine repository scanning finished log message.
Log the plural form accordingly.

Closes #2967
2023-11-09 14:46:39 +01:00
Mark Paluch
65c537cdaa Improve equals check by caching resolved generics.
Closes: #2974
2023-11-09 08:29:57 +01:00
Jens Schauder
633d125f1d AbstractPersistentProperty now considers the owner for equals.
This makes a difference when a property is declared in a superclass of two entities.
In such a case the property is the same, but the owner is different.

Closes #2972
Original pull request #2973
See https://github.com/spring-projects/spring-data-relational/issues/1657
2023-11-08 10:43:15 +01:00
Oliver Drotbohm
38b3099ec5 Simplify DefaultMethodInvokingMethodInterceptor.
As our baseline is now Java 17, we can remove all indirections to produce a Lookup previously needed to support Java 8 and 9.

Fixes #2971.
2023-11-08 08:42:38 +01:00
Mark Paluch
d83dd7e138 Un-mangle Kotlin method names in PartTree.
Due to shortcomings with value classes mangling and the impossible usage of JvmName on Kotlin interfaces, we're inspecting now the method name if it contains a dash (-). If so, then we truncate the method name to be able to parse it.

Closes #2965
2023-10-25 14:48:16 +02:00
Mark Paluch
f060bcfe34 Back off from Kotlin BeanInfo creation for interfaces.
KotlinBeanInfoFactory no longer creates a BeanInfo for interfaces to follow general BeanInfo semantics.

Closes #2964
2023-10-25 11:45:47 +02:00
Mark Paluch
d6507fe45f Polishing.
Tweak Javadoc. Refine tests.

See #2491
2023-10-17 11:50:04 +02:00
Jens Schauder
2561c8e0aa Clarify behavior of PropertyPath.
Update tests and documentation.

Closes #2491
2023-10-17 11:49:44 +02:00
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