Commit Graph

2055 Commits

Author SHA1 Message Date
Mark Paluch
4bd49f3f01 DATACMNS-1679 - Make ReactiveWrappers.ReactiveLibrary public.
Fix visibility for type that is used in the public API.
2020-03-11 08:47:42 +01:00
Mark Paluch
3831332f26 DATACMNS-1650 - Updated changelog. 2020-02-26 11:55:04 +01:00
Mark Paluch
5a3182aa18 DATACMNS-1648 - Updated changelog. 2020-02-26 11:31:47 +01:00
Mark Paluch
ed7561a880 DATACMNS-1673 - Polishing.
Convert instance field to constant. Use parameter count for iteration instead of cloning the parameter array.

Original pull request: #426.
2020-02-25 09:43:16 +01:00
SergiiTsypanov
eaaa37d4ff DATACMNS-1673 - Polishing.
Use method references where possible. Cleanup generics. Omit superfluous calls.

Original pull request: #426.
2020-02-25 09:39:17 +01:00
SergiiTsypanov
5f3102144c DATACMNS-1673 - Use Method.getParameterCount() where possible to improve performance.
Original pull request: #426.
2020-02-25 09:39:12 +01:00
Zed Spencer-Milnes
48e49babe3 DATACMNS-1672 - Fix code sample in documentation.
Add required parentheses to method call.

Original pull request: #335.
2020-02-25 09:29:12 +01:00
wonwoo
12b9850a85 DATACMNS-1672 - Fix typos in Javadoc.
Original pull request: #431.
2020-02-25 09:23:52 +01:00
Mark Paluch
09e3bedf74 DATACMNS-1671 - Forward-port unit test.
Add unit test to remain consistent across branches.
2020-02-24 15:40:08 +01:00
Mark Paluch
64d08294ae DATACMNS-1655 - After release cleanups. 2020-02-12 15:04:22 +01:00
Mark Paluch
a4cc2209f8 DATACMNS-1655 - Prepare next development iteration. 2020-02-12 15:04:21 +01:00
Mark Paluch
1d47b5bd63 DATACMNS-1655 - Release version 2.3 M3 (Neumann). 2020-02-12 14:47:16 +01:00
Mark Paluch
c952998740 DATACMNS-1655 - Prepare 2.3 M3 (Neumann). 2020-02-12 14:46:56 +01:00
Mark Paluch
705baa540e DATACMNS-1655 - Updated changelog. 2020-02-12 14:46:47 +01:00
Henri
f0d7a657fc DATACMNS-1212 - Remove unnecessary conversion between Instant and ZonedDateTime.
Converting from instant to ZoneDateTime and back to Instant does not seem to have a purpose as the timezone information will never be used

Original pull request: #260.
2020-02-12 12:02:14 +01:00
minsungryu
656fb75c22 DATACMNS-1661 - Add missing parameter to object-mapping property population in reference docs.
Original pull request: #429.
2020-02-12 11:43:14 +01:00
Mark Paluch
ea9c6176af DATACMNS-1666 - Deprecate Joda-Time and ThreeTenBackport support.
Joda-Time and ThreeTenBackport converters are now deprecated in favor of JSR-310 (java.time) support. These converters are now in maintenance mode without receiving future enhancements.
2020-02-12 10:52:07 +01:00
Mark Paluch
148c859be6 DATACMNS-1665 - Consider store conversions as ConverterRegistrationIntent.
Store converters are now properly considered as registration candidates.

Original Pull Request: #430
2020-02-11 10:28:07 +01:00
Mark Paluch
09153baf62 DATACMNS-1615 - Polishing.
Replace list creation with constant. Replace ConverterConfiguration.skipFor list with Predicate for flexible conditions. Fix typo. Simplify conditionals.

Original pull request: #421.
2020-02-07 12:14:05 +01:00
Christoph Strobl
dbcf9aefff DATACMNS-1615 - Allow fine grained store specific converter registration.
CustomConversions now registers all given user defined converters and selects only those converters from the StoreConversions that convert to or from a store supported simple type.
By doing so we make sure to only register supported converters which removes warning messages from the log and reduces the number of converters within the ConversionService.

Original pull request: #421.
2020-02-07 12:13:54 +01:00
Oliver Drotbohm
d5786edec7 DATACMNS-1610 - Polishing. 2020-02-03 13:53:17 +01:00
Oliver Drotbohm
5cdb3139a4 DATACMNS-1610 - Improved property path access.
We now expose a dedicated PersistentPropertyPathAccessor and optionally take options for both the read and write access to properties. On read, clients can define to eagerly receive null in case one of the path segments is null. By default, we reject those as it indicates that there might be an issue with the backing object if the client assumes it can look up the more deeply nested path to receive a result.

