Commit Graph

702 Commits

Author SHA1 Message Date
Oliver Gierke
cdc84e45c8 DATACMNS-470 - Removed code deprecated in version 1.6.
Removed support for Jackson 1 based repository populators in favor of Jackson 2 based ones. Removed PageableArgumentResolver in favor of PageableHandlerMethodArgumentResolver. Removed legacy setup code of the new HandlerMethodArgumentResolver implementations.
2014-03-19 13:17:58 +01:00
Oliver Gierke
e9bcca11be DATACMNS-365 - Enhanced auditing subsystem to work with accessor annotations.
Added a MappingAuditableBeanWrapperFactory to be able to use themapping metamodel to lookup annotations on persistent properties. This propagates into AuditingHandler and IsNewAwareAuditingHandler getting new constructors taking a MappingContext to set themselves up correctly. This will probably need store specific updates in the setup of the auditing infrastructure for namespace implementations and annotation based JavaConfig.

Introduced ….getPersistentProperty(Class<? extends Annotation> annotationType) on PersistentEntity to be able to access properties with a given annotation.

Updated SonarGraph architecture description and moved auditing related config classes into auditing.config package.
2014-03-18 19:56:45 +01:00
Oliver Gierke
0e7a444aba DATACMNS-468 - Removed obsolete generics on BeanWrapper.
Some additional JavaDoc cleanups in BeanWrapper.
2014-03-18 14:33:07 +01:00
Oliver Gierke
6ba046dd0a DATACMNS-466 - More aggressive checks for the correct Spring version.
We now actively check that the a method in a Spring class we rely on to be public actually is public and throw an exception pointing to the offending JAR in an exception that's thrown otherwise.
2014-03-11 12:28:11 +01:00
Thomas Darimont
f6348a1bbe DATACMNS-437 - String representations should be locale independent.
We now use a fixed english locale for the rendering of toString() representations of Point objects.
2014-03-10 08:21:44 +01:00
Oliver Gierke
4c6afc5c30 DATACMNS-243 - Allow dedicated control over the access type for properties.
Introduced @AccessType annotation to allow user to control the way property values are accessed. The default is field access. Improved the property detection mechanism to also inspect all PropertyDescriptors not backed by a field and add them if property access is defined for the property or type. We also keep property accessors for interfaces as they strongly indicate property access to be used (as they cannot be field backed by definition).

The BeanWrapper doesn't take a useFieldAccess attribute anymore as the access type is solely derived from the given PersistentProperty now. AnnotationBasedPersistentProperty now also rejects properties with the very same annotation both on the field and on an accessor.
2014-03-07 14:30:23 +01:00
Oliver Gierke
4c5012f637 DATACMNS-437 - Polishing of newly introduced geo value objects.
Polished JavaDoc. Simplified equals(…) and hashCode() methods where possible. Added additional null checks where appropriate. Removed obsolete generics in Polygon and switched to an immutable collection for the Points making up the Polygon. Added missing toString() method to Polygon.
Added test cases for String representations.

Related pull request: #68.
2014-03-07 10:22:37 +01:00
Oliver Gierke
94db475afe DATACMNS-437 - Polishing of newly introduced geo value objects.
Polished JavaDoc. Simplified equals(…) and hashCode() methods where possible. Added additional null checks where appropriate. Removed obsolete generics in Polygon and switched to an immutable collection for the Points making up the Polygon.

Related pull request: #68.
2014-03-07 08:59:58 +01:00
Thomas Darimont
e4dfda29a3 DATACMNS-437 - Introduce reusable value objects for geo concepts.
Moved and retro-fitted the basic geo structures from SD MongoDB into SD Commons. This will serve as the foundation for more reusable geo spatial functionality in other SD modules. 

Adjusted equals methods to support subtypes in other SD modules. Added convenience constructor to Polygon. Renamed spanning points of Box to be first and second because some stores could have a different meaning of the spanning points. Changed radius field of circle to be a Distance (value + metric). Added additional mitigation constructor to Circle.

