Commit Graph

1408 Commits

Author SHA1 Message Date
Oliver Gierke
97bd85e628 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 18:23:04 +02:00
Mark Paluch
a972f7d101 DATACMNS-1060 - After release cleanups. 2017-06-14 17:14:08 +02:00
Mark Paluch
4d8465ad33 DATACMNS-1060 - Prepare next development iteration. 2017-06-14 17:14:06 +02:00
Mark Paluch
495cc7bddf DATACMNS-1060 - Release version 2.0 M4 (Kay). 2017-06-14 17:03:48 +02:00
Mark Paluch
d9735a4367 DATACMNS-1060 - Prepare 2.0 M4 (Kay). 2017-06-14 17:03:00 +02:00
Mark Paluch
16def70b77 DATACMNS-1060 - Updated changelog. 2017-06-14 17:02:56 +02:00
Oliver Gierke
29dadc5431 DATACMNS-1060 - Re-add artifact version to make release tools work. 2017-06-14 17:01:28 +02:00
Oliver Gierke
a825a337d8 DATACMNS-1089 - Prepare upgrade to AssertJ 3.8.
Fully qualify call to ClassTypeInformation.from(…) as AssertJ 3.8 introduces a method that results in ambiguity in the static imports for from(null).
2017-06-14 14:06:10 +02:00
Oliver Gierke
663ae9b4bf DATACMNS-102 - Polishing.
Changed RepositoryConfiguration to return Streamable over Iterable. A couple of code reorganizations, suppression of raw type. Turned abstract helper classes into interfaces where possible. A couple of typos in JavaDoc.

Original pull request: #222.
2017-06-13 23:47:54 +02:00
Mark Paluch
92e8907030 DATACMNS-102 - Allow Repositories to be composed of an arbitrary number of implementation classes.
We now use RepositoryComposition as backing implementation for repository method calls to implementations. We now scan for repository fragments during the repository configuration phase. Fragment implementation candidates derive from the repository interface declaration, specifically the declared interfaces and their order. We scan the class path during fragment scan for each interface and add discovered fragments to the repository composition. The name of the implementation is derived from the simple name of the interface and the implementation suffix. Qualified fragments are top-level interface declarations that are not annotated with NoRepositoryBean. Inherited interfaces are not considered as fragment candidates.

We create a RepositoryComposition from the discovered fragments in the order of interface declaration in the repository interface and supply the composition to the actual repository creation.

Original pull request: #222.
2017-06-13 23:47:54 +02:00
Mark Paluch
5e123ad7df DATACMNS-102 - Remove trailing whitespaces.
Original pull request: #222.
2017-06-13 23:47:54 +02:00
Christoph Strobl
f913aa7439 DATACMNS-1063 - Polishing.
Add deleteById accepting Publisher and alter JavaDoc to be more explicit about illegal arguments.

Original Pull Request: #226
2017-06-13 19:42:23 +02:00
Mark Paluch
9f1af1fb09 DATACMNS-1063 - Accept Publisher in ReactiveCrudRepository findById(…) and existsById(…).
We now accept Publisher<T> instead of Mono<T> in findById(…) and existsById(…). Users of a ReactiveStreams-based framework are no longer required to perform Publisher to Mono-adoption themselves but can pass a Publisher directly. Both methods use the first emitted value to issue their queries. Additional values are not consumed from the stream.

Original Pull Request: #226
2017-06-13 19:34:51 +02:00
Oliver Gierke
f0fa12340a DATACMNS-764 - Documentation polish.
Related pull request: #201.
2017-06-13 17:31:24 +02:00
Christian Wiejack
13907152fb DATACMNS-1073 - Remove unnecessary generics from PagingAndSortingRepository.findAll(Pageable).
Original pull request: #220.
2017-06-13 13:05:46 +02:00
Oliver Gierke
dc30810936 DATACMNS-764 - Fix ClassLoader lookup in XmlRepositoryConfigurationSource.
As per @jhoeller's recommendation, we now use the ResourceLoader's ClassLoader instead of the bean ClassLoader exposed by the XmlReaderContext. The latter can apparently be null outside certain lifecycle phases.

