Commit Graph

682 Commits

Author SHA1 Message Date
Oliver Gierke
0fc81ad8f3 DATACMNS-980 - Prepare 1.13.1 (Ingalls SR1). 2017-03-02 09:33:24 +01:00
Oliver Gierke
33bf149d55 DATACMNS-980 - Updated changelog. 2017-03-02 09:32:21 +01:00
Oliver Gierke
c2828f4537 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:25:58 +01:00
Peter Rietzler
04aa75c5e3 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:25:58 +01:00
Oliver Gierke
9dbe75aa4e DATACMNS-1000 - Fixed typo in code docs about domain events. 2017-03-01 11:13:43 +01:00
Christoph Strobl
9afe5766c6 DATACMNS-999 - Improve resource extensive error message concatenation.
Use simple if manually throwing the IllegalArgumentException instead of an Assert. Should be replaced with an Assert accepting Supplier when moving to Spring 5 and Java 8.

Original pull request: #198.
2017-02-28 18:54:26 +01:00
Oliver Gierke
876de8494b 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:32:28 +01:00
Mark Paluch
444597105c DATACMNS-987 - Polishing.
Remove unused Querydsl tests. Add author. Reformat code. Extend Javadoc.
2017-02-13 13:32:23 +01:00
Jens Schauder
fd3c9783e2 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:18 +01:00
Christoph Strobl
b898ad78e6 DATACMNS-985 - Remove references to single-argument assertion methods. 2017-01-31 18:09:58 +01:00
Oliver Gierke
8bbf9029fc DATACMNS-964 - Updated changelog. 2017-01-26 12:08:44 +01:00
Oliver Gierke
83f8799cb5 DATACMNS-965 - Prepare 1.13 GA (Ingalls). 2017-01-26 10:26:34 +01:00
Oliver Gierke
a85c253cd8 DATACMNS-965 - Updated changelog. 2017-01-26 10:26:31 +01:00
Oliver Gierke
bf04e3232b 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:41:39 +01:00
Oliver Gierke
e68be19054 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:23:14 +01:00
Oliver Gierke
60d40b51b3 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:49:35 +01:00
Oliver Gierke
9ada55b050 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:18:25 +01:00
Mark Paluch
250900efdf DATACMNS-973 - Polishing.
Convert @see http://… links to valid format using @see <a href=…>…</a>.
2017-01-13 08:48:52 +01:00
Mark Paluch
80b33645c9 DATACMNS-973 - Migrate ticket references in test code to Spring Framework style. 2017-01-13 08:45:25 +01:00
Oliver Gierke
c31714c922 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.

Unfortunately no tests for this one as we can't declare default methods in our codebase requiring JDK 6 compatibility.
2016-12-23 12:54:45 +01:00
Oliver Gierke
07430b9171 DATACMNS-932 - Updated changelog. 2016-12-21 19:35:18 +01:00
Oliver Gierke
cba32b3939 DATACMNS-889 - Prepare 1.13 RC1 (Ingalls). 2016-12-21 16:15:47 +01:00
Oliver Gierke
b923331e9f DATACMNS-889 - Updated changelog. 2016-12-21 16:15:32 +01:00
Oliver Gierke
c8fb117e6b 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:13:21 +01:00
Oliver Gierke
f4e9c2c30c DATACMNS-962 - Fixed typo in reference documentation. 2016-12-19 10:17:17 +01:00
Oliver Gierke
aa993bb366 DATACMNS-960 - RevisionRepository now extends Repository. 2016-12-15 15:37:56 +01:00
Oliver Gierke
259a1e0958 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 14:49:50 +01:00
Oliver Gierke
3a24beecf3 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:02 +01:00
Oliver Gierke
a76aa4d2a2 DATACMNS-958 - Use ExposeInvocationInterceptor.ADVISOR in RepositoryFactorySupport.
Its usage is recommended over using the instance as advice.
2016-12-14 13:58:47 +01:00
Oliver Gierke
902cb44e86 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>>).
2016-12-13 15:31:54 +01:00
Oliver Gierke
33b65fbe63 DATACMNS-940 - Support for Javaslang collections as repository return types.
Javaslang's collection and map types can now be used on repository query methods and get adapted similarly to nullable wrapper types (like JDK's Optional). Also made TypeInformation infrastructure aware of the map type so that a value type lookup gets handle correctly.
2016-12-12 20:07:37 +01:00
Oliver Gierke
8f748d6dcf DATACMNS-956 - Ensure consistent use of ClassTypeInformation.from(…). 2016-12-12 17:09:00 +01:00
Oliver Gierke
8af061f389 DATACMNS-941 - Support for downcasts in Querydsl web bindings.
We now support downcasts (e.g. user.as(QSpecialUser.class).…) expressions in Querydsl web binding. We do so by skipping the introduced intermediate step in the path when calculating the dot path.

