Commit Graph

82 Commits

Author SHA1 Message Date
Sangwoo Lee
ff02d34474 DATACMNS-1557 - Fix typo in Sort Javadoc.
From `ASC` to `DESC`.

Original pull request: #400.
2019-07-29 11:07:00 +02:00
Spring Operator
48c9297118 DATACMNS-1500 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 701 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #387
2019-03-22 11:00:44 +01:00
Oliver Drotbohm
e9f77d6046 DATACMNS-1499 - Added new convenience factory methods on Range. 2019-03-14 13:25:49 +01:00
Oliver Drotbohm
0bf160eb97 DATACMNS-1496 - Removed deprecations at least introduced in Lovelace. 2019-03-13 18:29:08 +01:00
Keegan Witt
4b55b90806 DATACMNS-1491 - Fix JavaDoc of SliceImpl regarding nullability of Pageable parameter.
The docs previously stated that argument could be null when in fact that is rejected by the superclass' constructor.
2019-03-05 15:20:46 +01:00
Oliver Drotbohm
34507ec000 DATACMNS-1450 - Introduced type-safe Sort API.
We now expose a TypedSort that can use method handles to define properties to sort by.

Sort.sort(Person.class).by(Person::getName).ascending();

Related tickets: DATACMNS-1449.
2019-03-05 13:50:49 +01:00
Oliver Drotbohm
435aaaaa35 DATACMNS-1470 - Adapt to package refactorings in Spring HATEOAS. 2019-02-28 08:00:11 +01:00
Oliver Drotbohm
8c75a92b24 DATACMNS-1476 - Added Slice.nextOrLastPageable() and ….previousOrFirstPageable().
We now expose methods that allow to traverse the Pageables but make sure we stay within the result bounds.

Related ticket: DATACMNS-1475.
2019-01-28 11:05:29 +01:00
Oliver Drotbohm
b5972257af DATACMNS-1475 - Fixed Javadoc of Slice.nextPageable() and ….previousPageable().
Documented Slice.nextPageable() and ….previousPageable() to return Pageable.unpaged() instead of null.

Follow-up ticket: DATACMNS-1476.
2019-01-28 11:05:17 +01:00
Mark Paluch
1969f4bcdc DATACMNS-1459 - Update copyright years to 2019. 2019-01-02 12:12:19 +01:00
Alex Bondarev
b7da49f97a DATACMNS-1327 - Prevent int overflow in AbstractPageRequest#getOffset().
Original pull request: #291.
2018-06-01 13:50:24 +02:00
Oliver Gierke
d73e0a1f8f DATACMNS-1324 - Introduced extensible proxy detection infrastructure.
Introduced ProxyUtils.getUserClass(…) that by default is basically a facade for Spring's ClassUtils.getUserClass(…) but allows the registration of ProxyDetector implementations via Spring's SpringFactoriesLoader mechanism.

Moved all existing usages of ClassUtils.getUserClass(…) to ProxyUtils.
2018-05-17 16:20:11 +02:00
Mark Paluch
e30928dcf0 DATACMNS-1236 - Fix inconsistent Pageable nullability Javadoc.
Fix Javadoc to reflect Pageable's non-nullability. Also, remove pageable field in favor of using Chunk's Pageable getter.
2018-01-09 12:46:47 +01:00
Mark Paluch
51e7e1b7f5 DATACMNS-1240 - Update copyright years to 2018.
Also, remove some trailing whitespaces and align outdated license header format.
2018-01-08 16:04:34 +01:00
Oliver Gierke
34cadd0b9b DATACMNS-1224 - Polishing of nullability annotations.
Refactored code to properly check for null fields in Eclipse. Added warning suppressions where suitable.
2017-11-30 00:29:32 +01:00
Oliver Gierke
1a199847cd DATACMNS-1162 - Improved support for immutable aggregates.
AbstractAggregateRoot is now generified to be able to use its concrete type on methods returning an instance of itself. Added new methods andEvent(…) and andEventsFrom(…) to easily transfer events from another aggregate instance. Added unit tests for fundamental functionality of the base class.
2017-09-20 11:45:37 +02:00
Christoph Strobl
0669632a61 DATACMNS-1141 - Add missing NonNullApi and Nullable annotations. 2017-08-28 13:32:47 +02:00
Mark Paluch
3a2b6b601b DATACMNS-1141 - Add missing NonNullApi and Nullable annotations.
Add Nullable annotation to ParsingUtils, Sort.Order and PropertyValueProvider.