Original pull request: #68.
2014-03-07 08:59:23 +01:00
Oliver Gierke
c422f798a3 DATACMNS-465 - Polished template.mf. 2014-03-07 08:04:08 +01:00
Oliver Gierke
08d5f936c8 DATACMNS-452 - Added constructor to DirectFieldAccessFallbackBeanWrapper. 2014-03-06 19:27:53 +01:00
Oliver Gierke
4cdd178276 DATACMNS-464 - Transaction attribute lookup now considers target class as fallback.
In case of a standalone repository interface declaring CRUD methods manually we didn't inspect the invocation target method for transactional settings. That might be needed if e.g. a save(…) method is declared but not annotated at all.
2014-03-06 16:48:12 +01:00
Oliver Gierke
4f25a8da24 DATACMNS-448 - Added infrastructure for 'deleteBy' queries.
Add keywords 'delete' and 'remove' to PartTree indicating presence of delete intend.

Original pull request: #72.
2014-03-06 13:44:38 +01:00
Christoph Strobl
5d0f3b4b6d DATACMNS-448 - Added infrastructure for 'deleteBy' queries.
Add keywords 'delete' and 'remove' to PartTree indicating presence of delete intend.

Original pull request: #72.
2014-03-06 13:42:35 +01:00
Oliver Gierke
cc57d38b42 DATACMNS-462 - AbstractPersistentProperty considers collections and maps entities now.
Removed the rejecting check for collections and maps and solely rely on the evaluation of the actual type for the ….isEntity() decision in AbstractPersistentProperty. This will cause collection and map properties also being inspected for persistent types as soon as the owner type gets added to the mapping context.
2014-03-06 08:36:16 +01:00
Oliver Gierke
324cee8cf0 DATACMNS-461 - Refactorings in auditing configuration support.
Cleaned up configuration setup. AuditingBeanDefinitionRegistrarSupport now exposes a getAuditingHandlerBeanName() method to determine the bean name to be used for the AuditingHandler.
2014-03-05 19:10:32 +01:00
Michael Hunger
b5727d4bf2 DATACMNS-447 - Soften too strict strickt-check in MappingContext.
Previously we directly threw a MappingException in MappingContext.getPersistentEntity(TypeInformation) when the MappingContext was in strict mode and we were given a TypeInformation for which we didn't have a PersistentEntity already.

We now first check whether we should actually create a PersistentEntity for the given TypeInformation if no PersistentEntity is available, before throwing a  MappingException - if we should not then we simply return null (e.g. for simple types like Integer or Double).

Original pull requests: #66, #71.
2014-03-05 11:36:06 +01:00
Oliver Gierke
ae03feab42 DATACMNS-460 - Repository metadata now supports array return types for query methods.
Added array checks to AbstractRepositoryMetadata.getReturnedDomainClass() to detect array component types. QueryMethod now considers methods returning arrays to be collection query methods.
2014-03-05 08:29:35 +01:00
Oliver Gierke
1805aad718 DATACMNS-387 - Introduce Slice abstraction.
Introduced a Slice interface which is effectively a Page without the total page information. This will allow store modules to implement slice-by-slice access without having to calculate a total number of elements.

Extracted content and Pageable related functionality into a common Chunk class which serves as base class for the two concrete implementations SliceImpl and PageImpl. Deprecated hasNextPage() etc. on Page in favor of the generic hasNext() methods.

QueryMethod now exposes an isSliceQuery() to indicate a query method will need sliced execution.
2014-03-04 14:25:08 +01:00
Oliver Gierke
28dac21931 DATACMNS-456 - Added unit test for attribute to XML attribute name conversion. 2014-03-03 10:50:48 +01:00
Oliver Gierke
73d23dfedb DATACMNS-458 - Added PersistentEntities value object.
Introduced simple value object to hide a set of MappingContexts and be able to access PersistentEntities from them.
2014-03-02 08:39:32 +01:00
Oliver Gierke
4969b9094a DATACMNS-457 - MappingContext now provides information about managed types.
Added MappingContext.getManagedTypes() as well as ….hasPersistentEntity(Class) to access all types currently managed by the MappingContext and find out whether a type is managed by the context.
2014-03-01 12:37:23 +01:00
Oliver Gierke
2a8f4ddf93 DATACMNS-456 - Introduced getAttribute(String) on RepositoryConfigurationSupport.
RepositoryConfigurationSupport now has a getAttribute(String) method to lookup String attributes on XML elements and annotations. The XML implementation converts the given attribute name in a lower-case, dashed representation for the lookup.

