Previously DomainClassConverter looked up the RepositoryInformation instances from the entire BeanFactory hierarchy but only looked the actual repository up from the current BeanFactory and not the entire hierarchy. Fixed and added test case.
In case a member class is not static the compiler will either create a constructor with a parameter of the enclosing type or alter the existing ones to add a first parameter of that type. Thus when instantiating the class we need to detect that case and hand in the parent object as parameter value.
Updated PreferredConstructor and Parameter abstractions to allow detecting this case as well as the ParameterValueProvider abstraction to capture the parent object.
DomainClassConverter now registers itself with the ConversionService handed into it. Added integration tests for lookup of RepositoryFactoryInformation.
PersistentEntity now has a isConstructorArgument(…) allowing to find out whether a PersistentProperty is referred to from a constructor argument. The PreferredConstructor abstraction now keeps track of the PersistentEntity it is built for and thus allows finding out whether a constructor Parameter maps a PersistentProperty.
Removed bean creation responsibility from BeanWrapper and introduced EntityInstantiator abstraction to allow the entity instantiation mechanism be short circuited via custom implementations. The reflection based implementation from BeanWrapper is now residing in ReflectionEntityInstantiator.
Fixed edge case scenario where the lookup for repository implementation classes picked up multiple classes if they ended with the same suffix (e.g. FooRepoImpl, AnotherFooRepoImpl). We're now expecting the classname to be an exact match but still allow nested packages. Changed the parser to reject multiple found implementation classes strictly now to at least avoid undiscoverable errors in case an ambiguity is popping up.
Added custom CDI extension to use repositories in a CDI environment. Base class picks up all Spring Data repository interfaces and allows working with qualifiers to bind beans to be created to qualifiers.
Introduced @ReadingConverter and @WritingConverter to allow to resolve disambiguates that might arise when implementing custom Converters.
Suppose we implemented a Converter<String, Class> and the store is able to handle both String and Class as native types. In this case there's no way to determine whether the converter shall actually be used to convert String properties into Class instances when writing or to create Class instances from Strings when reading. Thus the @ReadingConverter comes in handy in this case to tell the infrastructure to consider the converter for reading only.
Documented verify() to throw a MappingException in case verification fails. Let this exception flying cause the PersistentEntity already added to the cache be removed from it in turn.
Fixed execution of integration tests and tests in classes starting with Abstract* along the way. Upgraded to Mockito 1.8.5.
ClassTypeInformation now holds a cache for Class<?> to TypeInformation<?> mappings. It also exposes constants for Object, Collection, Set, List and Map TypeInformations.
The former getNestedTypeToAdd(…) method in AbstractMappingContext is now located in PersistentProperty to allow easier customization of the implementation. We also not only support returning one type from it but rather an Iterable of them to prepare handling of custom types implementing Collection interfaces.
Removing Number from SimpleTypeHolder's default Set of types results in
Number sub-types not explicitly listed not being considered as simple
by default.
Fixed SimpleTypeHolder.isSimpleType(Class<?> type) for calls where the Class object handed in is derived from an Enum that implements an abstract method. These Class objects return false for a call to isEnum(). So an ….isAssignableFrom(…) check is safer.
Refactored the definition of what domain class is returned from a query method into a common AbstractRepositoryMetadata and moved ClassUtils.getReturnedDomainClass into RepositoryMetadata. Moved test cases accordingly. Added getReturnType(Method method) to TypeInformation.
PersistentPropertyPath got a few new methods to build String representations of it. Beyond that we introduced accessor methods for the base and leaf path as well as the ability to detect base paths and create path extensions based on a given base path.
Refactored MappingContext.getPersistentPropertyPath(…) to return a PersistentPropertyPath instance which allows iterating over the properties returned for the Property delivered as well as creating dot paths from it.
Renamed Property to PropertyPath and moved it into mapping package.
Always setting a transaction manager breaks repository factories that do not expose a transactionManager property. Thus it's now the responsibility of the concrete BeanDefinitionParser to parse transaction manager configuration.
Setting a default transaction manager bean name increases performance of transaction interception as we can lookup the PlatformTransactionManager by name rather than by type.
ConcurrentHashMap does not allow null values to be set so we now store Void.class as custom null-value instead and default this value back to null in predictBeanType(…).