Refactored the internals of the binding to now work based on a PathInformation implementation for which either a Querydsl Path or a Spring Data PropertyPath can be used. This allows us to reuse the paths of predefined bindings.

A bit of Lombok cleanup in internal implementations.
2016-12-12 16:22:56 +01:00
Oliver Gierke
e1d1a68f49 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:54:14 +01:00
Oliver Gierke
2377cbac85 DATACMNS-934 - BasicPersistentEntity.addAssociation(…) drops null values now.
Previously a null value was added to the list of associations if it was handed to BasicaPersistentEntity.addAssociation(…). We now drop those null values and log a warning as it usually indicates a MappingContext implementation identifying a property as association but subsequently failing to look it up.
2016-12-05 16:39:05 +01:00
Oliver Gierke
76d1995b37 DATACMNS-952 - Switched from component scanning to SpringFactoriesLoader for internal extension points.
Both the configuration code looking up Spring Data specific Jackson modules as well as the code detecting whether we have multiple Spring Data modules on the classpath used component scanning. That can have quite significant impact on startup times.

This commit replaces the classpath scanning with the use of SpringFactoriesLoader that now requires modules that want to extend the behavior of Spring Data's web configuration or indicate a repository implementation being present by shipping a file called META-INF/spring.factories. Spring Data relies on the following keys:

- org.springframework.data.web.config.SpringDataJacksonModules - list the Spring configuration classes that will expose additional Jackson modules that are supposed to be registered for Spring Data's Jackson web support
- org.springframework.data.repository.core.support.RepositoryFactorySupport - list the Spring Data repository factory implementation class that implements repository support for your module. The general detection and configuration mechanism for user repositories is not affected by this. Currently Spring Data only uses the pure number of different entries for that key to switch into strict configuration mode in case we find more than one entry.
2016-12-05 13:52:55 +01:00
Oliver Gierke
8d67c84809 DATACMNS-951 - Polishing.
Switched to parameterized tests for newly introduced Converters.

Fixed imports and JavaDoc.

Original pull request: #186.
2016-12-05 09:55:46 +01:00
Barak Schuster
3125bbf300 DATACMNS-951 - Added Converter implementations for JSR-310 Duration and Period.
Original pull request: #186.
2016-12-05 09:53:18 +01:00
Oliver Gierke
8062698589 DATACMNS-928 - Reference documentation for event publication support. 2016-12-01 10:17:10 +01:00
Oliver Gierke
c6f9c40472 DATACMNS-928 - Refinements for aggregate root domain event publication.
We now publish events for all methods named "save" on the repository. Fundamentally, that's in place to capture calls to CrudRepository.save(Iterable entities), too.

Some minor refactorings to the internal setup of EventPublishingMethodInterceptor. More JavaDoc.
2016-12-01 10:17:06 +01:00
Oliver Gierke
bdf4738716 DATACMNS-928 - Polishing.
Additional JavaDoc and @since tags. Minor additions to AbstractAggregateRoot.
2016-11-30 18:29:27 +01:00
Oliver Gierke
0fc9770462 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:29:27 +01:00
Oliver Gierke
d3c70d834f DATACMNS-918 - Polishing.
Minor JavaDoc stuff.
2016-11-29 14:09:30 +01:00
Mark Paluch
72e349b006 DATACMNS-918 - Provide interfaces for Pageable and Sort method argument resolvers.
We now provide HandlerMethodArgumentResolver interfaces to resolve Sort and Pageable method arguments with typed return values.
2016-11-29 14:09:23 +01:00
Oliver Gierke
0cc17ffef4 DATACMNS-943 - We prefer direct matches on repository query method overloads.
We now try to look up a target class method based on concrete name and parameter type before falling back on the more expensive type matches. This also eliminates the possibility of invalid method matches as described in the ticket.
2016-11-24 17:21:11 +01:00
Oliver Gierke
50f3565a99 DATACMNS-933 - Updated changelog. 2016-11-23 13:52:31 +01:00
Oliver Gierke
34002d8a9b DATACMNS-937 - Fixed spelling of Javaslang related code.
Using a lower case "s" now.
2016-11-21 12:34:12 +01:00
Mark Paluch
cde3404364 DATACMNS-939 - Do not create queries for static interface methods.
We now no longer attempt query creation for static methods declared on a repository interface. This allows static method usage inside of repository interfaces.

interface PersonRepository extends CrudRepository<Person, String> {

    static String createId() {
        // …
    }

    default Person findPerson() {
        return findOne(createId());
    }
}
2016-11-21 10:32:07 +01:00
Oliver Gierke
3cd76d200d DATACMNS-937 - Document JavaSlang's Option type as query method return type.
Mentioned the support for Scala's Option type, too.
2016-11-19 15:38:44 +01:00
Oliver Gierke
cca9cd8abc DATACMNS-937 - Polishing.
Removed Spring 4.2 guard from QueryExecutionConverter and its unit tests.
2016-11-19 12:49:24 +01:00