Commit Graph

2085 Commits

Author SHA1 Message Date
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
Mark Paluch
e15c83467b Refine Query by Example string matching to call out store-specific limitations.
Closes #3058
2024-03-05 10:23:20 +01:00
Mark Paluch
e32b2668a1 Polishing.
Handle warnings. Remove redundant code in DefaultReactiveEntityCallbacks.

Original pull request: #3053
See #3055
2024-03-01 11:47:40 +01:00
mawen12
939c6143c1 Remove redundant code in DefaultEntityCallbacks#callback.
Original pull request: #3053
Closes #3055
2024-03-01 11:45:43 +01:00
Mark Paluch
f7a1066143 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:29 +01:00
Mark Paluch
047b6be83f Polishing.
Tiny naming tweaks.

See #3041
Original pull request: #3048
2024-02-21 14:19:51 +01:00
Christoph Strobl
9d73853244 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:51 +01:00
Mark Paluch
75728ac0be Fix Javadoc build.
Remove package-info for package without sources.

See #3045
2024-02-19 16:12:38 +01:00
Christoph Strobl
b90c8853cb Prepare 3.3 M1 (2024.0.0).
See #2981
2024-02-16 14:36:59 +01:00
Mark Paluch
9563f637fd Document converter types supported by CustomConversions.
Closes #3040
2024-02-14 09:24:50 +01:00
Mark Paluch
67163d02e3 Evolve ValueExpressionParser.
Introduce literal, expression and placeholder variants. Add parser for composite expressions.

Closes #2369
Original pull request: #3036
2024-02-12 15:35:19 +01:00
Christoph Strobl
9f13e5450d Add support for Value Expressions.
We now support Value Expressions such as `#{1+1}-${spring.application.name:fallback-value}` that are composed of SpEL expressions, literals and Property Placeholders.

See #2369
Original pull request: #3036
2024-02-12 15:35:18 +01:00
Mark Paluch
f6eacd208a Polishing.
Add additional tests, add Javadoc to explain isEnclosingClassParameter() behavior.

See #3038
Original pull request: #3039
2024-02-08 10:25:21 +01:00
Christoph Strobl
45b810a83c Use enclosing class constructor parameter only for non-static inner classes.
Closes #3038
Original pull request: #3039
2024-02-08 10:25:21 +01:00
Mark Paluch
098d779177 Polishing.
Javadoc, static imports.

See #3033
Original pull request: #3034
2024-01-24 16:18:19 +01:00
Christoph Strobl
18386c8b40 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:18:17 +01:00
Mark Paluch
36d6a78ded Polishing.
Simplify test arrangement, remove tests testing framework functionality.

See #3028
2024-01-22 09:52:52 +01:00
Yanming Zhou
b62bb535f1 Add more integration tests for PageSerializationMode configuration.
Closes #3028
2024-01-22 09:52:39 +01:00
Mark Paluch
09ea4426c5 Polishing.
Move hints into AOT package to align with other hints. Reduce visibility.

See: #3025
Original pull request: #3026
2024-01-22 09:22:02 +01:00
Christoph Strobl
3f2f013522 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:22:02 +01:00
Christoph Strobl
391ef3ea83 Polishing.
Remove unused imports.

See: #3025
Original pull request: #3026
2024-01-22 09:22:02 +01:00
Oliver Drotbohm
fe885b3b9b Fixing Javadoc.
Related: GH-3024.
2024-01-12 21:49:50 +01:00
Oliver Drotbohm
2c0ef666fe Polishing.
Related GH-3023.
2024-01-12 21:49:50 +01:00
Oliver Drotbohm
12efa9ae78 Fix potential IllegalStateException in Limit.
Fixes GH-3023.
2024-01-12 21:49:50 +01:00
Oliver Drotbohm
5dd7b322b6 Support for simplified rendering of Page instances via PagedModel.
This commits all necessary infrastructure to produce simplified JSON representation rendering for Page instances to make sure the representations stay stable and do not expose unnecessary implementation details. The support consists of the following elements:

- PagedModel, a stripped down variant of the Spring HATEOAS counterpart to produce an equivalent JSON representation but without the hypermedia elements. This allows a gradual migration to Spring HATEOAS if needed. Page instances can be wrapped into PagedModel once and returned from controller methods to create the new, simplified JSON representation.

- @EnableSpringDataWeb support now contains a pageSerializationMode attribute set to an enum with two possible values: DIRECT, which is the default for backwards compatibility reasons. It serializes Page instances directly but issues a warning that either the newly introduced support here or the Spring HATEOAS support should be used to avoid accidentally breaking representations. The other value, VIA_DTO causes all PageImpl instances to be rendered being wrapped in a PagedModel automatically by registering a Jackson StdConverter applying the wrapping transparently.

Internally, the configuration of @EnableSpringDataWebSupport is translated into a bean definition of a newly introduced type SpringDataWebSettings and wired into the web configuration for consideration within a Jackson module, customizing the serialization for PageImpl.

Fixes GH-3024.
2024-01-12 21:49:50 +01:00
Oliver Drotbohm
4ebe9361ed Issue a warning log when serializing PageImpl to JSON directly.
We now issue a one-time warning log if Jackson gets handed a PageImpl to serialize as the Jackson structure might need to change for arbitrary other reasons.

Fixes GH-2987.
2024-01-12 21:49:49 +01:00