Commit Graph

599 Commits

Author SHA1 Message Date
Thomas Darimont
e76f820469 DATACMNS-382 - Remove copy of AnnotationTypeFilter in RepositoryComponentProvider.
Removed the copied class to use the one from Spring Core now that the necessary tweak is available in Spring 3.1.x.

Original pull request: #49.
2013-10-17 18:12:34 +02:00
Oliver Gierke
06df973c54 DATACMNS-384 - Introduced value object for Version. 2013-10-17 10:29:33 +02:00
Oliver Gierke
1b3d9ed2c4 DATACMNS-380 - MappingContext.getPersistentPropertyPath(…) now throws MappingException. 2013-10-10 13:42:33 +02:00
Oliver Gierke
048394690f DATACMNS-381 - Improved exception message in PropertyReferenceException.
PropertyReferenceException now not only exposes the property not found but also the already resolved Property path to make it easier to understand what is causing the exception in the first place.
2013-10-10 13:01:09 +02:00
Oliver Gierke
06c2f41584 DATACMNS-380 - MappingContext exposes PersistentPropertyPath by dot path.
Introduced MappingContext.getPersistentPropertyPath(String, Class<?>) to allow looking up a PersistentPropertyPath from a plain dot-notated path expression (e.g. foo.bar.foobar). This removes the need to use a PropertyPath in case you really only want to look up plain path expressions and the additional functionality in PropertyPath (camel case traversal and interpreting _ as hard delimiter) is not needed or wanted.
2013-10-10 12:54:24 +02:00
Thomas Darimont
2d699b6b36 DATACMNS-374 - Improved error handling in case of a missing repository.
In Repositories.getCrudInvoker(…) we now throw an IllegalArgumentException if we cannot find an appropriate repository for the given domain class. Previously it just blew up with a NullPointerException without a clear error message.

Original pull request: #46.
2013-10-07 13:21:27 +02:00
Thomas Darimont
43b7a54294 DATACMNS-363 - Improved support for unicode characters for repository query methods.
In order to find a keyword like "And" followed by a property name we now probe also for non Basic Latin characters in addition to just an uppercase letter. This is needed to support property-names with characters that don't have an upper or lowercase representation. This allows us to support finder methods like: findBy이름And생일OrderBy생일Asc(…).

Original pull request: #47.
2013-10-07 12:44:37 +02:00
Oliver Gierke
93b2d39cf1 DATACMNS-377 - Prevent page sizes less than one.
PageRequest now actively prevents page sizes less than one. PageableHandlerMethodArgumentResolver falls back to default page size if it detects a page size less than one. It also rejects invalid default configuration using @PageableDefault.
2013-10-07 10:47:25 +02:00
Oliver Gierke
59e9af4950 DATACMNS-376 - Repositories now inspects user class for factory lookups.
When looking up the RepositoryFactoryInformation for a domain type we now make sure we look up the user type to not accidentally try to do so for a persistence provider generated proxy class for the original type. This prevents us from not finding PersistentEntity instances, Repository- or EntityInformation accidentally.
2013-10-01 17:24:42 +02:00
Thomas Darimont
e7475e5e0f DATACMNS-364 - Infrastructure to allow redeclaring CRUD methods with queries.
Introduced new meta-annotation QueryAnnotation to mark and identify store specific Query annotations. This enables us to handle finder methods annotated with such store specific annotations in a generic way. Adjusted DefaultRepositoryInformation.getQueryMethods(…) to consider custom store specific query annotations.

Original pull request: #43.
2013-09-24 13:01:15 +02:00
Thomas Darimont
4849f32447 DATACMNS-366 - Test for SortHandlerMethodArgumentResolver and property lists.
Added test case to show SortHandlerMethodArgumentResolver can deal with property lists.

Original pull request: #45.
2013-09-23 15:16:51 +02:00
Thomas Darimont
2556bf7a4a DATACMNS-368 - Add test for PartTree properties that contain keyword sequences.
Added appropriate test to PartTreeUnitTests to check whether the regular expression in PartTree doesn't accidentally finds keywords in property expressions.
2013-09-23 15:08:49 +02:00
Oliver Gierke
7978cd24f2 DATACMNS-373 - Added formatting settings for IntelliJ IDEA.
Moved formatter files into etc folder.
2013-09-23 11:21:26 +02:00
Oliver Gierke
78b27d1bcd DATACMNS-363 - Revert support for unicode characters in in query method names.
This reverts commit f7679d41b8 as it introduced every Or in query method names to be considered a keyword.
2013-09-09 22:28:37 -07:00
Spring Buildmaster
0ce262e550 DATACMNS-315 - Prepare next development iteration. 2013-09-09 12:33:06 -07:00
Spring Buildmaster
f022ed57fb DATACMNS-315 - Release version 1.6.0.RELEASE. 2013-09-09 12:33:00 -07:00
Oliver Gierke
2136fa8cdf DATACMNS-315 - Prepare 1.6.0.RELEASE. 2013-09-09 12:27:13 -07:00
Thomas Darimont
f7679d41b8 DATACMNS-363 - Support unicode characters in in query method names.
Modified the regex for prefix_template and keyword_template in PartTree in order to support arbitrary unicode characters. Before that change we didn't support unicode correctly since we assumed that a character would have a lower and upper case representation which is often not the case, e.g. in chinese.

