Commit Graph

552 Commits

Author SHA1 Message Date
Oliver Gierke
c2da774268 DATACMNS-823 - Prepare 1.12 RC1 (Hopper). 2016-03-18 11:06:57 +01:00
Oliver Gierke
0fdd596be5 DATACMNS-823 - Updated changelog. 2016-03-18 11:06:45 +01:00
Oliver Gierke
137d7cc544 DATACMNS-818 - Renamed Tuple to Pair.
Got rid off manual implementation code in favor of Lombok annotations.
2016-03-18 09:54:29 +01:00
Oliver Gierke
036f71837b DATACMNS-810 - Final tweaks to general Query by Example documentation.
Made the query-by-example.adoc a top level document. Clients including the documents have to tweak the indentation on the inclusion side then. Included query-by-example.adoc into index.adoc so that it can be double checked in test renderings easily.
2016-03-18 09:19:01 +01:00
Oliver Gierke
ef7315a48f DATACMNS-810 - Improvements to the Query by Example documentation.
Fixed a few left over references to ExampleSpec which is now ExampleMatcher. Removed references to previous model of typed and untyped matchers.
2016-03-17 21:39:06 +01:00
Oliver Gierke
26f725be0d DATACMNS-810 - Polishing.
Renamed ExampleSpecification to ExampleMatcher and introduced a matching() factory method, dropping the dedicated override mechanism for types for now. Updated documentation accordingly.

Used Lombok for constructor creation, field defaults, toString() as well as equals(…) and hashCode() implementations.

Tweaked imports in unit tests. Renamed methods to express expected behavior.

Original pull request: #153.
2016-03-17 16:22:55 +01:00
Mark Paluch
b0ce7009e8 DATACMNS-810 - Refactor Query by Example API.
Split Example and ExampleSpec to create reusable components. Refactor builder pattern to a fluent API that creates immutable instances. Split user and framework API, Example and ExampleSpec are user API, created ExampleSpecAccessor for modules to access example spec configuration. Create static methods in GenericPropertyMatchers to ease creation of matchers in a readable style. Convert PropertySpecifier to inner class  and move PropertySpecifiers to ExampleSpec.

Related tickets: DATAJPA-218, DATAMONGO-1245.
Original pull request: #153.
2016-03-17 16:17:39 +01:00
Christoph Strobl
4092f0716f DATACMNS-810 - Add core types for Query by Example support.
Added required types for Query by Example which should be used by the individual store implementations. 

Generally the Example type captures a sample object and allow various settings concerning the mapping into an actual query. So there’s configuration options for handling null values, string matching, property paths to ignore,

Related tickets: DATAJPA-218, DATAMONGO-1245.
Original pull request: #153.
2016-03-17 16:17:39 +01:00
Oliver Gierke
a8db5e3d23 DATACMNS-829 - Fixed handling of Map null values in ProxyProjectionFactory.
We now eagerly return null values in attempts to project Map values.
2016-03-15 15:46:56 +01:00
Oliver Gierke
f8ea9fb8ab DATACMNS-828 - Polishing.
Fixed JavaDoc in unit tests.
2016-03-15 15:05:03 +01:00
Oliver Gierke
c57bfec696 DATACMNS-828 - Fixed potential NullPointerException in ResultProcessor.
ResultProcessor.processResult(…) now explicitly handles null values to prevent IllegalArgumentExceptions being provoked in the ProjectionFactory which occurred if null values were handed down to it.
2016-03-15 15:04:28 +01:00
Oliver Gierke
71fdf8646e DATACMNS-826 - Fixed JavaDoc for GeoModule. 2016-03-15 13:20:24 +01:00
Oliver Gierke
f0f9d5bc20 DATACMNS-825 - Polishing.
Tweaked annotation cache usage in BasicPersistentEntity.findAnnotation(…).

Original pull request: #156.
2016-03-15 13:20:20 +01:00
Christoph Strobl
a40e247c25 DATACMNS-825 - Allow usage of composed annotations using @AliasFor.
We now resolve composed annotation values using @AliasFor within AnnotationBasedPersistentProperty and BasicPersistentEntity. Nevertheless it is up to the individual store implementation to make use of this.

Original pull request: #156.
2016-03-13 16:30:03 +00:00
Oliver Gierke
ae96301ab0 DATACMNS-812 - Polishing.
Formatting and extension of copyright years.

Original pull request: #154.
2016-03-07 11:33:57 +01:00
Timothy Cheng
bc421f53c0 DATACMNS-812 - Fixed PageImpl.toString() to improve readability.
Add one to the getNumber() in PageImpl.toString() since it uses 0-based index.

Original pull request: #154.
2016-03-07 11:31:42 +01:00
Oliver Gierke
deb884dfb1 DATACMNS-821 - Improved type prediction for FactoryBean implementations.
Previously, we registered an InstantiationAwareBeanPostProcessor to predict the type to be created by RepositoryFactoryBeanSupport by inspecting a particular property value of the registered BeanDefinition.

