Commit Graph

724 Commits

Author SHA1 Message Date
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
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
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
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
Mark Paluch
e6b955bf82 DATACMNS-1037 - Updated changelog. 2017-05-09 11:36:14 +02:00
Oliver Gierke
47dd111623 DATACMNS-1045 - Updated changelog. 2017-04-19 21:04:09 +02:00
Oliver Gierke
bcb9a6061f DATACMNS-1044 - Prepare 1.13.3 (Ingalls SR3). 2017-04-19 19:32:00 +02:00
Oliver Gierke
0656d54590 DATACMNS-1044 - Updated changelog. 2017-04-19 19:31:48 +02:00
Oliver Gierke
679852d3ad DATACMNS-1004 - Updated changelog. 2017-04-19 13:04:01 +02:00
Oliver Gierke
07bdde868b DATACMNS-1003 - Prepare 1.13.2 (Ingalls SR2). 2017-04-19 10:10:47 +02:00
Oliver Gierke
5b481eda52 DATACMNS-1003 - Updated changelog. 2017-04-19 10:10:32 +02:00
Oliver Gierke
a8ff4ea142 DATACMNS-1042 - PagedResourcesAssembler now keeps coordinates of supplied Page for self link.
We now use the Pageable information contained in the given Page to make sure the self link rendered by the assembler adds proper coordinates. If a base link is provided, that is used as is.
2017-04-18 13:25:39 +02:00
Oliver Gierke
af05a086b6 DATACMNS-993 - Polishing.
Removed custom JUnit integration as we can just create HidingClassLoader instances in the test and the integration actually causes more code being needed (additional JUnit rule, method level annotations etc.).

Tweaked ShadowingClassLoader to make obvious what has been changed over the Spring Framework variant. Created upstream ticket [0] to ask for the tweaks that would allow us to remove the class again.

Original pull request: #202.
Related ticket: SPR-15439
[0] https://jira.spring.io/browse/SPR-15439
2017-04-12 08:14:00 +02:00
Jens Schauder
c029f1b916 DATACMNS-993 - Clean up class loader hacking in tests.
ClassLoaderRule with @ClassLoaderConfiguration allows easy creation FilteringClassLoader. Changed usage pattern of ClassUtils.isPresent(…) in order to ease testing. Copied the ShadowingClassloader from SpringFramework to get a constructor that doesn't shadow anything by default.

Original pull request: #202.
2017-04-12 08:13:56 +02:00
Oliver Gierke
f5ae2f99ba DATACMNS-942 - Updated changelog. 2017-04-10 13:30:56 +02:00
Oliver Gierke
5ac45f3d1a DATACMNS-1008 - Polishing.
Formatting and copyright years in DefaultRepositoryInformation.
2017-03-14 07:48:17 +01:00
Oliver Gierke
c98bc48ad0 DATACMNS-1008 - Reintroduced lost support for non-generic redeclarations of generic CRUD methods.
The changes for DATACMNS-854 and DATACMNS-912 dropped the support for the simpler redeclaration of generic methods like CrudRepository.save(…) which as of the changes requires to be redeclared like <T extends Foo> T save(T entity). Previously a simple redeclaration like Foo save(Foo entity) was sufficient.

This commit reintroduces the check for a direct match of the parameter types and shortcuts the more detailed check that's necessary in case of type variables being involved.

Related tickets: DATACMNS-854, DATACMNS-912.
2017-03-14 07:48:15 +01:00
Oliver Gierke
68f9aac4e0 DATACMNS-1005 - Polishing.
Simplified type check by using Set as method signature to avoid unnecessary manual array wrapping. Simplification in the test assertions. A bit of Javadoc, corrected imports and author tags.

Original pull request: #200.
2017-03-09 11:01:42 +01:00
Maciek Opala
0d9c909e69 DATACMNS-1005 - Paginated query methods now support Javaslang collection types.
To eagerly catch invalid declarations, query methods using pagination had a check applied that the method either returns a Page or List. We've introduced support for alternative collection libraries (Javaslang in particular) and thus the check needs to take these newly supported types into account.

This is now fixed by externalizing the valid types into QueryExecutionConverters and using the ones returned by that to check against.

Original pull request: #200.
2017-03-09 11:01:42 +01:00
Oliver Gierke
6ef41f6a76 DATACMNS-1006 - SimpleTypeHolder now considers java.lang types simple ones.
This prevents AbstractMappingContext from adding them as entities.

Related tickets: DATAREST-1018.
2017-03-07 13:45:38 +01:00
Oliver Gierke
b46b84d4bf DATACMNS-979 - Updated changelog. 2017-03-02 16:57:41 +01:00
Oliver Gierke
0fc81ad8f3 DATACMNS-980 - Prepare 1.13.1 (Ingalls SR1). 2017-03-02 09:33:24 +01:00
Oliver Gierke
33bf149d55 DATACMNS-980 - Updated changelog. 2017-03-02 09:32:21 +01:00
Oliver Gierke
c2828f4537 DATACMNS-989 - Polishing.
Introduced overload for CustomRepositoryImplementationDetector.detectCustomImplementation(…) to take a RepositoryConfiguration to simplify the invocation from the Spring container related client. Further simplification to unify invocations also from the CDI implementation to be done in 2.0.

Expose getExcludeFilter() on RepositoryConfiguration to not have to inspect the configuration source on clients.

Formatting and Javadoc. Missing license headers in newly created types.

Original pull request: #195.
2017-03-01 16:25:58 +01:00
Peter Rietzler
04aa75c5e3 DATACMNS-989 - Use exclude filters when scanning for custom repository implementations.
The detection algorithm for custom repository implementations now considers the exclude filters declared in the overall repository setup (XML and annotations).

Original pull request: #195.
2017-03-01 16:25:58 +01:00
Oliver Gierke
9dbe75aa4e DATACMNS-1000 - Fixed typo in code docs about domain events. 2017-03-01 11:13:43 +01:00
Christoph Strobl
9afe5766c6 DATACMNS-999 - Improve resource extensive error message concatenation.
Use simple if manually throwing the IllegalArgumentException instead of an Assert. Should be replaced with an Assert accepting Supplier when moving to Spring 5 and Java 8.

Original pull request: #198.
2017-02-28 18:54:26 +01:00
Oliver Gierke
876de8494b DATACMNS-987 - Polishing.
Removed a bit of reflection from ApplicationContext interaction. Some generics tweaks to avoid unnecessary casts and compiler warnings. Static methods where possible. JavaDoc polish in ProjectingJackson2HttpMessageConverter.
2017-02-13 13:32:28 +01:00
Mark Paluch
444597105c DATACMNS-987 - Polishing.
Remove unused Querydsl tests. Add author. Reformat code. Extend Javadoc.
2017-02-13 13:32:23 +01:00