Related pull request: #201.
2017-06-09 15:31:51 +02:00
Oliver Gierke
9462a5ba47 DATACMNS-764 - Java 8 polishing.
Use Streamable in configuration APIs for more efficient, lazy traversal of source lists. Introduced SelectionSet.of(…) to move away from constructors. Avoid the use of null in SelectionSet.

Original pull request: #201.
2017-06-09 13:53:09 +02:00
Jens Schauder
eec63cb11d DATACMNS-764 - Disambiguate custom repository implementation if necessary
When multiple repository implementations are found based on the class name, the one with a bean name matching the interfaces bean name + implementation postfix is picked. Includes support for CDI.

RepositoryBeanNameGenerator now no longer implements BeanNameGenerator since while it produces names it does not behave like the interface suggests, i.e. it can work without a BeanFactory in the first place. It now uses constructor injection and is package private.

Original pull request: #201.
2017-06-09 13:53:09 +02:00
Mark Paluch
628d71cf1f DATACMNS-1047 - Updated changelog. 2017-06-08 11:56:19 +02:00
Mark Paluch
0af5a4f6f1 DATACMNS-1046 - Updated changelog. 2017-06-07 12:23:34 +02:00
Oliver Gierke
976aeaf34c DATACMNS-1074 - Polishing.
Java-8-ification.

Original pull request: #221.
2017-06-07 10:45:04 +02:00
Oliver Gierke
83d9c56eb4 DATACMNS-1074 - Polishing.
Enum names in all caps.

Original pull request: #221.
2017-06-07 10:45:04 +02:00
Mark Paluch
9038e6894c DATACMNS-1074 - Cache MethodHandles of default methods after lookup.
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:45:04 +02:00
Roman Rodov
cabfa287cb DATACMNS-1082 - Skip synthetic constructors.
Constructor discovery no longer considers synthetic constructors for preferred constructor.

Original pull request: #225
2017-06-07 08:45:28 +02:00
Mark Paluch
11c1ad8025 DATACMNS-1079 - Polishing.
Remove javadoc params without documentation. Reorder methods in the order they are called. Rename arePropertyHashCodesUnique to hasUniquePropertyHashCodes. Add author tag. Formatting.

Original pull request: #224.
2017-06-02 16:55:00 +02:00
Jens Schauder
497dc08a7c DATACMNS-1079 - Polishing.
Refactored all the checks done to check if ClassGeneratingPropertyAccessorFactory works into separate methods, so the body of isSupported becomes nice and readable.

Original pull request: #224.
2017-06-02 16:53:10 +02:00
Jens Schauder
59f52a9e35 DATACMNS-1079 - Disable generated property accessors if ClassLoader is encapsulated.
ClassGeneratingPropertyAccessorFactory does not work with Java 9 (encapsulated modules, without --permit-illegal-access), because making ClassLoader.defineClass accessible fails.

Therefore this change moves call to setAccessible to the check that ensures availability of the method so isSupported(…) returns false.

Original pull request: #224.
2017-06-02 16:52:59 +02:00
Mark Paluch
07da629356 DATACMNS-1076 - Deprecate RxJava1CrudRepository and RxJava1SortingRepository interfaces.
Spring Data 2.0 is going GA after the feature freeze of RxJava 1. In prospect of its EOL it makes no sense to ship new APIs based on a library that goes towards EOL.

RxJava1CrudRepository and RxJava1SortingRepository are subject to removal in a future milestone.
2017-05-31 16:01:59 +02:00
Mark Paluch
2e532b3d21 DATACMNS-991 - Polishing.
Refactor conditional lookup strategies into enum instances reflecting the open/encapsulated lookup strategy.

Original pull request: #223.
2017-05-31 15:56:50 +02:00
Jens Schauder
6a39937d51 DATACMNS-991 - Support Java 9 compatible MethodHandle lookup.
DefaultMethodInvokingMethodInterceptor now contains two alternative implementations, one compatible to Java 8, one for Java 9.

Original pull request: #223.
2017-05-31 15:55:49 +02:00
Christoph Strobl
77be0ba859 DATACMNS-995 - Polishing.
Update JavaDoc to reflect reactive types, not null arguments and potential exceptions.
Align not null JavaDoc of imperative QueryByExample interface.

