Commit Graph

1336 Commits

Author SHA1 Message Date
Oliver Gierke
4918eca7cf DATACMNS-1043 - Slice now exposes Pageable.
We now expose the Pageable that was used to create a Slice via its API. Slice itself constructs a default PageRequest so that current implementations of it still work as before.
2017-04-21 16:48:59 +02:00
Oliver Gierke
bb43b96c4c DATACMNS-993 - Polishing.
Ported SpringDataWebConfigurationIntegrationTests to AssertJ.

Original pull request: #202.
2017-04-12 08:03:38 +02:00
Oliver Gierke
9d315af70a 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.

Changed SpringDataWebConfigurationImportSelector to be lenient against the ResourceLoader not being available.

Original pull request: #202.
Related ticket: SPR-15439
[0] https://jira.spring.io/browse/SPR-15439
2017-04-12 08:03:38 +02:00
Jens Schauder
65734739bd 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:03:32 +02:00
Oliver Gierke
562b6665a3 DATACMNS-1040 - Remove exclusion of Commons Logging.
Related ticket: SPR-14512.
2017-04-11 11:38:58 +02:00
Oliver Gierke
a681795597 DATACMNS-979 - Updated changelog. 2017-04-10 13:29:26 +02:00
Oliver Gierke
5a1c5d7917 DATACMNS-942 - After release cleanups. 2017-04-04 22:08:17 +02:00
Oliver Gierke
559ff27939 DATACMNS-942 - Prepare next development iteration. 2017-04-04 22:08:12 +02:00
Oliver Gierke
de2d43e59f DATACMNS-942 - Release version 2.0 M2 (Kay). 2017-04-04 21:12:35 +02:00
Oliver Gierke
55429522dc DATACMNS-942 - Prepare 2.0 M2 (Kay). 2017-04-04 21:12:01 +02:00
Oliver Gierke
66297d026b DATACMNS-942 - Updated changelog. 2017-04-04 21:11:52 +02:00
Oliver Gierke
23f6e05b1b DATACMNS-1027 - Adapt to new API in AssertJ 3.6.
Removed custom OptionalAssert in favor of the AssertJ one. Refactored ….map(…) methods mapping to a class as this causes compile errors.
2017-04-04 08:58:31 +02:00
Oliver Gierke
37f78a3707 DATACMNS-1024 - Reinstated root object method lookup behavior in EvaluationContextExtensionInformation.
The switch to Java 8 and thus to Collectors.toMap(…) to assemble the root object's methods as functions broke due to the fact that overloaded methods have the same name which causes a collision in keys when preparing the map of functions.

We now use the same approach as before, of letting later methods trump earlier ones as this fixes the original bug. Filed DATACMNS-1026 to keep track of that problem.

Related tickets: DATACMNS-1026.
2017-04-04 07:07:42 +02:00
Christoph Strobl
c716ab839d DATACMNS-988 - Polishing.
Added some tests.

Original Pull Request: #194
2017-04-03 10:48:21 +02:00
Mark Paluch
d72e9486be DATACMNS-988 - Fix Publisher to RxJava 2 conversion.
And fix some issues in JavaDoc.

Original Pull Request: #194
2017-04-03 10:47:53 +02:00
Mark Paluch
3099125aa3 DATACMNS-988 - Polishing.
Improve JavaDoc. Remove findAll declarations in reactive sorting repositories as they are inherited with the same signature.

Original Pull Request: #194
2017-04-03 10:47:02 +02:00
Mark Paluch
39ab1b3555 DATACMNS-988 - Provide RxJava 2 Repository interfaces.
Provide RxJava 2 Repository interfaces using back-pressure enabled Flowable as default return type for multi-element queries and Maybe for queries that can complete without emitting a value.

Original Pull Request: #194
2017-04-03 10:46:32 +02:00
Mark Paluch
e73710374d DATACMNS-1023 - We prefer direct matches on reactive repository query method overloads.
We now attempt to look up a target class method based on exact name and parameter types before falling back on the more expensive type matches. This also eliminates the possibility of invalid method matches as described in the ticket.

