Commit Graph

2565 Commits

Author SHA1 Message Date
Greg L. Turnquist
1c42faf813 Extend query method special parameter types to any subclasses.
Spring Data Commons has a hard-coded list of special types than can be included in query methods including Pageable and Sort.

A custom finder with PageRequest, even though it extends Pageable, will fail when it would work fine with a narrowed input. This extends the list using an assignability check.

Related: spring-projects/spring-data-jpa#2013
See #2626.
2022-05-12 17:12:32 +02:00
Oliver Drotbohm
042c1a0149 Polishing.
Renamed RepositoryPersister(Factory) to AggregatePersister(Factory).

Issue #2558.
2022-05-12 12:39:42 +02:00
Christoph Strobl
f08c473b43 Polishing.
Reuse CRUD metdata from repository information and add some tests for the persister factory.
2022-05-12 12:39:38 +02:00
Mark Paluch
e5540b460a Support reactive repositories in ResourceReaderRepositoryPopulator.
We now support reactive repositories in addition to imperative repositories when populating repositories from a resource reader.

Instead of RepositoryInvokerFactory, we now use a RepositoryPersisterFactory to avoid introducing reactive support to RepositoryInvokerFactory.
2022-05-12 12:39:25 +02:00
Mark Paluch
f28100663a Polishing.
Rename test.
2022-05-12 12:39:10 +02:00
Oliver Drotbohm
0c96f79a2a MethodInvocationRecorder now supports traversing primitive properties.
We now return a default value for invocations of methods returning a primitive value to pass the AOP infrastructure's check for compatible values. Before, that barked at the null value returned for the invocation.

Fixes #2612.
2022-05-04 15:07:38 +02:00
Oliver Drotbohm
7f19125a7b CustomCollections is now less invasive to ConversionService.
Removed the removal of the general collection-to-object converter as apparently some downstream Spring Data modules rely on it. This theoretically allows conversions of collections into maps but we now simply don't assume that not to work anymore.

Issue #2619.
2022-05-03 22:47:42 +02:00
Oliver Drotbohm
048a3ddb1b Remove obsolete version properties.
Either completely obsolete or maintained in Spring Data Build.
2022-05-03 15:55:54 +02:00
Oliver Drotbohm
90fb5c7f46 Support for Eclipse Collections.
Using the newly introduced CustomCollectionsRegistrar SPI to provide support for Eclipse Collections (Imm|M)utable(List|Set|Bag|Map).

Fixes #2618.
2022-05-03 15:29:26 +02:00
Oliver Drotbohm
6ebe288f83 Improve custom collection support.
Custom collection support is now centralized in ….util.CustomCollections. It exposes API to detect whether a type is a map or collection, identifies the map base type etc.

Support for different collection implementations is externalized via the CustomCollectionRegistrar SPI that allows to define implementations via spring.factories. The current support for Vavr collections has been moved into an implementation of that, VavrCollections.

Unit tests for custom collection handling and conversion previously living in QueryExecutionConverterUnitTests have been moved into CustomCollectionsUnitTests.

Fixes #2619.
2022-05-03 15:28:31 +02:00
John Blum
b7e1b3793c Additional refinements.
Resolves #2577
Closes #2592
2022-04-29 14:38:16 -07:00
Mark Paluch
a106ec96c4 Polishing.
Rename generics from C extends PersistentProperty to P extends PersistentProperty.
Refine conversion setup. Make PropertyValueConversions.getValueConverter(…) to return non-null. Return PropertyValueConversions from CustomConversions.

Resolves #2577
Closes #2592
2022-04-29 14:38:10 -07:00
Mark Paluch
053875ced6 Introduce PropertyValueConversionService and specific null-conversion methods.
PropertyValueConverter read and write methods are never called with null values. Instead, PropertyValueConverter now defines readNull and writeNull to encapsulate null conversion. PropertyValueConversionService is a facade that encapsulates these details to simplify converter usage.

Resolves #2577
Closes #2592
2022-04-29 14:38:04 -07:00
Christoph Strobl
d4cc42649e After release cleanups.
See #2580
2022-04-19 11:21:17 +02:00
Christoph Strobl
51b360b467 Prepare next development iteration.
See #2580
2022-04-19 11:21:14 +02:00
Christoph Strobl
13317fad51 Release version 2.7 RC1 (2021.2.0).
See #2580
2022-04-19 11:10:52 +02:00
Christoph Strobl
7f339a3f39 Prepare 2.7 RC1 (2021.2.0).
See #2580
2022-04-19 11:10:13 +02:00
Mark Paluch
4346fb22e3 Upgrade to XMLBeam 1.4.23.
Closes #2605
2022-04-19 09:02:50 +02:00
John Blum
023160fb33 Fix mispelling of ClassUtils.getNumberOfOccurrences(..).
* Re-implement getNumberOfOccurrences(..) in terms of a Stream.
* Deprecate the mispelled getNumberOfOccurences(..) method and delegate to the new getNumberOfOccurrences(..) method.
* Edit Javadoc.

Closes #2600.
2022-04-12 11:20:19 -07:00
John Blum
d944f1e90a Fix grammatical errors in Exception messages.
Closes #2599.
2022-04-12 11:20:09 -07:00
Oliver Drotbohm
dc0dcca16d Fix PersistentEntity lookup in AbstractMappingContext.hasPersistentEntity(…)
Looking up a PersistentEntity via ….getPersistentEntity(…) applies some massaging of the given type as it could be a proxy type created for a user type. That wrangling was not applied in ….hasPersistentEntity(…) which resulted in a call to that method with a proxy type yielding false although it shouldn't if we already have a PersistentEntity available for the corresponding user type.

We now explicitly lookup the entity by original type and, if it's not the user type itself, try to look up the entity for the latter.

Fixes #2589.
2022-04-08 11:39:43 +02:00
Mark Paluch
8b5d0900bb Remove package cycle between mapping and convert.
Remove accessor methods to obtain annotated converters on PersistentProperty.

Closes #2576
2022-04-05 10:34:45 +02:00
Mark Paluch
55c0ca8765 Polishing.
Improve null-safety. Refine exception signature to avoid exception catching.

See #2590
Original pull request: #2591.
2022-04-05 09:16:36 +02:00
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
a6bd18c7ef Update build trigger.
See #2580
2022-03-23 11:24:23 +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
ab27812de1 After release cleanups.
See #2555
2022-03-21 10:20:32 -05:00
Greg L. Turnquist
fbe7e35284 Prepare next development iteration.
See #2555
2022-03-21 10:20:30 -05:00
Greg L. Turnquist
139e25eada Release version 2.7 M4 (2021.2.0).
See #2555
2022-03-21 10:09:33 -05: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
34d2109a6a Use Java 8 to build snapshots for Artifactory.
Closes #2557
2022-03-15 14:14:34 +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
8e5010c490 Update CI properties.
See #2555
2022-02-22 14:09:31 +01:00
Mark Paluch
0c652193c3 Upgrade to Maven Wrapper 3.8.4.
See #2561
2022-02-22 13:59:07 +01:00
Mark Paluch
79f075a117 Use Java 17 to build snapshots for Artifactory.
Closes #2557
2022-02-21 14:17:42 +01:00
Mark Paluch
1f9f806dc4 After release cleanups.
See #2533
2022-02-18 11:15:41 +01:00