Algorithm is now was follows:
1. If there's no explicit constructor use the default constructor.
2. If there's a single explicit constructor, use this one.
3. If there's multiple explicit constructors and one has been annotated with @PersistenceConstructor use the annotated one.
4. If there's multiple explicit constructors and none annotated use the no-arg one or throw an exception to resolve the ambiguity.
Test cases for that algorithm are located in PreferredConstructorDiscovererUnitTests. Refactored PreferredConstructor and Parameter classes a little to make them immutable value objects. Introduced ability to lookup parameter TypeInformation for constructors on TypeInformation interface.
Extended generics in mapping subsystem to allow defining a concrete subtype of PersistentProperty as well. Removed some generics related compiler warnings as well.
Unfortunately the beta version numbers of Querydsl are not OSGi compatible so that we have to maintain the version number in template.mf manually. Updated version of APT Maven plugin to 1.0.1.
Refactored BasicMappingContext into AbstractMappingContext that now only contains the general algorithm to build PersistentEntity and PersistentProperty instances. The algorithm delegates to two template methods that are responsible for instantiating concrete implementations of those classes.
Extracted an AnnotationBasedPersistentProperty that now contains all annotation references so that AbstractPersistentEntity does not take annotations into account in the first places. BasicPersistentEntity now does PreferredConstructor lookup as well.
Removed unnecessary methods from MappingCOntext and PersistentEntity interface. Added a verify() method to BasicPersistentEntity that AbstractMappingContext calls to verify validity of the entity. This will be used by the Mongo module for example to make sure @Document annotated entities have an @Id property.
Refactored getValueAnnotation() to getSpelExpression() to not imply we're using annotations in every case.
Added shortcut in TypeDiscoverer.createInfo(…) to prevent endless loop in case a type has a field of it's very same type.
TypeDiscoverer now returns the plain compound type for arrays now, which means you get String for String[], String[][] and so on. Opened up signature of AbstractMappingContext.setInitialEntitySet(…) to allow effortless programatic invocation.
Extracted basic information from RepositoryInformation into RepositoryMetadata to limit the amount of API being exposed to RepositoryFactorySupport implementations. getRepositoryBaseClass(…) can thus now take a RepositoryMetadata.
Method is not abstract anymore but rather returns null by default. Adapted QueryExecutionMethodInterceptor to handle the null case appropriately by simply skipping the query lookup. It also throws an exception if the repository has query methods defined nonetheless to prevent exceptions at runtime.
Moved MappingConfigurationBuilder functionality into BasicMappingContext. Got rid of obsolete methods in MappingContext, PersistentEntity and PersistentProperty to minimize the API exposed.
Re-added a initialEntitySet property to BasicMappingContext and let trigger adding those to the context in afterPropertiesSet(). Moved createPersistentEntity and createPersistentProperty methods from MappingConfigurationBuilder into BasicMappingContext (could probably be done for all of those methods still in MCB).
Opened up getPersistentEntites() in MappingContext interface to return Collection<? extends PersistentEntity> to allow easy overriding in subclasses with more specific types.