Add getRequiredAnnotation(…) to PersistentEntity and PersistentProperty to provide methods returning required, non-null annotations.
2017-08-28 13:32:15 +02:00
Mark Paluch
e4e677d6b1 DATACMNS-1140 - Polishing.
Extend javadoc. Remove trailing whitespaces.

Original pull request: #238.
2017-08-25 09:31:04 +02:00
Christoph Strobl
0ff4961853 DATACMNS-1140 - Open up Query by Example to allow extension in module implementations.
We turned Example and ExampleMatcher into interfaces with default implementations created via the static of methods. The default ExampleMatcher has strongly typed default implementation. This change allows store implementations to create their very own flavor of Example and ExampleMatcher allowing eg. non typed ones.

Original pull request: #238.
2017-08-25 09:28:54 +02:00
Oliver Gierke
ce7a2e8ea5 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).
2017-08-23 15:47:50 +02:00
Oliver Gierke
beebcf1f7c DATACMNS-1114 - Updated Javadoc of Sort.and(…) to match nullability requirements. 2017-07-24 23:03:58 +02:00
Oliver Gierke
049970874d DATACMNS-1114 - Introduced usage of nullable annotations for API validation.
Marked all packages with Spring Frameworks @NonNullApi. Added Spring's @Nullable to methods, parameters and fields that take or produce null values. Adapted using code to make sure the IDE can evaluate the null flow properly. Fixed Javadoc in places where an invalid null handling policy was advertised. Strengthened null requirements for types that expose null-instances.

Removed null handling from converters for JodaTime and ThreeTenBP. Introduced factory methods Page.empty() and Page.empty(Pageable). Introduced default methods getRequiredGetter(), …Setter() and …Field() on PersistentProperty to allow non-nullable lookups of members. The same for TypeInformation.getrequiredActualType(), …SuperTypeInformation().

Tweaked PersistentPropertyCreator.addPropertiesForRemainingDescriptors() to filter unsuitable PropertyDescriptors before actually trying to create a Property instance from them as the new stronger nullability requirements would cause exceptions downstream.

Lazy.get() now expects a non-null return value. Clients being able to cope with null need to call ….orElse(…).

Original pull request: #232.
2017-07-24 10:47:28 +02:00
Oliver Gierke
d9b16d8a27 DATACMNS-1085 - Fixed typos in Javadoc.
Original pull request: #229.
2017-07-24 10:32:19 +02:00
Oliver Gierke
24704fc4de DATACMNS-1097 - Polishing.
Updated Sonargraph architecture description. Polished imports in domain package to avoid unnecessary imports (mostly due to Javadoc references).

Removed manually declared constructor in ExampleMatcherAccessor in favor of Lombok's @RequiredArgsConstructor. Removed deprecations in type information subsystem. Moved to different way of class loading to avoid null pointer warnings in ReflectionUtils.
2017-07-06 11:38:12 +02:00
Jens Schauder
1fc25727cf DATACMNS-1097 - Move classes to better matching packages.
Introduced new ExampleMatcherAccessor in data.support in favor of the now deprecated one in data.repository.core to avoid a dependency into the repositories subsystem to work with examples in general.

Added Degraph based test in order to avoid future cyclic package dependency violations.

Original pull request: #230.
Related ticket: DATAMONGO-1721.
2017-07-06 11:38:12 +02:00
Oliver Gierke
6cd5f7c052 DATACMNS-1096 - Replaced references to Spring's Converter to JDK 8's Function in domain package.
Switched to use Optional<Object> to make nullability explicit. Keep the original ….convert(…) method around as deprecated default method so that clients can be migrated gradually.
2017-06-26 16:26:41 +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
Oliver Gierke
727ab8384c DATACMNS-944 - Moved to more consistent naming scheme for CrudRepository methods.
We now follow a more consistent naming scheme for the methods in repository that are driven by the following guidelines:

* Methods referring to an identifier now all end on …ById(…).
* Methods taking or returning a collection are named …All(…)

