Commit Graph

1752 Commits

Author SHA1 Message Date
Christoph Strobl
fe124ca598 Eagerly initialize SimplePropertyValueConversions.
Closes #2590
Original pull request: #2591.
2022-04-05 09:16:35 +02:00
Oliver Drotbohm
37b072f226 Polishing for full type information on RepositoryMetadata.
Avoid leaking internals from TypeInformation by exposing a ….toTypeDescriptor() method in TypeInformation directly. This causes the ResolvableType handling to become an implementation detail within ClassTypeInformation and avoid client code to manually deal with both ResolvableType and TypeDescriptor creation.

Changed MethodLookups back to use the resolved domain types as the advanced generics resolutions seems not to be needed here and we can avoid

Fixes #2518.

$ Conflicts:
$	src/main/java/org/springframework/data/util/TypeDiscoverer.java
2022-04-04 16:50:20 +02:00
Alex Nistico
d19cd4eaeb Use full type information for identifier and domain types exposed byRepositoryMetadata.
See #2518.

$ Conflicts:
$	src/test/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadataUnitTests.java
2022-04-01 17:56:00 +02:00
Mark Paluch
0ae04a219e Polishing.
Tweak Javadoc comments.

See #2585
2022-03-25 13:37:42 +01:00
Mark Paluch
017900f016 Retain case-sensitivity and null-handling when changing Sort direction.
We now retain case-sensitivity and null-handling configuration when changing the entire Sort direction.

Closes #2585
2022-03-25 13:37:42 +01:00
Mark Paluch
2d1b6a77b5 Gracefully skip non-assignable lambda callbacks on Java 18.
We now consider IllegalArgumentException as marker for incompatible lambda payload that was introduced with Java 18's reflection rewrite that uses method handles internally.

Closes #2583
2022-03-23 10:43:53 +01:00
Greg L. Turnquist
74a5f06dd1 Prepare 2.7 M4 (2021.2.0).
See #2555
2022-03-21 10:07:07 -05:00
Mark Paluch
e87181e206 Polishing.
Fix Javadoc.

See #2566
2022-03-18 15:15:36 +01:00
Mark Paluch
b6b1ec9c4c Polishing.
Consistent wording for pageable and sort arguments.

See #2574
2022-03-18 15:07:11 +01:00
Diego Krupitza
43bba35dec Update documentation for repository Pageable and Sort arguments.
Replace outdated `null` acceptance for `Pageable` with `Pageable.unpaged()`
 `QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)` should does not accept null values since there is `Pageable.unpaged()`. Furthermore, the same applies to `PagingAndSortingRepository#findAll(Pageable pageable)`.

Related ticket: spring-projects/spring-data-jpa/issues/2464
Closes #2574
2022-03-18 15:03:58 +01:00
Mark Paluch
d86322ee6f Polishing.
Increase visibility of converter builders.

Refine generics naming towards DV/SV instead of A/B to easier identify store-native values and domains-specific values in the API. Refactor PropertyValueConversions.hasValueConverter into a non-default method.

Tweak documentation.

See #1484
Original pull request: #2566.
2022-03-18 14:53:13 +01:00
Christoph Strobl
4221ae9dcd Refine API and property-converter documentation.
See #1484
Original pull request: #2566.
2022-03-18 14:53:13 +01:00
Oliver Drotbohm
7394568338 Fluent registration API for PropertyValueConverters.
Introduce a builder API to register PropertyValueConverters using simple (Bi)Functions. Additional methods on ValueConversionContext to enable advanced use cases in converter implementation. Tweak generics of VCC to be able to expose store-specific PersistentProperty implementations via the context.

See #1484
Original pull request: #2566.
2022-03-18 14:53:09 +01:00
Christoph Strobl
aa72129a4c Add support for property-specific converters.
Closes #1484
Original pull request: #2566.
2022-03-18 14:51:51 +01:00
Mark Paluch
9df8a32b85 Accept Object values in QuerydslPredicateBuilder.
We now accept Object-typed values to allow broader reuse of QuerydslPredicateBuilder. The conversion into the actual value considers the origin type and checks assignability before employing the ConversionService.

Closes #2573
2022-03-10 10:21:46 +01:00
Mark Paluch
e3639eaf44 Polishing.
Lazily make methods and fields accessible. Introduce invoke method to AnnotationDetectionMethodCallback.

See #2569
2022-03-02 14:43:26 +01:00
Mark Paluch
e0245c7b42 Consider annotated methods in AnnotationRevisionMetadata.
We now detect annotated methods.

Closes #2569
2022-03-02 14:43:26 +01:00
Mark Paluch
19f4fd17bd Update documentation of AbstractEntityInformation.
Align documentation with the code behavior as the behavior was changed but the documentation was not updated with the previous change.

Closes #2567
2022-03-02 08:52:07 +01:00
Mark Paluch
56240530eb Prepare 2.7 M3 (2021.2.0).
See #2533
2022-02-18 11:08:46 +01:00
Mark Paluch
43e0733605 Clarify Javadoc for FallbackPageable in PageableHandlerMethodArgumentResolverSupport.
Closes #2551
2022-02-17 14:36:40 +01:00
Christoph Strobl
7229b3e711 Update copyright year to 2022.
See: #2552
2022-02-17 12:42:44 +01:00
Oliver Drotbohm
a948ff922c AbstractPersistentProperty.isMap() now delegates to underlying TypeInformation.
Issue #2549
2022-02-16 15:53:45 +01:00
Oliver Drotbohm
34ce82b0e5 Introduce standard DtoInstantiatingConverter.
Move simple Spring Converter implementation that allow to create DTOs from a source object previously copied amongst a variety of store modules.

