Commit Graph

2154 Commits

Author SHA1 Message Date
Christoph Strobl
d4e94109df DATACMNS-1231 - Introduce dedicated Auditor value object.
Original Pull Request: #458
2020-07-17 11:16:43 +02:00
Mark Paluch
d3af4a79e4 DATACMNS-1231 - Add reactive auditing infrastructure.
We now provide a reactive variant for auditing with ReactiveAuditingHandler and ReactiveIsNewAwareAuditingHandler.

Extracted common auditing functionality into AuditingHandlerSupport which serves as base class for AuditingHandler and ReactiveAuditingHandler.

Original Pull Request: #458
2020-07-17 10:14:10 +02:00
Mark Paluch
0c37484b19 DATACMNS-1768 - Polishing.
Reduce test visibility. Remove forEach detour through stream().
2020-07-14 09:50:40 +02:00
Mark Paluch
ebcea509b8 DATACMNS-1768 - Reuse bean state in InstantiationAwarePropertyAccessor when setting multiple properties.
We now reuse the new bean in InstantiationAwarePropertyAccessor when setting properties. Previously, we used the initial bean state as the bean was held by a delegate PersistentPropertyAccessor which caused only the last set property to be visible.
2020-07-14 09:50:40 +02:00
Oliver Drotbohm
f6630a5dd5 DATACMNS-1663 - Polishing.
A few refactorings for more readable code in the publishing method interceptor. Tweaks to the reference documentation to include the CrudRepository methods that now also publish the events.

Original pull request: #436.
2020-07-13 18:05:01 +02:00
Réda Housni Alaoui
889ae01c7c DATACMNS-1663 - Support domain events for deletions.
Domain events are now also published on calls to CrudRepository.delete(…) and ….deleteAll(…).

Original pull request: #436.
2020-07-13 18:05:01 +02:00
Mark Paluch
00d77d03cd DATACMNS-1767 - Polishing.
Reformat code. Use reflection for property access when running within a native image.

Original pull request: #456.
2020-07-13 14:25:59 +02:00
Christoph Strobl
ff0a8f77e8 DATACMNS-1767 - Disable ClassGeneratingEntityInstantiator when running native-image.
Always fall back to reflection when the system property for org.graalvm.nativeimage.imagecode is set.
This is required because on the fly code generation is not supported in this case.

Original pull request: #456.
2020-07-13 14:25:48 +02:00
Mark Paluch
e19bdb8fc4 DATACMNS-1758 - Revert optimizations from DATACMNS-1698.
We ensure that each EntityCallback retrieval operates on its own List to not share the retrieved callback list with other threads.
2020-07-09 14:15:30 +02:00
Mark Paluch
80299838b3 DATACMNS-1763 - Expose ReactiveWrapperConverters.doOnSuccess and doOnError callback hooks.
We now provide callback hook operators that allow attaching of a Runnable and Consumer<Throwable> to a reactive wrapper type for participating in terminal signals.
2020-07-06 11:32:45 +02:00
Mark Paluch
e6beb5ec8e DATACMNS-1725 - After release cleanups. 2020-06-25 11:58:22 +02:00
Mark Paluch
3d9146ceab DATACMNS-1725 - Prepare next development iteration. 2020-06-25 11:58:19 +02:00
Mark Paluch
dd0d19366b DATACMNS-1725 - Release version 2.4 M1 (2020.0.0). 2020-06-25 11:48:49 +02:00
Mark Paluch
e4b3bc3823 DATACMNS-1725 - Prepare 2.4 M1 (2020.0.0). 2020-06-25 11:48:19 +02:00
Mark Paluch
944277725d DATACMNS-1725 - Updated changelog. 2020-06-25 11:48:02 +02:00
Mark Paluch
8815ff61e9 DATACMNS-1755 - Polishing.
Consistently remove linebreak after license header.

Original pull request: #448.
2020-06-25 11:20:49 +02:00
Phillip Webb
d72ccdacf6 DATACMNS-1755 - Fix malformed copyright headers.
Fix a few copyright headers that had formatting or date issues.

Original pull request: #448.
2020-06-25 11:20:41 +02:00
Phillip Webb
5734cfe878 DATACMNS-1755 - Use specialized assertThat*Exception.
When possible replace `assertThatExceptionOfType` calls with the
equivalent specialized variant.

Original pull request: #448.
2020-06-25 11:20:31 +02:00
Phillip Webb
86bda64daa DATACMNS-1755 - Declare each variable in its own statement.
Update classes so that each member is declared on its own line. This
help to make them slightly easier to see when not using an IDE.

