Commit Graph

93 Commits

Author SHA1 Message Date
Phillip Webb
86bda64daa DATACMNS-1755 - Declare each variable in its own statement.
Update classes so that each member is declared on its own line. This
help to make them slightly easier to see when not using an IDE.

Original pull request: #448.
2020-06-25 11:20:28 +02:00
Mark Paluch
4bc474d8f4 DATACMNS-1750 - Refrain from inspecting Page contents if first item is null. 2020-06-22 15:27:10 +02:00
Mark Paluch
644b65eb71 DATACMNS-1733 - Fix Javadoc for Range factory methods.
Range.open(…) is now correctly documented with exclusive bounds.
2020-05-27 10:15:29 +02:00
Mark Paluch
4be5aae181 DATACMNS-1726 - Delombok source files. 2020-05-15 08:46:58 +02:00
wonwoo
12b9850a85 DATACMNS-1672 - Fix typos in Javadoc.
Original pull request: #431.
2020-02-25 09:23:52 +01:00
Mark Paluch
eed7658ce5 DATACMNS-1643 - Update copyright years to 2020. 2020-01-07 08:32:25 +01:00
Mark Paluch
e9a0ed7123 DATACMNS-1592 - Use Lombok's With and move off deprecated Wither.
We now migrate off Lombok's `@Wither` in favor of `@With`.
2019-11-26 13:55:23 +01:00
Oliver Drotbohm
6ce19956ab DATACMNS-1613 - Fixed Chunk.getSize() for usage with an unpaged Pageable.
We now return the content length as size of a Chunk if no Pageable has been used to create a Chunk. This makes the usage of a Chunk without an explicit Pageable work just like it was requested with the size of the given content.
2019-11-13 12:49:19 +01:00
Oliver Drotbohm
725d88811c DATACMNS-1581 - Polishing.
Javadoc on (Q)PageRequest.
2019-09-25 13:45:20 +02:00
Oliver Drotbohm
221ad9353e DATACMNS-1581 - Tighten nullability constraints for Sort parameters in PageRequest factory methods.
We now explicitly rejects null values for the Sort parameters in the constructor of PageRequest to avoid the creation of invalid instances if the IDE validation of nullability constraints is not in use.
2019-09-25 13:45:14 +02:00
Matthias Merdes
9647e72c27 DATACMNS-1580 - Fix typo in Javadoc.
Original pull request: #329.
2019-09-18 15:41:35 +02:00
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