Commit Graph

1434 Commits

Author SHA1 Message Date
Mark Paluch
289e4d1f52 Fix StackOverflowError in TypeDiscoverer comparison.
We now resort to String-based comparison if a generic cannot be resolved. Previously, unresolved generics caused an infinite recursion.

Closes #3084
2024-04-23 10:17:57 +02:00
Oliver Drotbohm
d22bb69a46 Support advanced generics redeclarations in RepositoryFactoryBeanSupport extensions.
Spring Data modules might override, and, by that, fix some of the generic type parameters exposed by RepositoryFactoryBeanSupport. We now more thoroughly walk through them to consider the ones expanded already and automatically expand the remaining ones with either the types found on the user repository interface or the unresolved type variable.

Ticket: GH-3074.
2024-04-09 19:20:28 +02:00
Oliver Drotbohm
36e60d80e0 Repository type preparation now only expands type variables declared in FactoryBean.
Related: GH-3074
2024-04-09 16:47:51 +02:00
Oliver Drotbohm
f2608f6302 More precise type information of factory bean definitions.
We now also forward the domain and identifier information detected on the repository to the target type declared for the repository factory bean definition.

Fixes GH-3074.
2024-04-09 13:40:52 +02:00
Oliver Drotbohm
6f68df292c Polishing.
Related ticket GH-3066.
2024-03-25 22:25:21 +01:00
Oliver Drotbohm
ec78e1b8a1 Cache query method metadata to avoid repeated calculations.
We now calculate information about query methods in RepositoryInformationSupport lazily and keep it around to avoid repeated calculations that involve traversals over declared method and Stream allocations.

Fixes GH-3066.
2024-03-25 22:25:21 +01:00
Mark Paluch
ce368882f4 Add equals/hashCode support for Unpaged.
Closes #3061
2024-03-12 13:56:22 +01:00
Mark Paluch
aec8f1a45a Polishing.
Simplify code.

Original Pull Request: #3059
2024-03-08 14:11:31 +01:00
Mark Paluch
3db2669512 Do not create persistent properties for Map and Collection-like entities.
These types are expected to behave like maps and collections and should not carry properties.
The only exception are types implementing Streamable as Streamable can be used in domain types.

Resolves: #3056
Original Pull Request: #3059
2024-03-08 14:10:39 +01:00
Mark Paluch
8dbfb9a6ab Revert workaround for Java 8 ConcurrentHashMap bug.
Closes #3060
2024-03-07 16:07:29 +01:00
Mark Paluch
a32fe161d1 Polishing.
Handle warnings. Remove redundant code in DefaultReactiveEntityCallbacks.

Original pull request: #3053
See #3055
2024-03-01 11:49:08 +01:00
mawen12
dec7f74311 Remove redundant code in DefaultEntityCallbacks#callback.
Original pull request: #3053
Closes #3055
2024-03-01 11:49:08 +01:00
Mark Paluch
2df05fe3f2 Consider nested generics in TypeDiscoverer equality comparison.
We now compare nested generics wrapped into TypeInformation to consider type equality for deeply parametrized types.

Previously, we resolved type parameters to Class so Foo<List<String>> was considered equal to Foo<List<Map>> as the type parameter of the first nesting level was erased.

Closes #3051
2024-02-27 11:18:34 +01:00
Mark Paluch
c0ae3abbac Polishing.
Tiny naming tweaks.

See #3041
Original pull request: #3048
2024-02-21 14:19:57 +01:00
Christoph Strobl
25c7c7519e Default generic type arguments when resolving KType from a Class.
We now fill up missing KTypeProjection arguments with star because the Kotlin Reflection.typeOf resolution fails if arguments are not provided.

Closes #3041
Original pull request: #3048
2024-02-21 14:19:57 +01:00
Mark Paluch
2ebb6a768e Fix Javadoc build.
Remove package-info for package without sources.

See #3045
2024-02-19 16:12:34 +01:00
Mark Paluch
6bcff2623c Document converter types supported by CustomConversions.
Closes #3040
2024-02-14 09:25:01 +01:00
Mark Paluch
6e78e66740 Polishing.
Add additional tests, add Javadoc to explain isEnclosingClassParameter() behavior.

See #3038
Original pull request: #3039
2024-02-08 10:25:28 +01:00
Christoph Strobl
d333dc612b Use enclosing class constructor parameter only for non-static inner classes.
Closes #3038
Original pull request: #3039
2024-02-08 10:25:27 +01:00
Christoph Strobl
7817df4f61 Guard AOT registration of PageModule.
This commit makes sure to only register runtime hints for PageModule if Jackson is present.
Use newly introduced ClassPathExclusions instead of manually creating the ClassLoader.

Closes #3033
Original pull request: #3034
2024-01-24 16:17:44 +01:00
Mark Paluch
6b6a901708 Polishing.
Move hints into AOT package to align with other hints. Reduce visibility.

See: #3025
Original pull request: #3026
2024-01-22 09:20:31 +01:00
Christoph Strobl
15d411b79a Add missing runtime hit for Unpaged required by PageModule.
The PageModule is loading the Unpaged type via its name which requires additional reflection configuration for native images.

Closes: #3025
Original pull request: #3026
2024-01-22 09:20:31 +01:00
Christoph Strobl
6733a16943 Polishing.
Remove unused imports.

See: #3025
Original pull request: #3026
2024-01-22 09:20:31 +01:00
Oliver Drotbohm
190e9ed88e Polishing.
Related GH-3023.
2024-01-12 21:00:28 +01:00
Oliver Drotbohm
f2c3c8b523 Fix potential IllegalStateException in Limit.
Fixes GH-3023.
2024-01-12 21:00:26 +01:00
Oliver Drotbohm
a7aef1556a GH-2987 - Fix broken serialization of Unpaged instances.
We now reinstantiate the serialization of Unpaged instances as plain INSTANCE strings as they were rendered before Unpaged was changed from an enum into a class.

Note, that we still strongly advise, not to serialize Page instances directly as it's a domain type, its Jackson-level surface is subject to change if we need to change the type's API for unrelated reasons.
2024-01-11 17:01:20 +01:00
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