Issue #2476.
2022-02-15 15:56:53 +01:00
Oliver Drotbohm
1e38b4c6ba Polishing of annotation model for object creators.
Move to @PersistenceCreator as canonical annotation to explicitly express constructors and methods to be used to create domain object instances from persistence operations. Removed @FactoryMethod as it's not needed anymore. @PersistenceConstructor is now deprecated.

Renamed EntityCreatorMetadata(Support|Discoverer) to InstanceCreatorMetadata(Support|Discoverer) to avoid further manifestation of the notion of an entity in the metamodel as it's not used to only handle entities.

Issue #2476.
2022-02-15 15:25:01 +01:00
Mark Paluch
ec0c0d3cb2 Introduce support to create domain objects via factory methods.
Issue #2476.
2022-02-15 12:09:29 +01:00
Oliver Drotbohm
81d179c8f7 Polishing.
Reorder methods according to conventions. More speaking names for the newly introduced type lookup methods.

Issue #2517.
2022-02-14 14:30:28 +01:00
nexx512
d832052625 Fixed resolving generic types for Vavr maps.
Issue #2517.
2022-02-14 14:30:23 +01:00
Oliver Drotbohm
f933b4562e Complete Vavr collection detection on TypeInformation and CustomConversions.
Moved Vavr collection converters into a type in the utility package. Register the converters via CustomConversions.registerConvertersIn(…) to make sure that all the Spring Data object mapping converters automatically benefit from a ConversionService that is capable of translating between Java-native collections and Vavr ones.

Issue #2511.
2022-02-14 10:31:29 +01:00
nexx512
5b568953e9 Consider Vavr collections to be collection like in TypeInformation.
Issue #2511.
2022-02-14 10:31:28 +01:00
Oliver Drotbohm
44a472c695 Simpler check to avoid primitive conversion in ConvertingPropertyAccessor.
We now use Spring's ClassUtils.isAssignable(…) directly. Unit tests to verify that conversion is skipped for primitive / boxed scenarios.

See #2546.
2022-02-14 10:02:34 +01:00
Mark Paluch
f52bc25046 Performance improvements in ReactiveWrappers and ConvertingPropertyAccessor.
We now cache whether types are reactive wrappers and bypass the ConversionService for assignable primitive values.

Closes #2546
2022-02-11 15:21:25 +01:00
Mark Paluch
ca5676d904 Refine PropertyReferenceException message.
Use single-quotes to indicate which elements belong to the underlying type and which are part of the textual message.

Closes #2395
2022-01-25 14:42:43 +01:00
Mark Paluch
8e8ce00750 Refine Coroutine wording around when to use suspend in method declarations.
Closes #2503
2022-01-25 11:08:46 +01:00
Mark Paluch
ca6c0185e4 Document dynamic projections parameter detection.
Closes #2510
2022-01-25 09:50:29 +01:00
Christoph Strobl
fadeb2e29a Prepare 2.7 M2 (2021.2.0).
See #2529
2022-01-18 09:08:59 +01:00
yelis913
cd26bff381 Add missing verb to the error message.
Closes #2524
2022-01-17 11:15:00 +01:00
Christoph Strobl
c3cdebf339 Prepare 2.7 M1 (2021.2.0).
See #2497
2022-01-14 10:57:50 +01:00
Mark Paluch
3f44d268b6 Fix spliterator size hint in CloseableIterator.spliterator().
We now report -1 as size to avoid zero-size results for count() or toList() operators.

Closes #2519
2022-01-03 13:50:33 +01:00
Jens Schauder
6cf2634a64 Fixed dependency cycle.
Closes #2514
2021-12-14 15:06:14 +01:00
Christoph Strobl
ecec2e5666 Polishing.
Replace boolean flag with enum, assert open vs. closed projection and update javadoc.

Original Pull Request: #2420
2021-12-13 13:03:18 +01:00
Mark Paluch
a63774e6ec Add support for properties using deep map-in-map/list-in-map nesting.
Original Pull Request: #2420
2021-12-13 13:02:52 +01:00
Mark Paluch
0744580766 Move EntityProjection from inner class to top-level class.
Original Pull Request: #2420
2021-12-13 13:02:25 +01:00
Mark Paluch
0c80e9fa46 Add Predicates utility.
Original Pull Request: #2420
2021-12-13 13:02:01 +01:00
Mark Paluch
b189240aaf Polishing.
Original Pull Request: #2420
2021-12-13 13:01:27 +01:00
Mark Paluch
caa8c6afc5 Refactor PropertyFilterSupport into EntityProjectionIntrospector.
Original Pull Request: #2420
2021-12-13 13:00:59 +01:00
Mark Paluch
9948fefe69 Provide class for inspecting nested projections.
Original Pull Request: #2420
2021-12-13 13:00:20 +01:00
heowc
8969a55c27 Add @Nullable to ParametersParameterAccessor.getValue().
Add missing Override and Nullable annotations. Update Javadoc to mention correct return value.

Closes #2506
2021-12-13 10:53:59 +01:00
Mark Paluch
ea335f06ef Polishing.
Add missing override annotations.

See #2508
2021-12-09 11:18:51 +01:00
Mark Paluch
6a52f274f6 Introduce configuration of class loader in SimpleTypeInformationMapper.
We now support configuration of the class loader in SimpleTypeInformationMapper to use a configured class loader instead of falling always back to the default/contextual class loader. In arrangements where the contextual class loader isn't able to provide access to the desired classes (e.g. parallel Streams, general Fork/Join Thread usage) the contextual class loader may not have access to the entity types. By implementing BeanClassLoaderAware, we can now propagate a configured class loader.

Closes #2508
2021-12-09 11:17:46 +01:00
Mark Paluch
ef522f8e9c Polishing.
Extract duplicate calls to findAnnotation(…) into static helper methods.

See #2500
2021-12-08 14:04:36 +01:00