Commit Graph

627 Commits

Author SHA1 Message Date
Thomas Darimont
f2ff84fb63 DATACMNS-402 - Add support for sorting by a QueryDSL OrderSpecifier.
Previously we did only support ordering by a string or property path through Sort. In order to be able to express more type safe ordering expressions we introduce QSort as a subclass of Sort that is able to wrap QueryDSL OrderSpecifiers. To be able to separate the concerns of sorting via QueryDSL expressions better we introduce the AbstractPageRequest base class and QPageRequest as a special implementation that accepts a QSort or OrderSpecifiers for ordering.

Original pull request: #59.
2013-12-04 13:09:25 +01:00
Oliver Gierke
9f65b57867 DATACMNS-406 - Polishing.
Refactored code in RepositoryMetadata implementations to avoid compiler warnings. Some JavaDoc polishing.

Original pull request: #58.
2013-11-21 12:39:32 +01:00
Thomas Darimont
b96f613b98 DATACMNS-406 - Tighten contract for RepositoryMetadata implementations.
We now resolve the domain and id-types eagerly within the constructor of AbstractRepositoryMetadata implementations to prevent a RepositoryMetadata instance to be created in an invalid state. Pulled-up repositoryInterface property to AbstractRepositoryMetadata.

Original pull request: #58.
2013-11-21 12:39:17 +01:00
Spring Buildmaster
09b8989a7f DATACMNS-403 - Prepare next development iteration. 2013-11-19 03:53:05 -08:00
Spring Buildmaster
0abed479e7 DATACMNS-403 - Release version 1.7.0.M1. 2013-11-19 03:53:03 -08:00
Thomas Darimont
341912acec DATACMNS-403 - Prepare release 1.7 M1.
Updated release metadata and bumped versions.
2013-11-19 12:48:42 +01:00
Thomas Darimont
eddb3323de DATACMNS-399 - Support query prefix to designate repository query methods.
Extended PREFIX regex in PartTree to support the "query" prefix.

Original author: @jiming
Original pull request: #56.
2013-11-19 12:26:11 +01:00
Thomas Darimont
ba89dc9bb4 DATACMNS-404 - Move formatter configuration to Spring Data Build project.
Original pull request: #57.
2013-11-19 11:39:14 +01:00
Oliver Gierke
c0fc0f905a DATACMNS-401 - Some cleanups regarding generics and deprecations.
Suppress deprecation warnings for GenericTypeResolver for now. Added Simple(Property|Association)Handler to ease working with untyped PersistentProperty instances without having to fall back to raw types. Polished Sonargraph architecture description.
2013-11-14 09:28:11 +00:00
Oliver Gierke
fed61720b0 DATACMNS-400 - PersistentProperty now exposes findAnnotation(…).
Pulled up the method declaration from AnnotationBasedProperty as it's useful to be able to inspect a property for annotations being configured on it independently from whether the persistent mapping of it has been defined via annotations or not.

Expose isAnnotationPresent(…) as well to ease quick checks for an annotation.
2013-11-13 18:09:28 +00:00
Oliver Gierke
22223f4386 DATACMNS-393 - Improved CRUD method detection in DefaultCrudMethods.
Slightly refined the detection algorithm to favor early returns and thus avoid unnecessary reflection lookups.

Original pull request: #55.
2013-11-12 15:07:55 +01:00
Thomas Darimont
907ea74d8a DATACMNS-393 - Improved CRUD method detection in DefaultCrudMethods.
The detection of CRUD methods in DefaultCrudMethods is now carried out in a more robust and predictable fashion. The exact algorithm is described in the JavaDoc.

Original pull request: #55.
2013-11-12 15:07:55 +01:00
Oliver Gierke
5a6cefc4a9 DATACMNS-389 - RepositoryFactorySupport now caches RepositoryInformation.
Instead of creating a new DefaultRepositoryInformation for each call to getRepositoryInformation(…) we now actively cache the created instances per repository type and custom implementation class.
2013-11-12 15:03:24 +01:00
Oliver Gierke
d7b0a3e4d4 DATACMNS-392, DATACMNS-386 - Polished code after upgrade to Spring 3.2.5.
Spring 3.2.5 made AnnotationConfigUtils.processCommonDefinitionAnnotations(…) public so that we can call it directly instead of invoking it via reflection.
2013-11-12 13:15:52 +01:00
Oliver Gierke
a438d1ef17 DATACMNS-389 - Polishing of @Enable…Auditing support.
JavaDoc and assertion fixes.

Original pull requests: #26, #53.
2013-11-11 20:04:52 +01:00
Thomas Darimont
a7d909846c DATACMNS-389 - Support for JavaConfig in auditing.
Basic infrastructure for supporting annotation based auditing configuration.

Introduces AuditingBeanDefinitionRegistrarSupport for store specific auditing configuration enhancements. An AuditorAware instance is wired into the Auditing handler automatically if it's present in the ApplicationContext. The auditorAwareRef attribute of the enabling annotation can be used to disambiguate in case multiple AuditorAware instances are present in the configuration.