Original Pull Request: #197
2017-05-22 15:00:29 +02:00
Mark Paluch
1158b5feda DATACMNS-995 - Create ReactiveQueryByExampleExecutor allowing reactive query by example.
Provide a mix-in interface to be used in store modules providing reactive Query by Example query execution.

    Mono<T> findOne(Example<T> sample);
    Flux<T> findAll(Example<T> sample);
    Mono<Long> count(Example<T> sample);
    //...

Original Pull Request: #197
2017-05-22 14:57:27 +02:00
Oliver Gierke
17af937194 DATACMNS-1059 - Polishing.
Original pull request: #215.
2017-05-19 09:22:23 +02:00
Christoph Strobl
8c028c3115 DATACMNS-1059 - Alter QuerydslPredicateExecutor.findOne(…) to return Optional<T>.
We now return Optional<T> for QuerydslPredicateExecutor.findOne(Predicate) aligning the return type to the ones used in CrudRepository.

Original pull request: #215.
2017-05-19 09:22:23 +02:00
Oliver Gierke
0e36b43752 DATACMNS-1026 - Polishing.
Minor refactorings here in there for clarity.

Original pull request: #217.
2017-05-17 16:20:50 +02:00
Jens Schauder
1bf318fb02 DATACMNS-1026 - Polishing.
Minor improvements to Javadoc.

Original pull request: #217.
2017-05-17 16:20:48 +02:00
Jens Schauder
42621086fe DATACMNS-1026 - ExtensionAwareEvaluationContextProvider now returns all overloaded methods as functions.
All overloaded methods are now available in SPeL expressions. Among methods with identical argument list from different sources in the same extension (extension, root object, aliases) the last one in the order in parens wins. If there is more than one method for an application the following rules are applied: if there is one method with exact matching types in the argument list it is used, otherwise an exception is thrown.

Original pull request: #217.
2017-05-17 16:20:38 +02:00
Oliver Gierke
5dba2f4c59 DATACMNS-1066 - Polishing.
Formatting and removal of obsolete methods.
2017-05-16 19:11:38 +02:00
Oliver Gierke
5f9d90ee3e 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:11:12 +02:00
Oliver Gierke
71977c9309 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 15:39:52 +02:00
yukiyoshida
417fad340b 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 15:25:48 +02:00
Oliver Gierke
2eb830d68f DATACMNS-822 - Polishing.
Switched to implement WebMvcConfigurer over extending WebMvcConfigurerAdapter. Formatting, assertions, Javadoc.

Original pull request: #208.
2017-05-12 16:57:02 +02:00
Jens Schauder
364ed9ab2e DATACMNS-822 - Polishing.
Replaced optional dependencies with Optional and explicit null checks with calls to ifPresent. Used Lambda style instead of anonymous classes where applicable. Converted Hamcrest matchers to AssertJ. 
Minor improvements to formatting.

Original pull request: #208.
2017-05-12 16:57:02 +02:00
Vedran Pavic
c1036b2204 DATACMNS-822 - Provide customizers for default pageable and sort resolvers.
Introduced dedicated callback interfaces to customize the HandlerMethodArgumentResolver instances registered by SpringDataWebConfiguration. This allows bean definition registration of those customizer interfaces instead of having to extend a configuration class.

Original pull request: #208.
2017-05-12 16:57:02 +02:00
Oliver Gierke
34ce83c657 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 12:36:23 +02:00
Oliver Gierke
c59e2b8456 DATACMNS-1064 - Removed obsolete build profiles from Travis build. 2017-05-11 10:29:50 +02:00
Oliver Gierke
adf8dfb7cd 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:19:46 +02:00
Mark Paluch
7d496978f5 DATACMNS-1058 - Polishing.
Improve Javadoc. Extend year range in license header.

Original pull request: #214.
2017-05-11 09:56:21 +02:00
Christoph Strobl
0ff53bd5db DATACMNS-1058 - Alter QueryByExampleExecutor.findOne to return Optional<S>.
We now return Optional<S> for findOne() just as we do in CrudRepository.

Original pull request: #214.
2017-05-11 09:56:06 +02:00
Oliver Gierke
5d08bd6273 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:50:09 +02:00