Unified IsNewAware and IdAware to EntityMetadata. Refactored base repository support to use this abstraction. Introduced RepositoryMetadata and DefaultRepositoryMetadata implementation to capture all the additional information that we need around a repository interface. Adapted factory API to use this abstraction. Opened up method parameter and return types to prepare enabling the usage of the infrastructure for interfaces that do not extend Repository interface.
Lazily initializing the IsNewAware on first access now as classes implementing the method might wanna delegate to a template method using a constructor parameter. If createIsNewStrategy(…) is called from our constructor already the subclasses additional constructor arguments are not available yet.
Query method names now support Distinct in method name prefixes. Beyond that I laxed the prefix constraints a little so that it can potentially contain anything before a 'By' separator:
- findByLastname -> simply query
- findUsersByLastname -> simple query
- findUsersDistinctByFirstname -> distinct query
- findDistinctUsersByFirstname -> distinct query
- findDistinctByLastname -> distinct query
Extracted ParameterAccessor interface that uses a simple Iterator<Object> to traverse over bindable parameters. Renamed SimpleParameterAccessor to ParametersParameterAccessor to better reflect its specialty (improved JavaDoc according to this as well).
Moved registration of PersistenceExceptionTranslationPostProcessor into JPA module as registering it for all repositories creates an unnecessary burden to repository implementations that to not need external exception translation but rather do it themselves already.
As we will deal with data stores not supporting transactions we should not activate transactions by default. For persistence technologies providing transaction support there's TransactionalRepositoryFactoryBeanSupport now, which pretty much contains the functionality that formerly resided in RFBS.
Note this required changes in the namespace as well. Concrete persistence technology specific namespaces now have to choose between repository-attributes or transactional-repository-attributes attribute group whereas the latter contains the transaction-manager-ref attribute.
The newly introduced Property class allows to find nested property paths by splitting up the raw property name along its camel case parts and trying to find a valid property for the actual type we resolve the property in. Once one is found it will use the rest of the string and try to build nested properties from it.
As factory implementations might have to inspect the actual repository interface to select a concrete repository implementation, we have to hand the interface to the methods returning the class and returning the actual object.