That results in the following renames:

* findOne(…) -> findById(…)
* save(Iterable) -> saveAll(Iterable)
* findAll(Iterable<ID>) -> findAllById(…)
* delete(ID) -> deleteById(ID)
* delete(Iterable<T>) -> deleteAll(Iterable<T>)
* exists() -> existsById(…)

As a side-effect of that, we can now drop the Serializable requirement for identifiers.

Updated CRUD method detection to use the new naming scheme and moved the code to Java 8 streams and Optional. Adapted RepositoryInvoker API to reflect method name changes as well.
2017-05-03 17:49:50 +02:00
Oliver Gierke
382c912111 DATACMNS-1052 - Sort is now Streamable. 2017-05-03 17:26:36 +02:00
Mark Paluch
14647f9192 DATACMNS-1021 - Add Order.asc(…) and Order.desc(…) factory methods.
We now support Order creation with Order.asc(String) and Order.desc(String) factory methods as shortcut to constructor creation via new Order(Direction, String).

Sort.by(Order.asc("age"), Order.desc("name"));

Deprecated Order(String) constructor in favor of the Order.by(String) factory method. Replace references to new Order(String) with Order.by(String).

Original pull request: #211.
2017-04-26 16:48:40 +02:00
Oliver Gierke
78374f3cb7 DATACMNS-1050 - Polishing.
Used @RequiredArgsConstructor in a couple of places in favour of manually declared constructors. Removed obsolete factory methods on Range. Adapted test cases accordingly.

Original pull request: #212.
2017-04-26 16:30:32 +02:00
Mark Paluch
22dc91b68f DATACMNS-1050 - Encapsulate boundaries in value objects for Range.
We now encapsulate a boundary in Range within a Bound value object. Bound consists of a value and whether the value is inclusive or exclusive. Boundaries without a value are unbounded. We introduced factory methods for Range and Boundary creation using primitives and a builder to build a Range.

Range<Long> range = Range.unbounded();
Range<Integer> range = Range.from(Bound.inclusive(10)).to(Bound.inclusive(20));
Range<Integer> range = Range.of(Bound.inclusive(10), Bound.inclusive(20));

Original pull request: #121.
2017-04-26 16:30:28 +02:00
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
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
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
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
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
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
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
Christoph Strobl
be347eaaab DATACMNS-867 - Additional Java 8 language feature cleanup.
Make use of lambdas and method references though out the codebase. Remove no longer required generic type parameters.
Additionally remove unused imports and replace single element list initialization with dedicated singletonList.
Use Assertion overloads taking Supplier for dynamic assertion error messages.
2017-03-24 08:00:43 +01:00
Oliver Gierke
d4811e29d9 DATACMNS-867 - Second draft. 2017-03-24 08:00:23 +01:00
Oliver Gierke
cc63e5b7a4 DATACMNS-867 - First draft. 2017-03-24 08:00:23 +01:00
Christoph Strobl
3e048a6dca DATACMNS-985 - Remove references to single-argument assertion methods. 2017-01-31 18:10:40 +01:00
Oliver Gierke
a696484f8d DATACMNS-953 - Fixed application of GenericPropertyMatchers.exact().
We now really use exact matching for a match setup requesting exact matching. Previously, we erroneously set up the matching with a startsWith().
2016-12-06 10:58:52 +01:00
Oliver Gierke
c52c45741a DATACMNS-928 - Polishing.
Additional JavaDoc and @since tags. Minor additions to AbstractAggregateRoot.
2016-11-30 18:30:51 +01:00
Oliver Gierke
802eb7deef DATACMNS-928 - Support for publishing events from aggregate roots.
Introduced @DomainEvents usable on a method of an aggregate root. The method will be invoked when the aggregate is passed to a repository to save and its returned value or values will be exposed via an ApplicationEventListener.

Also, the aggregate can expose a method annotated with @AfterDomainEventPublication which will be invoked once all events have been published.
2016-11-30 18:30:51 +01:00
Oliver Gierke
b4518f0583 DATACMNS-920 - Added accessors for Range.lowerInclusive / ….upperInclusive.
Generally improved Range to be a value type by using Lombok's @Value.
2016-11-04 18:37:22 +01:00