Commit Graph

2110 Commits

Author SHA1 Message Date
Christoph Strobl
647d9fd949 Provide RepositoryMethodMetadata during method invocation.
Provide context during repository method invocation to potential consumers.

See: #3090
Original Pull Request: #3093
2024-08-08 13:46:55 +02:00
Mark Paluch
4df7a164e9 Consider fragments and repository contributions via spring.factories.
Closes: #3090
Original Pull Request: #3093
2024-08-08 13:45:01 +02:00
Mark Paluch
201657e78a Polishing.
Update javadoc and fix formatting.

Original Pull Request: #3093
2024-08-08 13:44:05 +02:00
Mark Paluch
1cdfb2e533 Fix KotlinCopyMethod detection for single-association property classes.
KotlinCopyMethod.shouldUsePublicCopyMethod(…) now considers single-association arrangements. Also, the method now early exists if pre-conditions aren't met.

Closes #3131
2024-08-06 15:14:35 +02:00
Oliver Drotbohm
0ba3937617 Explicitly reject invalid aggregate event registrations during publishing.
We now detect that the consumption of the events published during a persistence operation has produced new event instances that would go unpublished and raise an explaining exception. Previously such a scenario would've resulted in a ConcurrentModificationException.

We primarily reject such a scenario as handling the additional event would extend our convenience mechanism over the publishing scope a direct 1:1 replacement with ApplicationEventPublisher would've achieved.

Fixes GH-3116.
2024-08-06 09:02:18 +02:00
Christoph Strobl
1f347dce69 Add missing native image runtime hints for Jackson Page serialization.
Closes #3117
Original pull request: #3119
2024-08-05 14:53:03 +02:00
Christoph Strobl
431a1f5179 Fix property lookup for projections on Kotlin types.
This commit makes sure to use the target objects method to determine the property used for the projection.

Closes: #3127
Original pull request: #3129
2024-08-01 11:43:02 +02:00
Mark Paluch
2ee3a866a6 Bundle Javadoc with Antora documentation site.
Closes #3128
2024-07-31 09:27:07 +02:00
Mark Paluch
bb833a145c Revise Repositories initialization.
We now no longer declare cacheRepositoryFactory as synchronized to avoid locking. Additionally, simplify the flow and reuse computed values as much as possible.

Closes #3126
2024-07-26 10:34:13 +02:00
Mark Paluch
3dd3932d49 Polishing.
Simplify assertions.

See #3125
2024-07-23 11:35:48 +02:00
Mark Paluch
8a8c92e503 Consider declaring class when evaluating method return type for query method post-processing.
We now consider the declaring class to properly resolve type variable references for the result post-processing of a query method result.

Previously, we attempted to resolve the return type without considering the actual repository class resolving always Object instead of the type parameter.

Closes #3125
2024-07-23 11:35:47 +02:00
Mark Paluch
71484159cf Introduce Parameter.getRequiredName() method.
Add getRequiredName to shortcut parameter name discovery and fast-fail in cases where the parameter name is required.

Closes #3124
2024-07-23 09:18:02 +02:00
Jens Schauder
9ab34d8672 Further refactoring of PageableExecutionUtils.
Removing `isSubsequentPage`. It is another name for !isFirstPage suggesting a different meaning which isn't there.

Extracting `if (isFirstPage(pageable)) {`, further structuring the decision tree.

See #3103
Original pull request #3113
2024-07-01 12:57:57 +02:00
erie0210
47109d4bb1 Refactor PageableExecutionUtils.
Closes #3103
Original pull request #3113
2024-07-01 12:51:17 +02:00
Christoph Strobl
ec3ba10954 Polishing.
Delegate annotation attribute resolution to configured BeanNameGenerator resolving method and test for enabling reactive repositories.

Original Pull Request: #3083
2024-06-26 11:07:15 +02:00
Mark Paluch
2a8402c0c3 Polishing.
Use constants where possible.

Original Pull Request: #3083
2024-06-26 11:06:24 +02:00
Mark Paluch
a37a700b59 Add support for BeanNameGenerator configuration in Enable…Repositories.
We now accept a dedicated BeanNameGenerator in our Enable…Repositories annotations to override the importBeanNameGenerator.

Closes: #3082
Original Pull Request: #3083
2024-06-26 11:05:55 +02:00
Mark Paluch
a115ee6a44 Filter delegated properties for Kotlin data classes.
We now filter delegated properties (such as lazy) from being managed as persistent properties.

Closes #3112
2024-06-24 11:51:49 +02:00
Mark Paluch
2bed1f2ee5 Ignore getters for Kotlin types deviating from Java Beans spec.
We now ignore Kotlin getters that are either static methods or would require additional arguments.

Closes #3109
2024-06-18 11:33:03 +02:00
Mark Paluch
0e9dc7aec4 Polishing.
Provide load-factor to sets with well-known sizing, move annotation auditing metadata cache to DefaultAuditableBeanWrapperFactory to avoid strong static references.

See #3067
Original pull request: #3073
2024-06-13 13:56:38 +02:00
Christoph Strobl
b21b2e8934 Align internal caches with core framework patterns.
Initialize maps and sets with size where possible.

