Commit Graph

1305 Commits

Author SHA1 Message Date
Mark Paluch
92c4fc5a76 DATACMNS-1131 - Updated changelog. 2017-09-11 11:44:12 +02:00
Oliver Gierke
154db22ade DATACMNS-1011 - Rewrote chapter on repository projections. 2017-09-08 15:45:42 +02:00
Johnny Lim
a8c7de0683 DATACMNS-1153 - Removed unreachable assertion in XmlRepositoryConfigurationSource.
Original pull request: #236.
2017-09-07 15:22:48 +02:00
Oliver Gierke
a2f8dc1676 DATACMNS-1152 - Setup of ProjectingJackson2HttpMessageConverter now tries to use unique ObjectMapper from ApplicationContext.
We're now trying to look up a uniquely available ObjectMapper instance from the application context falling back to a simple new instance in case none can be found.
2017-09-06 18:49:01 +02:00
Mark Paluch
e8fad19bc0 DATACMNS-1151 - Define generated PropertyAccessor classes with the entity protection domain.
We now define generated PropertyAccessor classes using the entities' protection domain. Reusing the same protection domain preserves the same security and visibility rules as if the class was shipped within the source of the class loaded and prevents SecurityExceptions caused by signature certificate mismatch.

Previously we uses the protection domain of the PersistentEntity class implementation. This mismatch caused SecurityExceptions if the JAR file of the PersistentEntity was signed but not the JAR file where the domain class resides.

Original pull request: #240.
2017-09-05 12:01:21 +02:00
Oliver Gierke
2bfd278861 DATACMNS-1145 - @JsonPath value lookup now returns null for non-existent paths.
If a JSONPath expression is using a path not available in the backing payload we now return null rather than letting the PathNotFoundException propagate.
2017-08-24 15:47:44 +02:00
Oliver Gierke
3ffb18597b DATACMNS-1143 - Improve design of AbstractAggregateRoot.
Methods for domain event registration and access are now not following bean semantics anymore to avoid those accidentally leaking into formats that use the bean spec (e.g. Jackson to produce JSON). 

Deprecated old accessor methods and temporarily add @JsonIgnore to the method to avoid leakage but keep signatures intact.
2017-08-23 15:49:10 +02:00
Oliver Gierke
766c9078f2 DATACMNS-1139 - AbstractPersistentProperty.getRawType() now correctly resolves generics.
We're now favoring the generic TypeInformation over trying to resolve the property type via field or PropertyDescriptor as only the former does proper generic type resolution.
2017-08-14 13:40:52 +02:00
Oliver Gierke
8638d30a00 DATACMNS-1138 - TypeInformation.specialize(…) now only specializes unresolved parameterized types.
Type specialization - i.e. enrichment of a raw type with a current generic context - is now only done if the current type is not yet resolved completely. This allows wildcarded target references to just fall back to the type to specialize, which will then by definition carry more generics information than the one to be specialized.
2017-08-11 15:54:33 +02:00
Oliver Gierke
e7434a0e77 DATACMNS-1135 - Fixed generics lookup for recursively nested container references.
Revert the merging of a parent type's type variable map and only apply the locally available declared generics in case of parameterized types. Moved that augmentation into ParameterizedTypeInformation.
2017-08-03 11:36:45 +02:00
Oliver Gierke
2e633d2a2f DATACMNS-1127 - After release cleanups. 2017-07-27 00:21:37 +02:00
Oliver Gierke
38fdb0aa4f DATACMNS-1127 - Prepare next development iteration. 2017-07-27 00:15:07 +02:00
Oliver Gierke
4734df4860 DATACMNS-1127 - Release version 1.13.6 (Ingalls SR6). 2017-07-26 23:47:19 +02:00
Oliver Gierke
765fea0cda DATACMNS-1127 - Prepare 1.13.6 (Ingalls SR6). 2017-07-26 23:45:51 +02:00
Oliver Gierke
7caf6be1f9 DATACMNS-1127 - Updated changelog. 2017-07-26 23:45:37 +02:00
Oliver Gierke
160681f0e2 DATACMNS-1128 - Updated changelog. 2017-07-25 16:15:39 +02:00
Oliver Gierke
a519e8f8f7 DATACMNS-1090 - Updated changelog. 2017-07-25 10:03:53 +02:00
Oliver Gierke
532d4e4eba DATACMNS-1084 - After release cleanups. 2017-07-24 19:25:07 +02:00
Oliver Gierke
dd56129b02 DATACMNS-1084 - Prepare next development iteration. 2017-07-24 19:25:05 +02:00
Oliver Gierke
9e1dc0dc86 DATACMNS-1084 - Release version 1.13.5 (Ingalls SR5). 2017-07-24 18:44:17 +02:00
Oliver Gierke
a73a62dc8c DATACMNS-1084 - Prepare 1.13.5 (Ingalls SR5). 2017-07-24 18:43:22 +02:00
Oliver Gierke
bbb19ff092 DATACMNS-1084 - Updated changelog. 2017-07-24 18:43:10 +02:00
Oliver Gierke
1fee0eda4f DATACMNS-1124 - Upgraded to Javaslang 2.0.6. 2017-07-24 14:20:09 +02:00
Oliver Gierke
d38fdf338b DATACMNS-1123 - Upgraded to XmlBeam 1.4.12 and tweaked HttpMessageConverter implementation.
XmlBeam 1.4.11 accidentally removed ProjectionFactory as public interface. Adapted our HttpMessageConverter implementation to make sure we still work on those versions.