Related ticket: DATACMNS-943.
Original Pull Request: #194
2017-04-03 10:45:19 +02:00
Oliver Gierke
b5af2e9d96 DATACMNS-1020 - Improvements to revision API.
RevisionRepository now returns Optional for methods that could previously return null. Revision exposes additional methods to lookup required revision numbers and dates. Revisions now implements Streamable and exposes a ….none() factory method to create an empty instance.

AnnotationBasedRevisionMetadata now uses Lazy to lookup the fields with revision annotations. AnnotationDetectionFieldCallback now also uses Optional in places it previously returned null. StreamUtils now exposes factory methods for Collector instances producing unmodifiable List and Set instances.

Related ticket: DATACMNS-867.
2017-03-25 12:34:24 +01:00
Oliver Gierke
11dc67da2c DATACMNS-1018 - Reinstantiated ability to customize repository factory bean through annotation and XML namespace.
The refactoring for DATACMNS-867 has dropped support to customize the repository factory bean class on both the @Enable-annotations and the XML namespace. Reintroduced this feature, added a test case and moved the fallback into the value that's defined by the configuration extension inside DefaultRepositoryConfiguration.
2017-03-24 14:18:40 +01:00
Oliver Gierke
6b5b65804e DATACMNS-1015 - Introduced IdentifierAccessor.getRequiredIdentifier().
The new method allows to look up identifiers and immediately fail in the case of absence. Introduced the method as default method but also a new base type TargetAwareIdentifierAccessor to throw an exception with more context, i.e. the actual target bean we try to look up the identifier on.
2017-03-24 11:57:57 +01:00
Oliver Gierke
790bfc6991 DATACMNS-867 - Upgrade to Mockito 2.7. 2017-03-24 08:00:48 +01:00
Oliver Gierke
575e4f9c92 DATACMNS-867 - Removed temporary Mockito version property.
This is now coming from the build parent.
2017-03-24 08:00:48 +01:00
Oliver Gierke
5f117a00a3 DATACMNS-867 - Polishing of Property value type in mapping package. 2017-03-24 08:00:48 +01:00
Oliver Gierke
baccb412f0 DATACMNS-867 - Cleanups.
SliceImpl now already checks Sort instance for not null. Removed unnecessary warnings supression.
2017-03-24 08:00:47 +01:00
Oliver Gierke
bc28a6b094 DATACMNS-867 - Improvements in Chunk and PageImpl.
Chunk now rejects null Pageables. Improved total calculation in PageImpl by using ….toOptional().
2017-03-24 08:00:47 +01:00
Oliver Gierke
93bb3d2e21 DATACMNS-867 - Additional assertions in AuditingHandler. 2017-03-24 08:00:47 +01:00
Oliver Gierke
7ac12c3c3d DATACMNS-867 - BasicPersistentEntity now rejects null Association.
Related ticket: DATACMNS-934.
2017-03-24 08:00:47 +01:00
Oliver Gierke
429dcbf659 DATACMNS-867 - ReflectionRepositoryInvoker now avoids ConversionService for Optional creation.
We now manually create Optional instances as the ConversionService converts single-argument collections into an optional with only that element.
2017-03-24 08:00:47 +01:00
Oliver Gierke
fe5d543ff2 DATACMNS-867 - Further refinements to Optionals.
Made ifAllPresent(…) void as the returned value is never used. Added ifPresentOrElse(…).
2017-03-24 08:00:47 +01:00
Oliver Gierke
d65d5a45e5 DATACMNS-867 - Fixed type on Sort.isUnsorted(). 2017-03-24 08:00:47 +01:00
Oliver Gierke
58b2bde303 DATACMNS-867 - Removed Optionals from Auditing methods signatures. 2017-03-24 08:00:46 +01:00
Oliver Gierke
ba875187cd DATACMNS-867 - RepositoryInvoker.invokeQueryMethod(…) now returns an Optional. 2017-03-24 08:00:46 +01:00
Oliver Gierke
7c33bcf98a DATACMNS-867 - Let lookups for a property's component and map value type use Optional. 2017-03-24 08:00:46 +01:00
Oliver Gierke
1c45fcfcdc DATACMNS-867 - Lazify lookups in AbstractPersistentProperty. 2017-03-24 08:00:46 +01:00
Oliver Gierke
417e728e77 DATACMNS-867 - Moved to new factory methods for Sort.
Codebase now uses Sort.by(…) where possible instead of the deprecated new Sort(…).
2017-03-24 08:00:46 +01:00
Oliver Gierke
fee153f724 DATACMNS-867 - RepositoryInvoker now returns an Optional for invokeFindOne(…).
Adapted ReflectionRepositoryInvoker to transparently unwrap other potentially used wrapper types to then convert the result into an Optional.
2017-03-24 08:00:46 +01:00
Oliver Gierke
dec820d6c2 DATACMNS-867 - Removed handling of null Pageables.
Pageable now exposes a dedicated null-object representing the absence of pagination so that all places that previously handled null values can now rather be more relaxed and assume that a non-null value is given.
2017-03-24 08:00:46 +01:00
Oliver Gierke
917c3e2889 DATACMNS-867 - Removed Optional from QuerydslBindingsFactory API. 2017-03-24 08:00:45 +01:00
Oliver Gierke
9b4188bfe8 DATACMNS-867 - Further AssertJ migrations. 2017-03-24 08:00:45 +01:00
Oliver Gierke
082c4157d1 DATACMNS-867 - Less Optional for auditing subsystem.
Removed Optional<Object> parameters in favor of plain Object and clients that avoid calling methods for absent values in the first place.
2017-03-24 08:00:45 +01:00
Oliver Gierke
5f7d1ae2f2 DATACMNS-867 - Overhaul of PersistentEntity API.
Moved getRequired…(…) methods from implementations into interfaces so that implementations inherit them by default.