Original pull request: #448.
2020-06-25 11:20:28 +02:00
Phillip Webb
67442077b7 DATACMNS-1755 - Consistently use commons-logging.
Replace the few occurrences where SLF4J was being used directly so that
all logging now happens via commons-logging. The log patterns used in
SLF4J messages have been replaced with `LogMessage` which was introduced
in Spring Framework 5.2.

Original pull request: #448.
2020-06-25 11:20:24 +02:00
Phillip Webb
b225acd22d DATACMNS-1755 - Fix wrong Optional import.
Fix `DefaultRepositoryMetadataUnitTests` to import the `java.util`
version of `Optional` rather than the `com.google` variant.

Original pull request: #448.
2020-06-25 11:20:18 +02:00
Phillip Webb
5c3bb895c7 DATACMNS-1755 - Fix array style.
Update `ClassGeneratingPropertyAccessorFactoryDatatypeTests` to use
the more common `String[] var` array style.

Original pull request: #448.
2020-06-25 11:20:09 +02:00
Phillip Webb
32826eec05 DATACMNS-1755 - Replace anonymous class with static initializer.
Replace the use of an anonymous class with a static initializer block.
This update also changes the constant to an unmodifiable variant.

Original pull request: #448.
2020-06-25 11:20:03 +02:00
Phillip Webb
161250855a DATACMNS-1755 - Import 'Function' and use short-form in code.
Import `java.util.Function` to allow more concise code.

Original pull request: #448.
2020-06-25 11:19:55 +02:00
Phillip Webb
b42cdb6568 DATACMNS-1755 - Use method references in favor of lambdas.
Simplify several lambda expressions in the codebase by using
method references.

Original pull request: #448.
2020-06-25 11:19:52 +02:00
Phillip Webb
cb8443e299 DATACMNS-1755 - Rename uppercase 'CACHE' static finals.
Rename static final `CACHE` members to use the lowercase form. Although
the caches are static final, they are not constant values.

Original pull request: #448.
2020-06-25 11:19:44 +02:00
Phillip Webb
df5f42ce29 DATACMNS-1755 - Drop Java 8 check.
Remove explicit Java 8 check since it is now the minimum supported
version.

Original pull request: #448.
2020-06-25 11:19:36 +02:00
Phillip Webb
ea263b233b Rename uppercase 'LOGGER' static finals
Rename static final `LOGGER` members to use the lowercase form.
Although the loggers are static final, they are not constant values.
2020-06-25 11:09:16 +02:00
Mark Paluch
c9a5a19738 DATACMNS-1753 - Polishing.
Check for deferred types in ReactiveWrappers so that ReactiveWrapperConverters remains untouched as wrapper conversion from a reactive type into CompletableFuture is still possible from a ReactiveWrapperConverters perspective.

Original pull request: #450.
2020-06-25 10:46:44 +02:00
Gerrit Meier
558272e57b DATACMNS-1753 - Don't consider CompletableFuture as reactive type.
CompletableFuture use is permitted in imperative repositories so we should not use CompletableFuture as indicator to switch a repository implementation to a reactive one.

Original pull request: #450.
2020-06-25 10:45:53 +02:00
Mark Paluch
2c25a591fb DATACMNS-1750 - Polishing. 2020-06-22 15:27:10 +02:00
Mark Paluch
4bc474d8f4 DATACMNS-1750 - Refrain from inspecting Page contents if first item is null. 2020-06-22 15:27:10 +02:00
Mark Paluch
9ff82472ac DATACMNS-1653 - Polishing.
Remove superfluous static keyword from enum declarations.

Original pull request: #444.
2020-06-21 20:06:26 +02:00
Mark Paluch
d3260d3caa DATACMNS-1653 - Add support for RxJava 3.
We now include adapters and registry information for RxJava 3 types.

Original pull request: #444.
2020-06-21 20:05:53 +02:00
Oliver Drotbohm
52154f6986 DATACMNS-1743 - Polishing.
We now avoid identifier conversion in ReflectionrepositoryConverter if not necessary. Reestablish a couple of unit tests for DomainClassConverter that were disabled by accident.
2020-06-16 16:11:26 +02:00
Oliver Drotbohm
aa1c1d4f15 DATACMNS-1743 - Fixed handling of failed aggregate lookup in DomainClassConverter.
We now fall back to null in case the repository lookup for the aggregate results in an absent value rather than returning the source unconverted.
2020-06-16 15:22:06 +02:00
Oliver Drotbohm
f65451d777 DATACMNS-1745 - Polishing.
Made the reference to RepositoryInformation non-nullable from the RepositoryAnnotationTransactionAttributeSource (previously RepositoryInformationPreferring…). Adapted test cases accordingly.
2020-06-16 14:31:15 +02:00
Mark Paluch
a76ed28fe7 DATACMNS-1745 - Refactor CustomAnnotationTransactionAttributeSource to use computeTransactionAttribute template method.
We now no longer duplicate Spring Framework code as AbstractFallbackTransactionAttributeSource exposes computeTransactionAttribute which we can use to override to determine TransactionAttribute from the repository interface.

