Commit Graph

3076 Commits

Author SHA1 Message Date
Oliver Drotbohm
c99f2c9459 DATACMNS-1296 - PersistentPropertyPathAccessor now properly handles intermediate nulls when setting values.
We now use a dedicated GetOptions instance for the lookup of the parent path in case SetOptions is defined to skip nulls so that the lookup does not fail if the parent path contains a null value.
2020-08-06 08:50:20 +02:00
Mark Paluch
cdd8359103 DATACMNS-1781 - Reinstantate PersistentPropertyPathAccessor.setProperty(…).
Reintroduce method that was earlier removed as part of deprecation cleanup.
2020-08-05 08:58:35 +02:00
Mark Paluch
7b26fd199f DATACMNS-1780 - Polishing.
Consistently use MappingException when a required PersistentEntity cannot be obtained.
2020-08-04 15:25:34 +02:00
Mark Paluch
2aae23763b DATACMNS-1780 - Polishing.
Refine Javaoc. Eagerly react to availability of a single MappingContext.

Original pull request: #462.
2020-08-04 14:39:17 +02:00
Christoph Strobl
fd15c099e9 DATACMNS-1780 - PersistentEntities allows in flight metadata creation if the associated mapping context can be identified.
Use a more lenient approach, that allows metadata creation, when looking up persistent entities. This allows eg. a configured AuditingHandler to kick in without having to register an initial entity set in first place.

Original pull request: #462.
2020-08-04 14:39:05 +02:00
Mark Paluch
a600d8160c DATACMNS-1781 - Move off deprecated Spring Framework API.
Use KotlinDetector instead of ReflectionUtils.isKotlinClass(…). Use replacement MethodParameter(…).withContainingClass(…) instead of GenericTypeResolver.resolveParameterType(…). Use MergedAnnotations.from(…).isPresent(…) instead of AnnotationUtils.isAnnotationMetaPresent(…).
2020-08-04 12:16:55 +02:00
Mark Paluch
bb4d621a32 DATACMNS-1779 - Consider kotlin.Unit a simple type.
kotlin.Unit is now considered a simple type to avoid PersistentEntity creation.

ReflectionUtils.isVoid(…) now encapsulates the check so that calling code doesn't need to check if Kotlin is on the class path.
2020-07-31 10:57:56 +02:00
Mark Paluch
837dd0789e DATACMNS-1739 - Use standard Spring code of conduct. 2020-07-28 15:34:22 +02:00
Mark Paluch
45874430d6 DATACMNS-1777 - Polishing.
Use non-null construction of Optional for non-nullable method arguments.
2020-07-28 15:29:36 +02:00
Mark Paluch
9fbabdc820 DATACMNS-1777 - Polishing.
Add note about GraalVM when using TypedSort.

Original pull request: #461.
2020-07-28 15:28:42 +02:00
DK Lee
47ac2d43ff DATACMNS-1777 - Fix typo in Java example for TypedSort.
Original pull request: #461.
2020-07-28 15:28:28 +02:00
Mark Paluch
e56dcdb461 DATACMNS-1726 - Remove Lombok from compile scope.
Use Java ServiceLoader to identify annotation processors.
2020-07-27 12:10:34 +02:00
Christoph Strobl
fb15a9647d DATACMNS-1108 - Polishing.
Move loop to Set lookup, update Javadoc and remove unused imports.

Original Pull Request: #454
2020-07-22 13:47:00 +02:00
Mark Paluch
e9901e7df8 DATACMNS-1108 - Polishing.
Original Pull Request: #454
2020-07-22 13:46:08 +02:00
Mark Paluch
0671862ed8 DATACMNS-1108 - Add repository configuration infrastructure.
Add config infrastructure for ReactiveQueryMethodEvaluationContextProvider.

Original Pull Request: #454
2020-07-22 13:45:25 +02:00
Mark Paluch
edcf1a0562 DATACMNS-1108 - Prefer regular methods in ReflectionUtils.findRequiredMethod(…).
findRequiredMethod(…) now prefers regular methods over synthetic/bridge methods. This refinement is required for newer Java versions that create synthetic bridge methods using the interface's return type. For SpEL extension introspection we're looking for the most specific return type that may be declared in the extension.

Original Pull Request: #454
2020-07-22 13:44:19 +02:00
Mark Paluch
1c354f6d4e DATACMNS-1108 - Add support for Reactive SpEL Context retrieval.
We now support reactive EvaluationContext retrieval in conjunction with ReactiveEvaluationContextExtensions. Reactive SpEL Context extensions may access Reactor's Context and provide contextual details during SpEL evaluation.

Original Pull Request: #454
2020-07-22 13:43:28 +02:00
Mark Paluch
8a9033fdd5 DATACMNS-1742 - Updated changelog. 2020-07-22 10:37:57 +02:00
Mark Paluch
18ded821f5 DATACMNS-1741 - Updated changelog. 2020-07-22 10:08:42 +02:00
Mark Paluch
b1ec2a3c03 DATACMNS-1740 - Updated changelog. 2020-07-22 09:44:28 +02:00
Mark Paluch
13c03e9d17 DATACMNS-1772 - Remove SpringDataAnnotationBeanNameGenerator and use BeanNameGenerator directly.
We now invoke BeanNameGenerator directly without additional indirections. Previously, SpringDataAnnotationBeanNameGenerator was calling BeanNameGenerator using null for BeanDefinitionRegistry which caused downstream null dereference.
2020-07-21 14:51:23 +02:00
Mark Paluch
2355e9dcf3 DATACMNS-1771 - Upgrade to Vavr 0.10.3. 2020-07-21 14:37:23 +02:00
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