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.
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.
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.
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.
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.
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.
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.
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.
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.
Cleaned up configuration setup. AuditingBeanDefinitionRegistrarSupport now exposes a getAuditingHandlerBeanName() method to determine the bean name to be used for the AuditingHandler.
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.
Added array checks to AbstractRepositoryMetadata.getReturnedDomainClass() to detect array component types. QueryMethod now considers methods returning arrays to be collection query methods.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Changed Hateoas(Pageable|Sort)HandlerMethodArgumentResolver to use newly introduced TypeVariables abstraction to avoid having to deal with string representations manually.
The registered TemplateVariables carry a "pagination.….description" key to be resolved against a MessageSource.
Moved getCrudMethods() to RepositoryMetadata to be able to add a isPagingRepository() to the interface as well. Changed DefaultCrudMethods to work with a RepositoryMetadata instead of RepositoryInformation.
DefaultRepositoryInformation now completely delegates to the ResourceMetadata given and not extend it to avoid initialization order issues.