Commit Graph

1265 Commits

Author SHA1 Message Date
Oliver Gierke
bdd55fc7ab DATACMNS-867 - Java 8 polish of ReflectiveRepositoryInformation.
Introduced Optionals.firstNonEmpty(…) to consume a set of Suppliers until one returns a non-empty Optional.
2017-03-24 08:00:25 +01:00
Oliver Gierke
d7340e391c DATACMNS-867 - Further fixes. 2017-03-24 08:00:25 +01:00
Oliver Gierke
615b6548e8 DATACMNS-867 - Ported tests for reactive support to AssertJ. 2017-03-24 08:00:25 +01:00
Oliver Gierke
fd2c400c4e DATACMNS-867 - Optionals in CrudMethods API. 2017-03-24 08:00:25 +01:00
Oliver Gierke
8268373d11 DATACMNS-867 - Further polishing in MappingContext APIs. 2017-03-24 08:00:25 +01:00
Oliver Gierke
142f8b4b4b DATACMNS-867 - Fixed unit tests. 2017-03-24 08:00:25 +01:00
Oliver Gierke
90683ed68a DATACMNS-867 - Re-introduced CdiRepositoryBean.getDependencyInstance(…) with explicit type. 2017-03-24 08:00:24 +01:00
Oliver Gierke
8d22b3ae7c DATACMNS-867 - Fixed repository base class configuration in RepositoryBeanDefinitionBuilder.
We erroneously forwarded the factory class from the extension in case of an absent repository base class name in the configuration (which is the default).
2017-03-24 08:00:24 +01:00
Oliver Gierke
49575fd4ce DATACMNS-867 - Introduced Stream-based alternatives for PersistentEntity.doWith… methods. 2017-03-24 08:00:24 +01:00
Oliver Gierke
db4bf10ebb DATACMNS-867 - Introduced PersistentEntity.getRequiredPersistentProperty(). 2017-03-24 08:00:24 +01:00
Oliver Gierke
d4811e29d9 DATACMNS-867 - Second draft. 2017-03-24 08:00:23 +01:00
Mark Paluch
57ed50a730 DATACMNS-867 - Adopt Optional<T> in ASM generated property accessor factories. 2017-03-24 08:00:23 +01:00
Oliver Gierke
cc63e5b7a4 DATACMNS-867 - First draft. 2017-03-24 08:00:23 +01:00
Oliver Gierke
1b17271915 DATACMNS-1008 - Polishing.
Formatting and copyright years in DefaultRepositoryInformation.
2017-03-14 07:46:00 +01:00
Oliver Gierke
47d00bf696 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:45:54 +01:00
Oliver Gierke
d98c0df40b DATACMNS-1007 - Polishing.
Moved the enum declaration to a more appropriate position. Moved the author addition to the part of the codebase that was actually changed. Expanded copyright year.

Moved unit tests to more appropriate position. Added another one to make sure a reference to a boolean property "empty" can still be supported by adding an explicit Is to make sure we detect a simple property reference.

Original pull request: #203.
2017-03-13 13:02:12 +01:00
Michael Cramer
760f09a059 DATACMNS-1007 - Added IsEmpty and IsNotEmpty keywords to query parser.
The query derivation mechanism now detects IsEmpty and NotIsEmpty as keywords and exposes them in the PartTree.

Original pull request: #203.
2017-03-13 13:02:06 +01:00
Oliver Gierke
be4498659d 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 12:11:32 +01:00
Maciek Opala
b194f7794d 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 12:09:20 +01:00
Oliver Gierke
a3afa84198 DATACMNS-940 - Fix query method query result type detection for custom collections.
The nullable wrapper types now expose whether they're a single value type or a multi value type. This is necessary as Javaslang's Option implements Iterable (something we previously checked for to detect a collection query) and the custom collections potentially being usable within other wrapper types (e.g. Future<Seq<User>>).
2017-03-09 12:08:19 +01:00
Oliver Gierke
642e92b2eb 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:44:44 +01:00
Oliver Gierke
4552d49c5f DATACMNS-980 - Updated changelog. 2017-03-02 11:10:55 +01:00
Oliver Gierke
ebd871b566 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:31:57 +01:00
Peter Rietzler
3ca77831e1 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:31:57 +01:00
Oliver Gierke
f8715ac8a8 DATACMNS-1000 - Fixed typo in code docs about domain events. 2017-03-01 11:13:49 +01:00
Christoph Strobl
aaf4ccc69c DATACMNS-999 - Improve resource extensive error message concatenation.
We now use Assert.isTrue(…) taking a Supplier to avoid unnecessary String concatenation.

Original pull request: #198.
2017-02-28 19:03:51 +01:00
Oliver Gierke
27ce92cd16 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:36:00 +01:00
Mark Paluch
f453130569 DATACMNS-987 - Polishing.
Remove unused Querydsl tests. Add author. Reformat code. Extend Javadoc.
2017-02-13 13:32:42 +01:00
Jens Schauder
0ad1a8dad3 DATACMNS-987 - Jackson converter gets only loaded if Jackson and Jayway dependencies are present.
Added a test for loading of QuerydslPredicateArgumentResolver, but it fails presumably because EnableSpringDataWebSupport is not in effect.

Renamed SpringDataWebConfigurationUnitTests to SpringDataWebConfigurationIntegrationTests since it is actually an integration test.