Original pull requests: #26, #53.
2013-11-11 20:04:40 +01:00
Oliver Gierke
e616ec5d05 DATACMNS-392 - Support for eager repository instantiation.
Changed the initialization of repositories to default to eager with the ability to explicitly defer instantiation using @Lazy on the repository interface definition. In practice, the change in default shouldn't make any difference to most client projects as repositories are usually depended on by other application components so that the repositories never stay uninitialized.
2013-11-05 16:22:16 +01:00
Oliver Gierke
d26f90b281 DATACMNS-390 - Create defensive copy for persistent entities in AbstractMappingContext.
To prevent ConcurrentModificationExceptions when iterating over PersistentEntities while further entity types are potentially added to the MappingContext we now return a immutable defensive copy of the current entity set.
2013-11-04 11:03:49 +01:00
Oliver Gierke
057c2e9bf8 DATACMNS-384 - Polished toString() representation of Version.
Trailing zeros now get removed up until the minor version number.
2013-11-04 11:02:50 +01:00
Oliver Gierke
9b077890b4 DATACMNS-391 - Mitigate changes between Spring 3 and 4' GenericTypeResolver.
As of Spring 4, the GenericTypeResolver is more consistent in detecting raw types. It now returns null for both resolveTypeArguments(Set.class, Set.class) as well as resolveTypeArguments(Set.class, Iterable.class). The latter returns an array of Object.class in 3.x.

As this shouldn't make a pratical difference to actual clients (as they need to check for null anyway, we loosen the test case to be able to build Spring Data Commons against both Spring 3 and Spring 4.

Some polishing in the version detection in integration tests. Moved the Servlet 3.0 dependency into the Spring 4 profile.
2013-11-01 09:34:32 +00:00
Thomas Darimont
c34983b22b DATACMNS-391 - Ensure compatibility with Spring Framework 4.0.
Some tests required an explicit dependency to servlet-api-3.x.
The GenericApplicationContext doesn't refresh automatically in Spring 4.x we thus we have to call refresh manually. Added a specific version of populators.xml for Spring 4.x since the jaxb2-marshaller element definition no longer renamed the contextPath attribute to context-path in 4.x.

Original pull request: #52.
2013-11-01 09:30:34 +00:00
Ben Hale
3a7acf29d7 DATACMNS-388 - Improve declaration of PagedResourceAssembler in JavaConfig.
Based on the discussion in SPR-11004 [0], the declaration of the PagedResourcesAssembler in HateoasAwareSpringDataWebConfiguration will not result in it being autowired using Spring 4.0 in certain circumstances.  This change loosens the declaration so that it can be autowired into declarations that have specific generics declarations.

Original pull request: #51.

[1]: https://jira.springsource.org/browse/SPR-11004
2013-10-27 16:49:50 +01:00
Oliver Gierke
ae9ee5b428 DATACMNS-387 - Improvements in null handling in PartTree area.
We're now rejecting invalid constructor arguments handed to ClassTypeInformation, Part, PartTree and PropertyPath. Beyond that we skip the creation of a Part for an empty path segment, so that you don't end up with an invalid Part instance for a findAllByOrderByFooAsc.
2013-10-27 16:34:26 +01:00
Oliver Gierke
1624fec11a DATACMNS-386 - Upgraded to Spring Framework 3.2.4.
Upgraded to Spring Data Build 1.3.0.BUILD-SNAPSHOT to benefit from upgrade to Spring 3.2.4.
2013-10-25 19:31:35 +02:00
Oliver Gierke
8e9b4f78a0 DATACMNS-385 - Fixed repository method matching for iterable entities.
When matching the save(Iterable<T>) method of CrudRepository for an entity implementing Iterable we accidentally determined CrudRepository.save(T) as target method if the entity type under consideration implements Iterable.

We now explicitly check for the parameter type not being Iterable when matching the domain type generics in matchesGenericType(…).
2013-10-23 18:35:34 +02:00
Thomas Darimont
55be70d911 DATACMNS-90 - Support old EnableXXXRepository annotations that do not yet allow to configure the handling of nested repositories.
Previously a call to attributes.getBoolean(…) resulted in a NPE if a EnableXXXRepository annotation of a store (Neo4J in that case ) did not have the required property yet. With the added check we are safe again.
2013-10-23 01:35:14 +02:00
Oliver Gierke
1dfe235a87 DATACMNS-90 - Polishing.
Added missing author tags where needed. Removed the template method to pick up the configuration from the RepositoryConfigurationSource interface as it's not needed from the outside.

Original pull request: #50.
2013-10-22 14:11:28 +02:00
Thomas Darimont
60534974bf DATACMNS-90 - Allow Repository namespace handler to be configured to scan for inner class repositories.
We now optionally consider nested repository interfaces defined as inner-classes. This can be configured by setting the considerNestedRepositories property on EnableXXXRepository annotations or the consider-nested-repositories attribute to true - it defaults to false.

Original pull request: #50.
2013-10-22 14:11:19 +02:00
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