Extracted SpelExpressionParameterValueProvider from PersistentEntityParameterValueProvider to allow extension to recursively map the value resolved from the SpEL expression evaluation. This extension has to override the potentiallyConvertSpelValue(…) method to continue nested conversion.
So far, PropertyPath inevitably uncapitalized the property names it was created for. We now check, whether the source name is all uppercase and prevent uncapitalization in this case.
Extended RepositoryFactoryInformation to expose the PersistentEntity for the domain type the repository factory is eventually creating the repository for. The default implementation in RepositoryFactoryBeanSupport exposes a protected setMappingContext(…) that is later used to lookup the PersistentEntity.
Added attribute group to namespace XSD to define common attributes used to set up an AuditingHandler. Added BeanDefinitionParser that will create a BeanDefinition for an AuditingHandler based on these properties. Store-specific namespace implementations can use that to simplify the configuration setup. Added an IsNewAwareAuditingHandlerBeanDefinitionParser to do the same for an IsNewAwareAuditingHandler.
Introduced IsNewStrategy and IsNewStrategyFactory interfaces to allow abstracting the way the is-new state of an entity can be determined. The factory allows creating a strategy instance by inspected type, whereas the actual strategy then implements the is-new decision based on a given entity.
We provide a MappingContext based factory implementation that looks up a PersistentEntity for the type requested and inspects it for an @Version or @Id property. It will then return strategy implementations that inspect the detected properties and check their values against null or 0 respectively. We also add a CachingIsNewStrategyFactory wrapper to prevent the lookup of the actual strategy from being done over and over again.
The @Version annotation was pulled up from the Spring Data MongoDB module. It can be used as meta annotation to allow a deprecation step on the MongoDB's @Version one.
Added an IsNewAwareAuditingHandler that exposes a unifying markAudited(…) delegating to the markCreated(…) and markModified(…) depending on the outcome of the IsNewStrategy.
Introduced annotations CreatedBy, CreatedDate, LastModifiedBy and LastModifiedDate to allow demarcating fields as auditing related ones. The date related annotations require a field type of either DateTime, Date, Long or a primitive long. All these annotations can be used as meta-annotations.
Extracted an AuditingHandler from Spring Data JPA which allows to transparently set auditing information on objects implementing Auditable or use the newly introduced annotations in a store independent manner. This allows other stores to implement adapters to provide auditing support as well.
Introduced a more convenient way of finding fields in ReflectionUtils using the FieldFilters of core Spring. The API allows to select fields based on a filter and can transparently check that only one field matches the given filter if desired.
RepositoryBeanDefinitionRegistrarSupport not implements BeanClassLoaderAware and ResourceLoaderAware as Spring 3.2 will regard these callback interfaces and inject the resources. We still default these injected resources upon invocation to be able to run on Spring 3.1 as well.
The bean name is now resolved through inspecting Spring stereotype annotations and @Named on the repository interface. If none found we're still using the uncapitalized simple interface name as we did until now.
Switched from implementing ApplicationEventPublisherAware to ApplicationContextAware to get a reference to an ApplicationContext to fix comparison of the event source.
Improved/fixed JavaDoc. Made orders property final. Fixed formatting here and there. Deprecated Order.create(…) factory method as new Sort(…) can be used instead.
Refactored persistent field discovery by extracting the FieldFilter implementation and improving the way excluded fields are detected. We now exclude all fields named "this$*" as well as a metaClass field of type groovy.lang.MetaClass explicitly.
The ResourceReaderRepositoryPopulator now throws an RepositoriesPopulatedEvent after the population was finished. This indicates the data provided through the resources having been inserted into the database and the repository setup (including population) being completed.
Separated ConfigurableTypeInformationMapper from MappingContextTypeInformationMapper. The latter now lazily picks up the alias information if the cached values do not contain aliases.
Polished JavaDocs and clarified meaning of null values.
Before actually adding a type as PersistentEntity, AbstractMappingContext will call shouldCreatePersistentEntityFor(TypeInformation<?> type) now. The default implementation will just consider the SimpleTypeHolder for that decision. However as adding a Converter to the context will render the converted object to be treated as simple, one might want to override this method to be more precise and only rule out store-specific simple types at this stage.
ClassTypeInformation does not resolve nested array types anymore as a multidimensional array in fact has a component type of an array of one dimension less, e.g. String[][].getComponentType() -> String[].
There have been a few dependencies which we depended on on compile time but which were pulled into the classpath transitively. Declaring these dependencies now explicitly. Keeping them optional to allow minimal footprint.
Merged mapping.context and mapping.event packages. Moved MappingContext event into context package. Updated Sonargraph architecture description and completed package and dependency mapping.
If an @EnableRepository annotation does not carry an @Inherited annotation and the annotation is used in a JavaConfig inheritance scenario the ImportBeanDefinitionRegistrar gets invoked without the annotation metadata available. The RepositoryBeanDefinitionRegistrarSupport now guards against that case and will not invoke registration of repository bean definitions. It's strongly recommended to equip @EnableRepository annotations with @Inherited to accommodate this scenario.
Added guards to PropertyDescriptor access to prevent NullPointerExceptions in cases it is not given in the first place. Polished JavaDoc for test case.