Closes #3067
Original pull request: #3073
2024-06-13 13:56:38 +02:00
Mark Paluch
d4301eea78 Populate DTO projection properties that are considered associations.
We now populate DTO properties whose are identified as associations. While uncommon, as typically entities declare assocations using entities, associations can be identified as types and so these are now considered when populating properties.

Closes #3104
2024-06-10 14:58:07 +02:00
Mark Paluch
857a239ec8 Polishing.
Defer message creation. Add test.

See #3091
2024-06-10 11:27:56 +02:00
kgignatyev
b822c5f9f4 Add offending type name to AbstractRepositoryMetadata verification exception message.
Closes #3091
2024-06-10 11:27:55 +02:00
Oliver Drotbohm
0a603f2e57 Use legacy page serialization mode if no SpringDataWebSettings are present.
Fixes GH-3101.
2024-05-30 23:34:48 +02:00
Mark Paluch
147f46d940 Prepare 3.3 GA (2024.0.0).
See #3079
2024-05-17 11:49:10 +02:00
Oliver Drotbohm
b09c503480 Polishing.
Ternary ifs and less nesting.

Related: GH-3094
Original pull request: GH-2865
2024-05-14 11:38:36 +02:00
Yanming Zhou
ae76d08403 Use Pageable.unpaged(sort) for sorted unpaged pageable.
The (Reactive)PageableHandlerMethodArgumentResolver now falls back to a unpaged Pageable instance with a resolved sort if the the resolved Pageable is unpaged.

Fixes: GH-3094
Original pull request: GH-2865
2024-05-14 11:38:04 +02:00
Alessandro Rubino
c2a475b42c Update links to direct section links.
Closes #3095
2024-05-14 09:54:43 +02:00
Mark Paluch
2f43bd593e Limit generics length to declared length.
Also, rename method to reflect what it actually returns.
Document generic usage constraints in RepositoryFactoryBeanSupport subclasses.

Closes #3089
2024-05-08 09:54:09 +02:00
Mark Paluch
18d31ec61d Document how projection types relate to the entity type hierarchy.
Closes #3092
2024-05-07 15:17:43 +02:00
Mark Paluch
b1a5fc460b Apply Kotlin Value Class unboxing to generated Property Accessors.
Unwrap wrapped value types if necessary when using generated property accessors.

Closes #3087
2024-04-29 09:12:57 +02:00
Mark Paluch
00d03c595b Polishing.
Add missing Javadoc and Serial annotations. Simplify code.

See #3081
2024-04-24 09:38:51 +02:00
Jan Kurella
7bac883930 Avoid NullPointerException´ and IllegalArgumentException for control flow in Sort`.
Checking for null explicitly is cheap and prevents two unnecessary Exception
objects creations.

Closes #3081
2024-04-24 09:38:15 +02:00
Mark Paluch
027b8c2ad2 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:53 +02:00
Alexander Münch
2f9427a94b Fix typo in object-mapping.adoc.
Closes #3076
2024-04-15 15:15:16 +02:00
Mark Paluch
5d067c56cd Polishing.
Reformat code. Use explicit local variable types instead of var.

See #3075
2024-04-15 15:11:42 +02:00
Yanming Zhou
797066dcc0 Use -1 instead of null as initial OffsetScrollPosition.
1. Use type `long` instead of `Long` to keep it consistent with previous version.
2. Position function is simplified to `offset+1`.

Closes #3075
2024-04-15 15:07:46 +02:00
Mark Paluch
2f4ab246f2 Prepare 3.3 RC1 (2024.0.0).
See #3065
2024-04-12 10:50:27 +02:00
Mark Paluch
855194a13d Polishing.
Introduce method to obtain a position function from OffsetScrollPosition. Tweak documentation wording.

See #3070
Original pull request: #3072
2024-04-10 10:41:52 +02:00
Christoph Strobl
eb184669db Revise OffsetScrollPosition to use zero-based indexesAlign Offset Scrolling Position.
Closes #3070
Original pull request: #3072
2024-04-10 10:41:35 +02:00
Oliver Drotbohm
88011e6003 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:25:38 +02:00
Oliver Drotbohm
dd081d4614 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:39:04 +02:00
Oliver Drotbohm
1c8471c384 Polishing.
Related ticket GH-3066.
2024-03-25 22:20:17 +01:00
Oliver Drotbohm
cf82e0fcda 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:20:12 +01:00
Mark Paluch
8db7ee426c Prepare 3.3 M2 (2024.0.0).
See #3045
2024-03-15 11:07:09 +01:00
Mark Paluch
f8f9610b59 Add equals/hashCode support for Unpaged.
Closes #3061
2024-03-12 13:56:14 +01:00
Mark Paluch
ee75b8cd78 Polishing.
Simplify code.

Original Pull Request: #3059
2024-03-08 14:27:37 +01:00
Mark Paluch
0766f2e56b 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:27:29 +01:00
Mark Paluch
5502fcf893 Revert workaround for Java 8 ConcurrentHashMap bug.
Closes #3060
2024-03-07 16:07:24 +01:00