Expanded generics declaration in PersistentEntities so that PerisistentProperty instances can be properly access from the PersistentEntity instances returned.
2017-03-24 08:00:45 +01:00
Oliver Gierke
1c60ea8d36 DATACMNS-867 - Rework utility classes.
Removed the additional methods that reflectively checked for the Stream type and whether a Method instance is a default method. Turned utility classes into interfaces where possible. Make use of Lombok's @UtilityClass where not.

Removed obsolete implementation class in StreamUtils in favor of a lambda.
2017-03-24 08:00:45 +01:00
Oliver Gierke
6e3114f3cb DATACMNS-867 - Updates to QueryExecutionConverters.
Introduced an overload in AbstractWrapperTypeConverter to simplify the constructors in implementations. Switched to Streamable.map(…) in getConvertibleTypes().
2017-03-24 08:00:45 +01:00
Oliver Gierke
628dc8b9c8 DATACMNS-867 - Introduced monadic methods on Streamable.
Streamable now exposes map(…), flatMap(…) and filter(…) to allow easy conversion into new Streamables. Introduced LazyStreamable to back those implementations. Simplified implementation of methods in PartTree to use those new methods.

Changed Page and Slice map(…) method to take a Function over a Converter so that act as specialization of the newly introduced map(…) method.
2017-03-24 08:00:45 +01:00
Oliver Gierke
133e46f6b4 DATACMNS-867 - Test updates after latest rebase. 2017-03-24 08:00:44 +01:00
Oliver Gierke
bdbdb46adb DATACMNS-867 - API updates after rebase on latest changes. 2017-03-24 08:00:44 +01:00
Oliver Gierke
e861d0343b DATACMNS-867 - Additions to Lazy.
Added mapping functions to Lazy.
2017-03-24 08:00:44 +01:00
Oliver Gierke
8372e34adf DATACMNS-867 - Cleanups in Pageable API.
Dropped Pageable.NONE in favor of ….unpaged() for consistency with Sort.unsorted(). Extracted the implementation for the value backing it into an Unpaged enum instance. Introduced defaulted isPaged() / isUnpaged() to avoid having to compare instances.

JavaDoc in Sort and a couple of API polishes.
2017-03-24 08:00:44 +01:00
Oliver Gierke
a5c4be5f0a DATACMNS-867 - Removed Optional from ResultProcessor.withDynamicProjection(…).
We now expect the PropertyAccessor to either be non-null or the method not being called at all.
2017-03-24 08:00:44 +01:00