This has now been elevated to a more generic mechanism that can get a FactoryBean type configured with a set of properties to inspect for a configured type. That new infrastructure now replaces the explicit configuration for RepositoryFactoryBeanSupport with one that's set up via configuration.
2016-02-26 19:21:01 +01:00
Oliver Gierke
2b2882635a DATACMNS-817 - Updated changelog. 2016-02-23 14:27:20 +01:00
Oliver Gierke
d3e6ad104c DATACMNS-820 - Polishing.
Fixed indentation to use tabs instead of spaces. Tweaked structure of if-clauses in PropertyAccessingMethodInterceptor to reduce nesting. Made helper method static. 

Restructured test cases slightly and used ExpectedException rule to verify exceptions. Moved newly introduced test methods more to the end of the file (new tests last).

Added author and copyright year extensions where necessary.

Original pull request: #155.
2016-02-20 20:33:14 +01:00
Mark Paluch
e868577def DATACMNS-820 - Allow setter invocations in projections backed by beans.
Invocations to setter methods are now passed to the backing bean.

Original pull request: #155.
2016-02-20 20:33:13 +01:00
Oliver Gierke
3667dcc81e DATACMNS-811 - Prepare 1.12 M1 (Hopper). 2016-02-12 15:36:18 +01:00
Oliver Gierke
126aac106c DATACMNS-811 - Updated changelog. 2016-02-12 15:36:04 +01:00
Oliver Gierke
e0d2907905 DATACMNS-815 - Made static type cache non-static in SimpleTypeInformationMapper.
We now use a non-static cache for TypeInformation instances in SimpleTypeInformationMapper to make sure Spring Boot's development tools can correctly reload classes. Removed the static singleton instance of SimpleTypeInformationMapper in favor instantiating it directly.
2016-02-09 14:22:06 +01:00
Oliver Gierke
85e569b4f6 DATACMNS-804 - ParametersParameterAccessor now correctly iterates over only the bindable values.
Corrected the way the BindableParametersIterator works by limiting the upper bound of the iteration to the number of actually bindable parameters.
2016-01-21 10:19:59 +01:00
Oliver Gierke
b17a797fe6 DATACMNS-802 - PagedResourceAssembler now allows customizing the PagedResource instance.
Introduced a template method to override the creation of a PagedResource to allow subclasses to create a more concrete instance than PagedResource itself.
2016-01-20 14:24:38 +01:00
Oliver Gierke
c916fcb1c1 DATACMNS-801 - Make sure PropertyReferenceException does not expose duplicate potential matches.
We now use a Set to collect potential matches from fields and accessors.

Polished assertions and JavaDoc in PropertyPath along the way.
2016-01-12 08:39:44 +01:00
Oliver Gierke
80e44a3fc0 DATACMNS-89 - Returned type now does not consider Number types DTO types. 2016-01-08 16:00:15 +01:00
Oliver Gierke
d03ca30381 DATACMNS-797 - Updated changelog. 2015-12-18 10:50:52 +01:00
Oliver Gierke
306795468d DATACMNS-795 - Added support for Scala's Option type on repositories.
Just like with Google's or Java 8's optional we now support Scala's Option type as wrapper fro return values on repositories.
2015-12-16 19:54:27 +01:00
Oliver Gierke
4af7fe3165 DATACMNS-89 - ChainingConverter now eagerly returns values.
The ChainingConverter now returns values as soon as one converter in the chain produces an instance that's compatible to the target type. This allows ResourceProcessor clients to provide a Converter to take care of the complete conversion themselves.
2015-12-15 13:34:36 +01:00
Oliver Gierke
dbe79f89a9 DATACMNS-89 - Infrastructure for projections on repository queries.
QueryMethods now expose a ResourceProcessor which is exposes information about the final to be created object types which can either be DTOs containing a persistence constructor (see @PersistenceConstructor) or projection interfaces. The former are analyzed for constructor properties so that store implementations can use that information to create projected queries that return exactly the fields required for that DTO.

Projection interfaces are inspected, their properties are considered input properties and the same projection queries can be issued against the data store. If a projection contains dynamically calculated properties (i.e. it uses SpEL expressions via @Value) the original entities have to be queried and can be projected during post processing.

ProjectionFactory now exposes a more advanced ProjectionInformation that has additional meta information about the projection type. ProxyProjectionFactory now refers to the BeanClassLoader instead of the ResourceLoader.

RepositoryFactory(Bean)Support now also implement BeanFactoryAware to forward the BeanFactory to the SpelAwareProxyProjectionFactory which in turn now gets handed into the QueryLookupStrategy as well as the QueryMethod.

Parameter now knows about a dynamic projection type, which is a query method parameter of type Class bound to a generic method parameter and will be used to determine the projection to be used on a per call basis.