On write access clients can define to either reject, skip or log intermediate null segments where skip means, that the setting is just silently aborted. Clients can also control how to deal with collection and map intermediates. By default we now propagate the attempt to set a value to all collection or map items respectively. This could be potentially extended to provide a filter receiving both the property and property value to selectively propagate those calls in the future.

The separation of these APIs (PersistentPropertyAccessor and PersistentPropertyPathAccessor) is introduced as the latter can be implemented on top of the former and the former potentially being dynamically generated. The logic of the latter can then be clearly separated from the actual individual property lookup. ConvertingPropertyAccessor is now a PersistentPropertyPathAccessor, too, and overrides SimplePersistentPropertyPathAccessor.getTypedProperty(…) to plug in conversion logic. This allows custom collection types being used if the ConversionService backing the accessor can convert from and to Collection or Map respectively.

Deprecated all PersistentPropertyPath-related methods on PersistentPropertyAccessor for removal in 2.3.

MappingAuditableBeanWrapperFactory now uses these new settings to skip both null values as well as collection and map values when setting auditing metadata.

Related tickets: DATACMNS-1438, DATACMNS-1461, DATACMNS-1609.
2020-02-03 13:11:44 +01:00
taeyeonkim
70f973f6f9 DATACMNS-1660 - Add anchor to object-mapping recommendations in reference docs.
Original pull request: #428.
2020-01-28 15:08:30 +01:00
Mark Paluch
b69ef25dc2 DATACMNS-1652 - After release cleanups. 2020-01-17 09:47:50 +01:00
Mark Paluch
fa1e9dc199 DATACMNS-1652 - Prepare next development iteration. 2020-01-17 09:47:49 +01:00
Mark Paluch
562cb60acf DATACMNS-1652 - Release version 2.3 M2 (Neumann). 2020-01-17 09:39:03 +01:00
Mark Paluch
a15834b7a8 DATACMNS-1652 - Prepare 2.3 M2 (Neumann). 2020-01-17 09:38:43 +01:00
Mark Paluch
2ad517c7a2 DATACMNS-1652 - Updated changelog. 2020-01-17 09:38:33 +01:00
Mark Paluch
5bd2bc5bb9 DATACMNS-1587 - After release cleanups. 2020-01-16 16:11:55 +01:00
Mark Paluch
8b41f07e28 DATACMNS-1587 - Prepare next development iteration. 2020-01-16 16:11:54 +01:00
Mark Paluch
e995818bba DATACMNS-1587 - Release version 2.3 M1 (Neumann). 2020-01-16 16:05:23 +01:00
Mark Paluch
7b531df14b DATACMNS-1587 - Prepare 2.3 M1 (Neumann). 2020-01-16 16:05:03 +01:00
Mark Paluch
14c5f7e61b DATACMNS-1587 - Updated changelog. 2020-01-16 16:04:58 +01:00
Oliver Drotbohm
d05dd24a4b DATACMNS-1639 - Re-instantiate API in legacy EntityInstantiators.
To retain backwards compatibility for the legacy EntityInstantiators API, we now adapt the map values for custom instantiators that are handed into the constructors of EntityInstantiators.
2020-01-16 14:47:32 +01:00
Mark Paluch
781ef48987 DATACMNS-1508 - Guard test to run only on Java 8.
Java 9 introduced different class loaders so it's no longer possible to have a test that covers both setups.
2020-01-16 11:58:19 +01:00
Christoph Strobl
769b0f6af5 DATACMNS-1508 - Polishing.
Add findAllById, deleteAll to CoroutineCrudRepository.

Keep CoroutineCrudRepository somewhat in sync with ReactiveCrudRepository by adding based methods for those accecpting Publisher.
Also add some test.

Update License Headers of Kotlin files and fix some warnings. Switch to kotlin-test-junit5.

Original pull request: #415.
2020-01-16 11:28:39 +01:00
Mark Paluch
93c708379e DATACMNS-1508 - Address review comments.
Added ClassUtils.ifPresent(…) to conditionally call back a Consumer<Class> if a class is available from the given ClassLoader. Extract isSuspend(…) method into KotlinReflectionUtils. Deprecate Kotlin-related methods in our ReflectionUtils as parts are available from Spring Framework directly.

Rename CoCrudRepository to CoroutineCrudRepository and CoroutineSortingRepository. Add tests for KotlinReflectionUtils to test calls without Kotlin dependencies.