RepositoryConfigurationExtensionSupport now ha a generic postProcess(…) method to allow implementations that only need to work with String attributes unify their customizations into that single method.
2014-03-01 12:18:44 +01:00
Oliver Gierke
6408e16faf DATACMNS-452 - Added some helper types to simplify the implementations in store modules.
Added AnnotatedTypeScanner to easily scan for annotated types within a set of base packages. Picks up interfaces by default which had to be customized when using ClassPathScanningCanidateComponentProvider.

Added DirectFieldAccessFallbackBeanWrapper that will use direct field access for beans in case no accessor method can be found. This allows to easily implement bean property values through accessors first but using the field directly if the accessors aren't available.

Introduced AnnotationDetectionMethodCallback to easily find methods equipped with a given annotation.
2014-02-27 08:36:00 +01:00
Fabian Buch
43d731f5ed DATACMNS-453 - Fix NPE in isPageableRepository() for Repositories without a findAll() method.
Added additional null check to isPagingRepository() to handle repository definitions that do not have a findAll method.

Original pull request: #69.
2014-02-26 15:13:34 +01:00
Oliver Gierke
3131ffbc5f DATACMNS-451 - Added custom CollectionFactory.
Added a Spring Data specific CollectionFactory that augments Spring's CollectionFactory with support for special collection types like EnumSet and EnumMap. For all other types we delegate to the wrapped class.
2014-02-26 05:12:23 +01:00
Spring Buildmaster
b41e337569 DATACMNS-443 - Prepare next development iteration. 2014-02-25 07:46:38 +01:00
Spring Buildmaster
a9fb7070c8 DATACMNS-443 - Release version 1.7.0.RELEASE. 2014-02-24 04:46:40 -08:00
Oliver Gierke
91e693b9da DATACMNS-443 - Prepare 1.7.0.RELEASE. 2014-02-24 13:10:02 +01:00
Oliver Gierke
ab37869a1a DATACMNS-446 - Added toString() methods to TypeInformation types. 2014-02-23 13:51:41 +01:00
Thomas Darimont
71169ca160 DATACMNS-445 - Documentation overhaul.
Updated links and vendor-information in readme. Updated author information. Fixed some typos, added ids to sections updated examples and descriptions. Added and referenced description of repository populator namespace element.

Original pull request: #65.
2014-02-21 13:39:22 +01:00
Oliver Gierke
4cee676608 DATACMNS-444 - DefaultPersistentPropertyPath now skips null converted names.
If a Converter handed into DefaultPersistentPropertyPath.toDotPath(…) returns null or an empty string for a mapped property name, that value is skipped during path construction.
2014-02-19 18:10:02 +01:00
Oliver Gierke
f089acb17e DATACMNS-442 - Improved documentation to mention @NoRepositoryBean. 2014-02-19 14:47:12 +01:00
Oliver Gierke
611c6194f4 DATACMNS-442 - Added test case to show that id resolution succeeds for intermediate repositories.
Adapted test case failing on Spring 4 due to eager RepositoryMetadata resolution.
2014-02-19 14:01:30 +01:00
Thomas Darimont
f047cce7c3 DATACMNS-441 - Fixed potential NullPointerException in query method detection on Java 8 compiled code.
We now skip bridge methods for query method processing in order to circumvent the changed behavior of Class#getMethods() in Java 8 (when the code was compiled with target byte code level 1.8). On Java 8 this results in bridge methods being found and inspected for query method annotations. Since we currently cannot analyze generic return types of bridge methods this results in NullPointerExceptions being thrown at a later stage in AbstractRepositoryMetadata#getReturnedDomainClass(…).