Original pull request: #41.
2013-09-08 17:21:22 -07:00
Thomas Darimont
8def493b23 Added Contributing section to readme.md 2013-08-27 14:27:32 +02:00
Oliver Gierke
77199cbec4 DATACMNS-358 - Test case for 1-index pages in PagedResourcesAssembler.
Added a test case to show that PagedResourcesAssembler correctly renders 1-indexed, empty pages after upgrading to Spring HATEOAS 0.8.0.BUILD-SNAPSHOT.
2013-08-26 18:30:34 +02:00
Oliver Gierke
1976878bd5 DATACMNS-362 - Resolved concurrency problem in Repositories.
We now create a copy of the keys before iterating over them in Repositories.getRepoInforFor(…) to make sure other threads can safely trigger lookupRepositoryFactoryInformationFor(…) which potentially alters the repositories instance variable. So far we haven't guarded against this scenario which caused a ConcurrentModificationException.
2013-08-26 18:29:04 +02:00
Thomas Darimont
0ed3fb774e DATACMNS-361 - Add a README.md file with project description.
Original pull request: #40.
2013-08-26 16:18:07 +02:00
Oliver Gierke
5ccb0bc9c2 DATACMNS-360 - Scanning for repository interfaces now considers active profiles.
The configuration entry points (RepositoryBeanDefinitionParser and RepositoryBeanDefinitionRegistrar) now hand the Environment they're running in forward into the infrastructure scanning for repositories. Thus it will correctly find or not find repository interfaces based on which profiles are activated or not.
2013-08-25 18:29:52 +02:00
Nick Williams
eb4b801dc9 DATACMNS-353 - Make Spring HATEOAS purely optional.
Extracted the implementation of UriComponentsContributor from PageableHandlerMethoArgumentResolver and SortHandlerMethodArgumentResolver into dedicated subclasses so that we can really make Spring HATEOAS an optional dependency.

The integration tests are now guarded with an assumption to run on Spring 3.2 as Spring 3.1 has issues with JavaConfig and configuration method overrides. We've upgraded to Spring Data Build 1.2 snapshots so that the tests can be run with -Pspring32. This effectively means that the Spring Data Web support can only be used with a current Spring 3.2. Added a note on that in the reference docs and JavaDoc of @EnableSpringDataWebSupport.

Original pull request: #39.
2013-08-22 08:14:58 +02:00
Oliver Gierke
9843447a58 DATACMNS-357 - Cleanups in primitive id detection.
Changed implementation in AbstractEntityInformation quite a bit to not need the non-final fields and a protected callback method. Cleaned up test cases to really test the new behavior, not the artificially introduced test helper class.

Original pull request: #37.
2013-08-14 09:38:43 +02:00
Nick Williams
98b8129a74 DATACMNS-357 - Added support for primitive ids in EntityInformation.
AbstractEntityInformation now detects primitive id types and adapts the isNew state according to the Java Language Specification §4.12.5. Supported are primitive Numbers and the entity is considered new if the value of the primitive field is zero.

Original pull request: #37.
2013-08-14 09:38:17 +02:00
Oliver Gierke
b059da8f4f DATACMNS-341 - RepositoryFactory(Bean)Support is now class loader aware.
Let both RepositoryFactorySupport and RepositoryFactoryBeanSupport implement BeanClassLoaderAware to pick up the ClassLoader used by the container. The latter class forwards the configured instance into the factory it creates.
2013-08-12 10:49:36 +02:00
Thomas Darimont
7b5bdd45e6 DATACMNS-304 - JavaDoc fix for PageableArgumentResolver.
The deprecation hint in PageableArgumentResolver now points to PageableHandlerMethodArgumentResolver.

Original pull request: #38.
2013-08-12 09:30:32 +02:00
Oliver Gierke
600a268adf DATACMNS-314 - Polished indentation in pom.xml. 2013-08-08 15:57:22 +02:00
Oliver Gierke
59a8cd5566 DATACMNS-352 - Aligned setter names for argument resolvers for Pageable and Sort.
PageableHandlerMethodArgumentResolver and SortHandlerMethodArgumentResolver now consistently use set*ParameterName(…) and setQualifierDelimiter(…) for configuration.

Added some more unit tests to verify invalid configuration get rejected.
2013-08-08 12:52:11 +02:00
Oliver Gierke
541ef648f1 DATACMNS-356 - Parameters now uses DefaultParameterNameDiscoverer if present.
We now leniently try to lookup DefaultParameterNameDiscoverer and create an instance of it to make use of Spring 4's improved parameter name capabilities on Java 8. We fall back on a LocalVariableTableParameterNameDiscoverer if on Spring versions prior to 4.
2013-08-07 14:39:37 +02:00
Oliver Gierke
04d6859354 DATACMNS-355 - ReflectionAuditingBeanWrapper now uses a ConversionService.
We're not manually converting the DateTime instance into the user field type but delegate to a ConversionService instance. This will allow us to automatically adhere to enhancements in conversion capabilities to the DefaultConversionService.
2013-08-07 13:48:19 +02:00
Thomas Darimont
a63a2bbd75 DATACMNS-351 - Add setFallbackSort(…) to SortHandlerMethodArgumentResolver.
SortHandlerMethodArgumentResolver now has a setFallbackSort(…) to be able to configure the Sort instance to be used if nothing can be resolved from the request and sort default is configured on the controller method.