Related ticket: DATACMNS-993.
2017-02-13 13:32:39 +01:00
Christoph Strobl
3e048a6dca DATACMNS-985 - Remove references to single-argument assertion methods. 2017-01-31 18:10:40 +01:00
Oliver Gierke
49817278b7 DATACMNS-964 - Updated changelog. 2017-01-26 12:12:28 +01:00
Oliver Gierke
e93bf75f5d DATACMNS-965 - Updated changelog. 2017-01-26 12:12:03 +01:00
Oliver Gierke
88e70a2730 DATACMNS-776 - Made ProxyingHandlerMethodArgumentResolver to only support user types or annotated ones.
ProxyingHandlerMethodArgumentResolver is now more lenient when it comes to which types to support for proxying. As indicated in the ticket, we've been to aggressive opting in for all interfaces which - depending on the order of converter registrations - caused us interfering with other interface based resolutions (e.g. in Spring Mobile, Security etc.).

We now only aggressively kick in if either the type or parameter is annotated with @ProjectedPayload or the type itself is not a Spring Framework or native Java one. This should leave user defined types still be accepted whereas the types we previously erroneously interfered with should now be ignored.
2017-01-23 11:42:25 +01:00
Oliver Gierke
50b84e701f DATACMNS-972 - Fixed ProjectingJackson2HttpMessageConverter.canRead(…) for generic type variables.
ProjectingJackson2HttpMessageConverter.canRead(…) now resolves the given type correctly, even in context of their owning class.
2017-01-19 12:30:08 +01:00
Oliver Gierke
e3b7bb8b01 DATACMNS-957 - AuditingHandler now works with entities without an identifier.
Entities without an identifier previously an exception because the IsNewStrategyFactory wasn't able to determine a strategy even if there was no auditing to be applied in the first place.

We now eagerly check for auditability and skip the lookup for an IsNewStrategy completely in case that check returns false.

Related pull request: #189.
2017-01-19 09:50:11 +01:00
Oliver Gierke
74426c01e1 DATACMNS-977 - Added @Indexed to core annotations and types to be indexed for component scanning.
Equipped @Persistent, @RepositoryDefinition and our Repository marker interface with @Indexed so that Spring 5's annotation processor will detect types annotated with or extending the aforementioned type for inclusion in the component index.

Related ticket: SPR-11890.
2017-01-18 19:14:02 +01:00
Oliver Gierke
db17a28238 DATACMNS-975 - Make sure repository method is invoked before event publication.
To make sure that event handlers can read the state of the aggregate persisted, we now invoke the call to the repository before publishing the events. That shouldn't make too much of a difference to most listeners as the event usually contains a reference to the aggregate. However, the new model generally aligns with the approach of reporting what *already has happened* better that our previous approach of first publishing the events and then invoking the repository method.

Related tickets: DATACMNS-928.
2017-01-13 12:28:29 +01:00
Mark Paluch
4fb0567b00 DATACMNS-974 - Update project documentation with the CLA tool integration. 2017-01-13 11:28:55 +01:00
Mark Paluch
8bafe7964b DATACMNS-973 - Polishing.
Convert @see http://… links to valid format using @see <a href=…>…</a>.
2017-01-13 08:50:54 +01:00
Mark Paluch
4eb1ae8de2 DATACMNS-973 - Migrate ticket references in test code to Spring Framework style. 2017-01-13 08:50:51 +01:00
Oliver Gierke
a946d651ff DATACMNS-967 - Getters that are default methods are not considered projection input properties anymore.
We now exclude getter methods that are default methods from the consideration which properties of a projection interface are considered input properties in the first place.

Some additional Java 8 polish in DefaultProjectionInformation.
2016-12-23 13:06:34 +01:00
Oliver Gierke
56ec60b269 DATACMNS-932 - Updated changelog. 2016-12-21 19:35:21 +01:00
Oliver Gierke
403105f2fc DATACMNS-889 - Updated changelog. 2016-12-21 18:42:50 +01:00
Oliver Gierke
3b635e665a DATACMNS-963 - Returned type returns distinct input properties now.
We now manually filter already gathered property names in ReturnedInterface.getInputProperties() as we have to deal with duplications for properties with the same name at different levels of the inheritance hierarchy.
2016-12-21 14:14:48 +01:00
Oliver Gierke
658e9bf09b DATACMNS-962 - Fixed typo in reference documentation. 2016-12-19 10:16:58 +01:00
Mark Paluch
087694af63 DATACMNS-961 - Use newer Java 8 on Travis CI. 2016-12-16 11:02:44 +01:00
Oliver Gierke
a2218ba81e DATACMNS-891 - Moved to constructor injection for RepositoryFactoryBeanSupport.
RepositoryFactoryBeanSupport now takes the repository interface as a constructor argument instead of as a setter. This makes sure that the container induced type prediction for factory beans actually wires the interface *before* it calls getObjectType() on the instance. This allows us to remove the extra infrastructure we had in place to predict the bean types and autowiring will just work out of the box.

Adapted infrastructure code accordingly, removed obsolete infrastructure code and adapted test cases accordingly.
2016-12-15 16:32:03 +01:00
Oliver Gierke
313e0ae196 DATACMNS-960 - RevisionRepository now extends Repository. 2016-12-15 16:17:15 +01:00
Oliver Gierke
47b8e0290f DATACMNS-959 - RepositoryFactorySupport now registers interceptor to detect transactions.
The interceptor discovers whether a transaction was running before the call entered the repository proxy and exposes that fact via ….isSurroundingTransactionActive() for donwstream usage.

Related ticket: DATAJPA-1023.
2016-12-14 15:34:08 +01:00
Oliver Gierke
21a6f19312 DATACMNS-958 - Use ExposeInvocationInterceptor.ADVISOR in RepositoryFactorySupport.
Its usage is recommended over using the instance as advice.
2016-12-14 13:59:50 +01:00