Original pull request: #64.
Related issue: DATAJPA-465.
2014-02-19 09:30:58 +01:00
Oliver Gierke
931a697ec5 DATACMNS-440 - Fixed map value type resolving for Map value types.
Previously the map value type resolving algorithm checked the value type to be of type Map again to shortcut the resolution. We now weakened this to an assignment check and eagerly resolve the generic type if its bound on exactly that level already. If no concrete type argument can be found, we fall back to the general generics resolution mechanism.
2014-02-13 12:06:26 +01:00
Oliver Gierke
20846809e1 DATACMNS-439 - AnnotationRepositoryConfigSource now evaluates REGEX and ASPECTJ filters.
We now leniently detect AspectJ and regular expression filters in an @Filter annotation in @Enable…Repositories annotations.
2014-02-12 12:18:24 +01:00
Oliver Gierke
d1faa7187d DATACMNS-432 - Fix regression in Repositories.
The changes in 899cf25 causes Repositories not finding any repository instances in case the lookup of beans by type for RepositoryFactoryInformation if the initialization causes as cyclic reference. Even worse, we might run into cases in which the attempt to access the beans by type causes transitive object creation which results in a successful lookup on a second attempt.

This is effectively caused by the catch-block in DefaultListableBeanFactory.getBeansOfType(…) which registers the suppressed exception as the method is used for lookup the beans for injection points with Lists and Maps.

We now explicitly look for bean names first and access the bean by name afterwards, which guarantees the exception to be thrown if it occurs. This will reveal the underlying issue and let user potentially deal with it. It's generally recommended to refer to Repositories in a very lazy fashion (using Provider<T>, ObjectFactory<T> or @Lazy on the injection point as of Spring 4) to avoid creating circular dependencies through by-type-lookups.
2014-02-12 10:24:37 +01:00
Oliver Gierke
1e3640e0ee DATACMNS-436 - Order.equals(…) / hashCode() / toString() now consider ignore case flag.
Extended equals(…), hashCode() and toString() methods t consider the ignore case flag held in an Order instance.
2014-02-06 18:13:54 +01:00
Thomas Darimont
899cf25330 DATACMNS-432 - Make Repositories effectively immutable.
We now eagerly populate the repository factory information in Repositories to provide a read only view on the discovered repository information. Previously lookup operations could also change some maps that held information about the until then discovered repository meta data which could lead to ConcurrentModifcationExceptions in multi-threaded environments. Since we don't allow any modification after construction this won't happen anymore.

We also cache the computed RepositoryMetadata in RepositoryFactoryBeanSupport.

Original pull request: #63.
2014-02-06 18:06:31 +01:00
Martin Baumgartner
d381b694fe DATACMNS-433 - Added Is prefix to Like keywords.
Like expressions are now also recognized if they're prefixed with Is. So both "IsLike" and "Like" are recognized as well as "NotLike" and "IsNotLike".
2014-02-06 16:37:39 +01:00
Oliver Gierke
fa80df2fa0 DATACMNS-425 - Upgrade to Spring Data Build snapshots. 2014-02-03 14:31:11 +01:00
Spring Buildmaster
1a94ffa796 DATACMNS-425 - Prepare next development iteration. 2014-01-29 04:24:57 -08:00
Spring Buildmaster
e00763bc44 DATACMNS-425 - Release version 1.7.0.RC1. 2014-01-29 04:24:55 -08:00
Oliver Gierke
8fa19aa01e DATACMNS-425 - Prepare 1.7.0.RC1 release.
Upgraded to Spring Data Build parent 1.3.0.RC1 and Spring HATEOAS 0.9.0.RELEASE. Switched to milestone repositories. Updated changelog and adapted notice.txt.
2014-01-28 13:24:18 +01:00
Oliver Gierke
8f0979e963 DATACMNS-431 - Code cleanups. 2014-01-28 13:14:35 +01:00
Oliver Gierke
30a63f5546 DATACMNS-418 - Added test case to show how to use custom element assembler. 2014-01-27 08:42:50 +01:00
Oliver Gierke
a16375bb17 DATACMNS-418 - PagedResourcesAssembler now exposes method to append template parameters.
PagedResourcesAssembler.appendPaginationParameterTemplates adds the currently missing pagination template variables to the given link.
2014-01-23 15:50:10 +01:00
Oliver Gierke
f1d49c6f37 DATACMNS-429 - Improved JavaDoc for PageRequest and Sort.
Added a few missing parameter documentations in terms of semantics and nullability.
2014-01-23 12:23:13 +01:00
Oliver Gierke
26c4f2dd87 DATACMNS-430 - Using Jackson version property from build parent.
Removed custom dependency from Spring 4 profile as it's already included in the parent pom.
2014-01-22 17:52:53 +01:00