Renamed name of getDefaults(…) method in SortHandlerMethodArgumentResolver to getDefaultFromAnnotationOrFallback(…) and refactored implementation to be more understandable.

Original pull request: #36
2013-08-07 12:29:05 +02:00
Spring Buildmaster
409b1f6008 DATACMNS-314 - Prepare next development iteration. 2013-08-01 07:51:16 -07:00
Spring Buildmaster
c27b8cdce8 DATACMNS-314 - Release version 1.6.0.RC1. 2013-08-01 07:51:11 -07:00
Oliver Gierke
f502c1fece DATACMNS-314 - Prepare 1.6.0.RC1 release.
Updated changelog, notice and readme. Upgraded to Spring Data Build parent 1.1.1.RELEASE.
2013-08-01 16:47:34 +02:00
Oliver Gierke
b8e457db9b DATACMNS-350 - Improved extensibility of Parameters.
Parameters is now a class explicitly designed for extension using generics. We provide a new DefaultParameters which is essentially a drop in replacement for former Parameters as it exposes individual Parameter instances.

Modules that previously extended Parameters will now have to implement the abstract factory methods exposed to create concrete - and potentially customized - Parameter instances.
2013-07-30 15:02:51 +02:00
Thomas Darimont
cc576a7398 DATACMNS-349 - Opened up SPI in DefaultTypeMapper to allow subclasses to resolve TypeAliases.
Added getAliasFor(TypeInformation) method in DefaultTypeMapper to allow subclasses to resolve TypeAliases.
2013-07-23 13:21:59 +02:00
Thomas Darimont
2afb570729 DATACMNS-345 - Use the actual type of the persistent property.
Changed getPersistentEntity(PersistentProperty<?>) to return the actual type of the persistent property in order to deal with collection and map types transparently.

Original pull request: #31.
2013-07-16 12:42:31 +02:00
Oliver Gierke
634789c3b7 DATACMNS-344 - Allow Repositories to work with non-CrudRepositories.
Introduced CrudMethods abstraction obtainable via a RepositoryInformation to inspect a repository for the presence of individual CRUD methods. The default implementation favors more special methods (e.g. the findAll(Pageable) over a simple findAll()). Introduced a CrudInvoker to be able to easily invoke findOne(…) and save(…) independently of whether the target methods are declared explicitly or inherited from CrudRepository.

Fixed some test case names to make sure they're executed during the Maven build.
2013-07-15 15:02:32 +02:00
Oliver Gierke
8a02b4ad6e DATACMNS-343 - PageableHandlerMethodArgumentResolver replaces pagination parameters now.
PageableHandlerMethodArgumentResolver now uses replaceQueryParam(…) to make sure the query parameters necessary for pagination don't accidentally get added multiple times.
2013-07-12 12:53:14 +02:00
Thomas Darimont
fc5ce662af DATACMNS-342 - Open up id property selection API in BasicPersistentEntity.
To support more advanced id property selection mechanisms we introduced a callback method returnPropertyIfBetterIdPropertyCandidate(…).

Pull request: #30.
2013-07-08 12:07:21 +02:00
Oliver Gierke
3a496b1f44 DATACMNS-337 - PersistentProperty now exposes getActualType().
The call transparently resolves map value types and collection component types if the property is either one of them.
2013-06-10 15:01:39 +02:00
Oliver Gierke
3f41810b86 DATACMNS-336 - Config classes backing @EnableSpringDataWebSupport are now public. 2013-06-10 14:12:42 +02:00
Oliver Gierke
15c4e34716 DATACMNS-335 - PageableHandlerMethodArgumentResolver now has configurable max page size.
The default is set to 2000.
2013-06-10 14:11:26 +02:00
Spring Buildmaster
2195e31493 DATACMNS-313 - Prepare next development iteration. 2013-05-31 10:14:33 -07:00
Spring Buildmaster
9702a4a409 DATACMNS-313 - Release version 1.6.0.M1. 2013-05-31 10:14:28 -07:00
Oliver Gierke
a7dfb9c27c DATACMNS-313 - Prepare 1.6.0.M1 release.
Upgraded to Spring Data Build 1.1.0.RELEASE, upgraded to Spring HATEOAS 0.6.0.RELEASE. Updated changelog.
2013-05-31 19:04:54 +02:00
Oliver Gierke
bd65718f30 DATACMNS-325 - Open up Slfj4 OSGi dependency to 1.6.0 to let STS work with it. 2013-05-31 13:48:58 +02:00
Oliver Gierke
5cd136dd56 DATACMNS-330, DATACMNS-331 - Documentation of new web support. 2013-05-31 12:03:33 +02:00