Related ticket: https://github.com/SvenEwald/xmlbeam/issues/45
2017-07-24 14:18:34 +02:00
Oliver Gierke
27f6a4d36c DATACMNS-1085 - Fixed typos in Javadoc.
Original pull request: #229.
2017-07-24 10:36:29 +02:00
Oliver Gierke
d7011a3da5 DATACMNS-1121 - ProxyProjectionFactory now returns instance as is if it implements the target.
If you previously asked ProxyProjectionFactory for a proxy of an interface which the target instance already implements, it created a proxy although it could've returned the instance as is. It's now actually doing that avoiding superfluous proxy creation.
2017-07-20 14:59:17 +02:00
Oliver Gierke
721888f052 DATACMNS-1115 - Improve RepositoryBeanNameGenerator to properly resolve bean names for indexed BeanDefinitions.
Previously, RepositoryBeanNameGenerator applied the custom bean name lookup if the BeanDefinition given was not a ScannedGenericBeanDefinition. That in turn had been the case for custom implementation classes that were obtained through classpath scanning. With Spring 5 an index file can be used by the scanner, which in turn will cause AnnotatedGenericBeanDefinition instances being returned. That caused the code path to lookup the first constructor argument to kick in (usually used to obtain the repository interface from repository factory beans) and cause a NullPointerException.

We now forward AnnotatedBeanDefinitions as is and only apply the custom lookup for everything else, i.e. the bean definitions used for the factories.
2017-07-19 08:44:17 +02:00
Oliver Gierke
143b497090 DATACMNS-1102 - Reuse ConversionService in ProjectingMethodInterceptors created by ProxyProjectionFactory.
Applied the same to internals of MapDataBinder.
2017-07-06 11:27:45 +02:00
Oliver Gierke
d429d4852c DATACMNS-1102 - Avoid superfluous recreation of ConversionService for projections.
For repository query methods with a dynamic projection parameter, the ResultProcessor is recreated with the type handed to the method. This results in recreation of the ProjectingConverter, which previously recreated a DefaultConversionService instance (for fallback conversions), which is rather expensive due to the reflection lookups checking for the presence of libraries on the classpath.