Renamed CustomAnnotationTransactionAttributeSource to RepositoryInformationPreferringAnnotationTransactionAttributeSource to reflect the nature of our customization.
2020-06-16 14:31:15 +02:00
Oliver Drotbohm
9c50f86061 DATACMNS-1743 - Fix lazy repository lookups in DomainClassConverter.
We now eagerly register DomainClassConverter as converter with the ConversionService in the web setup. We also refrain from explicitly registering the traget converters with the ConversionService as that might trigger a ConcurrentModificationException if called during an iteration over the converters in the first place. As DomainClassConverter registers itself for all ConvertiblePairs and delegates to the individual converters anyway.
2020-06-15 22:10:27 +02:00
Mark Paluch
f93a66fdbc DATACMNS-1744 - Drop the use of the term white list. 2020-06-15 13:45:12 +02:00
Mark Paluch
e7f235e47a DATACMNS-1724 - Updated changelog. 2020-06-10 14:30:55 +02:00
Mark Paluch
ca58560c5c DATACMNS-1712 - Updated changelog. 2020-06-10 12:29:54 +02:00
Mark Paluch
e8f7dbea96 DATACMNS-1711 - Updated changelog. 2020-06-10 11:41:56 +02:00
Mark Paluch
376a892925 DATACMNS-1739 - Use standard Spring code of conduct.
Using https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md.
2020-06-09 16:09:38 +02:00
Mark Paluch
40e7e89e27 DATACMNS-1738 - Expose method to obtain the repository query method return type.
We now expose RepositoryMetadata.getReturnType(…) to obtain the declared method return type. While pure Java code can rely on Method.getReturnType(), suspended Kotlin methods (Coroutines) require additional lookups. This is because the Kotlin compiler messes around with the return type in the bytecode. It changes the return type to java.lang.Object while synthesizing an additional method argument:

interface MyCoroutineRepository : Repository<Person, String> {
	suspend fun suspendedQueryMethod(): Flow<Person>
}

compiles to

interface MyCoroutineRepository extends Repository<Person, String> {
	Object suspendedQueryMethod(Continuation<Flow<Person>> arg0);
}

Therefore, the triviality of obtaining a return type becomes an inspection of the actual method arguments.

Related ticket: https://jira.spring.io/browse/DATAMONGO-2562
2020-06-09 11:09:31 +02:00
Oliver Drotbohm
210ab249e3 DATACMNS-1734 - Defer initialization of Repositories in DomainClassConverter.
DomainClassConverter now delays the initialization of the Repositories instances used to avoid the premature initialization of repository instances as that can cause deadlocks if the infrastructure backing the repositories is initialized on a separate thread.

Refactored nested converter classes to allow them to be static ones.

Related issues: spring-projects/spring-boot#16230, spring-projects/spring-framework#25131.
Original pull request: #445.
2020-05-29 09:47:21 +02:00
Mark Paluch
644b65eb71 DATACMNS-1733 - Fix Javadoc for Range factory methods.
Range.open(…) is now correctly documented with exclusive bounds.
2020-05-27 10:15:29 +02:00
Mark Paluch
fbe51ef1bb DATACMNS-1735 - Polishing.
Use mutated object as guard for synchronization. Copy discovered callbacks to cached callbacks.

Reduce concurrency in unit test to reduce test load. Guard synchronization with timeouts.

Original pull request: #446.
2020-05-27 09:53:52 +02:00
mhyeon-lee
d9969cb7d4 DATACMNS-1735 - Fix ConcurrencyModificationException in EntityCallbackDiscoverer.
We now guard modifications of the cached entity callbacks list with a synchronization block.

Original pull request: #446.
2020-05-27 09:32:24 +02:00
Mark Paluch
ce7928b28b DATACMNS-1706 - Polishing.
Improve Javadoc.

Original pull request: #437.
2020-05-26 09:06:26 +02:00