Original pull request: #150.
2015-12-14 19:31:33 +01:00
Oliver Gierke
c60cd647cc DATACMNS-794 - Repositories now exposes RepositoryInformation for repository interfaces. 2015-12-10 08:23:24 +01:00
Eric Dahl
755a4cfaec DATACMNS-793 - Fix some formatting issues in reference documentation. 2015-12-06 16:27:17 +01:00
Oliver Gierke
01563eb312 DATACMNS-791 - Improved messages in QueryMethodeParameterConversionException and ReflectionRepositoryInvoker. 2015-11-28 23:25:49 +01:00
Oliver Gierke
b0f81ef80a DATACMNS-790 - Added Tuple value type.
Related pull request: https://github.com/spring-projects/spring-data-mongodb/pull/327.
2015-11-26 16:14:56 +01:00
Pepe García
64eafa4341 DATACMNS-789 - Fixed typo in JavaDoc of Page.
Original pull request: #146.
2015-11-23 17:13:15 +01:00
Oliver Gierke
3ed2f44e60 DATACMNS-787 - QuerydsBindings now allows aliasing of paths.
If a single path is now handed to QuerydslBindings.bind(…), a specialized AliasingPathBinder is returned which allows defining an alias the binding will be exposed under.

By default that alias will cause the original binding being black-listed and thus become unavailable for binding. This can be overridden by explicitly white-listing the properties to be bindable.
2015-11-23 13:07:19 +01:00
Oliver Gierke
60794a8923 DATACMNS-786 - Fixed typo in section of repository populators in reference documentation. 2015-11-20 17:39:25 +01:00
Oliver Gierke
c013c71e7a DATACMNS-670 - Upgraded to Querydsl 4.
Switched to new Querydsl 4 artifacts and adapted to changed package names and API changes.

Cleaned up some JavaDoc and APIs in QuerydslBindingsFactory and QuerydslBinderCustomizer.
2015-11-17 11:07:05 +01:00
Oliver Gierke
db2a09192b DATACMNS-785 - Added RevisionRepository.findRevision(ID, N). 2015-11-16 17:09:32 +01:00
Oliver Gierke
2564e0e8b1 DATACMNS-784 - Updated changelog. 2015-11-16 08:25:50 +01:00
Oliver Gierke
d2737983c3 DATACMNS-783 - DefaultTypeMapper now specializes raw generic types.
If the type lookup from the store source returns a raw generic type (e.g. resolving the value of a generic property against a value of that generic type - i.e. not a more concrete type binding the generic information) in the context of a generic property, we previously did not apply the generics information of the contextual instance to that very raw type.

We now expose a TypeInformation.specialize(ClassTypeInformation) which applies the current generics context to the given raw type and basically creates a synthetic parameterized TypeInformation instance.

DefaultTypeMapper applies this specialization by default now with ClassTypeInformation simply returning the given type as is so that we don't create any resolution overhead in case no generics are involved in the first place.
2015-11-13 17:16:47 +01:00
Oliver Gierke
0d6476c642 DATACMNS-782 - ProxyProjectionFactory now converts primitive attribute values.
The ProjectingMethodInterceptor now uses a default ConversionService instance to try to convert a potentially not matching result of the target invocation into the type the projection requires before the attempt to create nested projection.
2015-11-12 11:17:43 +01:00
Oliver Gierke
d3a194c408 DATACMNS-779 - Fixed JavaDoc in QuerydslPredicateBuilder.
Added JavaDoc to the constructor of QuerydslPredicateBuilder.
2015-10-22 11:45:17 +02:00
Oliver Gierke
896cc76fc7 DATACMNS-777 - Updated changelog. 2015-10-14 14:08:23 +02:00
Oliver Gierke
1185e71214 DATACMNS-768 - Added support for Optional as query method parameter type.
Query method parameter values of JDK 8 or Guava Optional type are now transparently unwrapped on parameter value access. ParametersParameterAccessor now unwraps them on instance creation.
2015-10-07 19:28:19 +02:00
Ricardo Espirito Santo
91eaf1bc50 DATACMNS-771 - Fixed typo in BasicPersistentEntity.
Original pull request: #145.
2015-10-05 18:32:07 +02:00
Oliver Gierke
828c19a4e5 DATACMNS-773 - Added support for persisting ZoneId instances as Strings.
We now ship converters for JSR-310 and ThreeTenBP's ZoneId conversion to String and back.
2015-10-05 18:03:42 +02:00
Oliver Gierke
be47572e56 DATACMNS-769 - Fixed assignability check for from QueryMethod.
The assignability check of method return types now explicitly detects wrapper types supported in QueryExceutionConverters and automatically unwraps those before the actual check.
2015-10-05 12:04:26 +02:00
Oliver Gierke
01f2c30b1d DATACMNS-753 - Fixed default handling of empty sort parameter.
We now correctly inspect the sort parameter values and also fall back to the default if a single, empty parameter value is given.

Related ticket: DATACMNS-408.
Related pull request: #138.
2015-09-09 17:56:27 +02:00