This is now avoided by using copying methods that reuse the initially created DefaultConversionService.
2017-07-02 21:43:00 +02:00
Oliver Gierke
3e105b90d6 DATACMNS-1098 - Polishing.
Removed obsolete Spring version check. Formatting.
2017-06-26 16:18:14 +02:00
Oliver Gierke
8bddd62c7a DATACMNS-1098 - RepositoryComponentScanner now exposes BeanDefinitionRegistry.
We now override ClassPathScanningCandidateComponentProvider's getRegistry() to make sure custom conditions on repository candidates can use the currently available BeanDefinitionRegistry in their implementations. To achieve that we forward the BeanDefinitionRegistry at hand through the configuration infrastructure (both XML and annotation side of things).
2017-06-26 16:18:10 +02:00
Oliver Gierke
a411bd3931 DATACMNS-1095 - Made ObjectInstantiator public to avoid IllegalAccessErrors.
ObjectInstantiator needs to be declared public as otherwise loading the implementation class fails as it doesn't have access to the (package) private interface in a different classloader.
2017-06-21 17:35:38 +02:00
Mark Paluch
b66db6dc00 DATACMNS-1060 - Updated changelog. 2017-06-14 17:34:56 +02:00
Jacek Jackowiak
6f0e025679 DATACMNS-1087 - Polishing.
Fixed Javadoc. Removed unnecessary warnings supression. Additional test to verify Vavr empty Option creation.
2017-06-09 21:36:07 +02:00
Oliver Gierke
e1761f6c8c DATACMNS-1087 - Fixed Vavr Option creation from present value.
We now reflectively invoke the static method Option.of(…), while we previously tried to invoke an instance method on the parameter value.
2017-06-09 21:24:08 +02:00
Mark Paluch
0398bdd22f DATACMNS-1047 - After release cleanups. 2017-06-08 11:26:19 +02:00
Mark Paluch
1792cc1ed3 DATACMNS-1047 - Prepare next development iteration. 2017-06-08 11:26:18 +02:00
Mark Paluch
e9673941bf DATACMNS-1047 - Release version 1.13.4 (Ingalls SR4). 2017-06-08 10:56:51 +02:00
Mark Paluch
ff242615c5 DATACMNS-1047 - Prepare 1.13.4 (Ingalls SR4). 2017-06-08 10:56:03 +02:00
Mark Paluch
cf50842ed8 DATACMNS-1047 - Updated changelog. 2017-06-08 10:55:53 +02:00
Mark Paluch
40db3a8699 DATACMNS-1046 - Updated changelog. 2017-06-07 12:23:35 +02:00
Oliver Gierke
738ff9c8d3 DATACMNS-1074 - Removed reference to JDK 8 method.
Method.isDefault() is JDK 8 API. Replaced by our JDK 6 equivalent in ReflectionUtils.

Original pull request: #221.
2017-06-07 10:52:41 +02:00
Oliver Gierke
6c7599c489 DATACMNS-1074 - Backport of MethodHandle lookup caching.
We now cache method handles after lookup on a best-effort basis to reuse them and prevent subsequent lookups as a MethodHandle lookup is expensive, in particular the lookup uses exceptions as control flow [0] during speculative lookup [1].

[0] http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/5b86f66575b7/src/share/classes/java/lang/invoke/MemberName.java#l978
[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-August/042770.html

Original pull request: #221.
2017-06-07 10:44:34 +02:00
Roman Rodov
90fb97bcf2 DATACMNS-1082 - Skip synthetic constructors.
Constructor discovery no longer considers synthetic constructors for preferred constructor.

Original pull request: #225
2017-06-07 08:56:10 +02:00
Oliver Gierke
679f30e109 DATACMNS-1066 - ClassGeneratingPropertyAccessorFactory now opts out on failed access to ClassLoader.
We now eagerly check the accessibility of the defineClass(…) method on the class loader to be used for a PersistentEntity. This will then cause the clients to use a different PropertyAccessorFactory (as things stand today: the one using reflection) and not fail to create the class later on.
2017-05-16 19:42:08 +02:00
Oliver Gierke
f558a6c4d5 DATACMNS-1067 - Polishing.
Revert change to only invoke cleanup method if events have been exposed. We now again invoke the cleanup method for every aggregate. Changed the publication of events from the aggregate instances that were handed into the method to the ones the save method returns as the save call might return different object instances.

Cleanups in the unit tests. Moved newly introduced methods to the bottom of the test case class. Extracted method to set up mock method invocation.

Original pull request: #216.
2017-05-15 16:33:54 +02:00
yukiyoshida
dcb1ee61eb DATACMNS-1067 - Fix not to call @AfterDomainEventPublication method from collection of entities.
We now make sure the event cleanup method is called on the aggregate root, not on the parameter object directly (as the latter might be a collection.

Original pull request: #216.
2017-05-15 16:03:48 +02:00
Oliver Gierke
3d17ae5d7c DATACMNS-1065 - Added support for Vavr (successor of Javaslang).
Basically duplicated the Javaslang support to now work on Vavr types as well.
2017-05-11 22:24:15 +02:00
Oliver Gierke
258da5b378 DATACMNS-1062 - We now run the Maven build with -U on Travis.
That's to make sure we always see latest changes in esp. the build parent.
2017-05-11 10:18:48 +02:00
Oliver Gierke
e8e3b03d24 DATACMNS-1113 - Domain event publication now happens for all methods starting with save….
Previously we explicitly intercepted repository methods named save(…) and saveAll(…) which unfortunately results in custom variants of that (e.g. JpaRepository's saveAndFlush(…)) not causing event publication.

We now publish events for methods whose names start with save….
2017-05-11 09:49:48 +02:00