Original pull request: #415.
2020-01-16 11:28:39 +01:00
Mark Paluch
c945fa4f9a DATACMNS-949 - Drop own converters in favor of ReactiveAdapterRegistry.
We now reuse ReactiveAdapterRegistry as much as possible instead of registering our own converters.

Original pull request: #415.
2020-01-16 11:28:39 +01:00
Mark Paluch
ce7683c672 DATACMNS-1508 - Support for Kotlin Coroutines repositories.
We now support Kotlin Coroutines repositories backed by reactive repositories. Coroutine repositories can either invoke reactive query methods or implemented methods that are backed either by methods returning a reactive wrapper or that are native suspended functions.

Exclude Coroutines Continuation from bindable parameters and name discovery and do not unwrap results for suspended functions returning a reactive type.

interface CoroutinesRepository : CoroutineCrudRepository<User, String> {

    suspend fun findOne(id: String): User

    fun findByFirstname(firstname: String): Flow<User>
}

Original pull request: #415.
2020-01-16 11:28:33 +01:00
Oliver Drotbohm
1d2b81bec8 DATACMNS-1639 - Introduce InstantiationAwarePropertyAccessor.
We now ship and use a PropertyAccessor implementation by default that will fall back to use the persistence constructor and creating a new instance to "set" a property. This allows completely immutable types, ommitting previously needed wither methods, e.g. to populate automatically generated identifier values.

This is implemented by using the EntityInstantiator available and a ParameterValueProvider that returns the value of the properties of the current instance but replacing the one for the value to be set. This requires moving EntityInstantiators, the EntityInstantiator SPI as well as all existing implementations (reflective, class generating and the Kotlin one) into the mapping.model package. Legacy instances stay around in deprecated form to avoid breaking existing clients (other store modules as well as user implementations of EntityInstantiator).

The newly introduced implementations stay package protected as their sole users are now colocated in the same package. Access from the legacy types is handled via InternalEntityInstantiatorFactory, which is introduced in deprecated from for removal alongside the actual deprecations.
2020-01-16 11:20:17 +01:00
Shaun Chyxion
09a7de07ad DATACMNS-1651 - Fix typo in Javadoc.
Correct comment "subject" -> "predicate"

Original pull request: #427.
2020-01-16 11:06:47 +01:00
Mark Paluch
f1356fbb95 DATACMNS-1633 - Updated changelog. 2020-01-15 12:51:13 +01:00
Mark Paluch
ff96a58809 DATACMNS-1632 - Updated changelog. 2020-01-15 10:36:36 +01:00
Oliver Drotbohm
1406af8f71 DATACMNS-1647 - Switched to use factory methods of RepresentationModel types. 2020-01-14 14:49:45 +01:00
Mark Paluch
b69141ac17 DATACMNS-1645 - Add search prefix for part tree queries.
We're adding search as prefix for derived repository query methods to improve readability when a Spring Data module is integrated with a search engine. Now it's possible to create a `search…By…` query like `searchByFirstname`.
2020-01-13 15:36:29 +01:00
Greg Turnquist
4adef63610 DATACMNS-990 - Enable builds on JDK 11+. 2020-01-09 09:47:52 -06:00
Mark Paluch
eed7658ce5 DATACMNS-1643 - Update copyright years to 2020. 2020-01-07 08:32:25 +01:00
Oliver Drotbohm
664e661783 DATACMNS-1593, DATACMNS-1635 - Overhauled null handling in QuerydslPredicateArgumentResolver.
QuerydslPredicateArgumentResolver now properly handles predicate lookups that result in null values. The semantics of a handler method parameter of type of Querydsl's Predicate have been tightened to always see a non-null Predicate by default. Users that want to handle the absence of predicates explicitly can opt into seeing null by annotating the parameter with @Nullable or use Optional<Predicate>.

QuerydslPredicateBuilder now consistently returns null in case the original parameter map is entirely empty or consists of only keys with empty value arrays as empty form submissions do. This partially reverts the work of DATACMNS-1168, which moved into the direction of returning a default Predicate value for empty maps in the first place. That however prevents us from producing empty Optionals.

Related tickets: DATACMNS-1168.
2019-12-10 14:52:06 +01:00
Oliver Drotbohm
9b63646e82 DATACMNS-1630 - Removed custom copy of ShadowingClassLoader in favor of Spring's one. 2019-12-09 17:37:44 +01:00
Oliver Drotbohm
eff3850806 DATACMNS-1620 - Polishing.
Moved off deprecated API for annotation introspection. Move application of primary flag for bean definitions from RepositoryConfigurationDelegate to RepositoryBeanDefinitionBuilder.
2019-12-09 17:37:44 +01:00