Extended the mechanism previously existing to detect @Lock annotations on redeclared CRUD methods into one being able to transport arbitrary metadata into the execution of CRUD methods.
Renamed LockModeRepositoryPostProcessor to CrudMethodMetadataPostProcessor, refactored the internals and added some metadata caching to avoid repeated reflection lookups to evaluate annotations.
Replaced custom left join generation logic with default Querydsl mechanisms including support for ordering by arbitrarily nested property paths. Added test cases that demonstrate ordering by nested association paths (>= 2 levels). Added additional test cases for sort by nested property path expressions based on querydsl meta model and plain string based path expressions.
Original pull request: #65.
template.mf now contains an explicit Import-Package directive to make sure the relevant packages for the auditing functionality can be resolved in an OSGi environment. This hadn't been the case before as we don't explicitly refer to some classes necessary (mostly to prevent class loading errors in IDEs). The explicit declarations make sure the relevant Import-Package declarations are added even if Bundlor doesn't find any types that would explicitly require the imports.
JpaAuditingRegistrar now also explicitly hints to the class not being visible in case of auditing setup errors.
Original pull request: #62.
Changed the implementation of SimpleJpaRepository.findAll(Iterable<ID>) as OpenJPA still doesn't correctly bind in-clauses by name. This has been originally reported in [0] and marked fixed for 2.3.0 but even an upgrade to this version (coming in a subsequent commit) requires the workaround.
[0] https://issues.apache.org/jira/browse/OPENJPA-2018
This works as expected with 3.6.10, 4.2.10, 4.3.4 but fails with 4.1.12.
Added test case to verify and track the issue with Hibernate 4.1.x. Renamed test-class from DataJpa269RepositoryWithCompositeKeyTests to RepositoryWithCompositeKeyTests.
Original pull request: #61.
Added support for Slice as return type for query methods. The execution will expand the requested page size by one to read one more element than actually requested. If that additional element is returned, it will considered to be an indicator for whether a next slice is available.
Related issues: DATACMNS-397.
Hibernate invalidly returns null for getModel() on its PluralAttribute implementation which causes the necessity for joins not having been detected previously.
We now fall back to joining in case we don't find a Model and deal with a PluralAttribute.
Instead of creating an individual instance of JpaMetamodelMappingContext per repository we now register a unique instance with access to the metamodel of the EntityManager the repositories use under "jpaMappingContext".
Weakened the contract in JpaPersistentEntityImpl to allow multiple @Id properties (in case @IdClass is used). The mapping context now also allows looking up of embeddable types as they're considered entities in the context of Spring Data mapping metadata.
When a parameter was listed with parentheses we didn't detect a custom binding and fell back to the standard binding. This effectively disabled the array-to-collection binding which is currently necessary for in bindings as some persistence providers do not bind arrays to in-clauses correctly.
Tweaked the regular expression to detect the bindings to accept the optional parentheses.
Update urls to point to spring.io. Added missing id tag to documentation sections. Fix some typos in reference manual. Update readme.md to use consistent set of database and dialect. Add missing end tag for 'para' in FAQ section. Update authors for proper rendering in PDF. Added productname tag. Added links to Stack Overflow.
Original pull request: #59.
Previously, the reference documentation was missing details of how to set up EntityManager instances for usage of Spring Data JPA repositories in a CDI context. Augmented the section on complete manual setup but also added an example of the necessary setup in a pure JavaEE context.
Query parameter binding replacements were undone if a simple binding was contained in the query. Fixed that and also make sure we don't create superfluous multiple bindings for the same variable and binding type.
We now always create a ParameterBinding for all parameters to simplify the client code so that it can safely always lookup bindings and apply them.
Changed the setup of the regular expression to work with the keywords provided by the binding types to ease future extensions.
Added integration test to quickly verify the EclipseLink bug we're running into now for further reference.
Original pull request: #56.
Enhanced binding of parameters in StringQueryParameterBinder to be able to deal with situations where a parameter value has to be converted to be correctly bound e.g. for parameter values in IN-expressions.
We now only convert array values to collections if the value is to be bound in the context of an IN-parameter. Previously we erroneously always converted an array value to a collection value which lead to problems if an array value was meant to be used "as-is" e.g. in cases where an user wants to query for a certain byte[].
Original pull request: #56.
QueryUtils now only creates a join for collection properties that are explicitly annotated with an @ManyTo… annotation. This allows collection like properties like byte[] be referred to as non-collection property and thus not trigger a join when a derived query is created.
Upgraded to Spring Data build parent 1.3 RC1 and Spring Data Commons 1.7 RC1. Updated changelog and references from reference documentation. Switched to milestone repository.
The AuditingBeanFactoryPostProcessor and EntityManagerBeanDefinitionPostProcessor now correctly lookup BeanDefinitions within BeanFactory hierarchies. Also, the EMBDPP registers the EntityManager bean definition in the BeanFactory, the source BeanDefinition for the EntityManagerFactory is found.
Enabling repositories now registers a BeanFactoryPostProcessor that will register a SharedEntityManagerCreator BeanDefinition for all EntityManagerFactory definitions available in the ApplicationContext.
We register the bean name of the EMF as qualifier for the BeanDefinition for the EntityManager to allow an explicit reference in multi-EMF scenarios.
Renamed default persistence unit to spring-data-jpa.
Accessing the legacy persistence provider class in Hibernate 4.3 causes a warning being logged. As we generally want to detect the presence of Hibernate in general only, we now check for the Hibernate 4.3 persistence provider interface first to immediately find the new interface and thus avoid the warning.
Upgraded to Hibernate 4.3.1.
Was able to upgrade to EclipseLink 2.5.1 and re-enable a previously ignored integration tests. However, some of the disabled test cases still fail despite the relevant bug being reported as fixed in 2.5.1.
Turned the workaround in QueryUtils into a TODO for removal as we don't want to strongly force EclipseLink users to upgrade to 2.5.x yet.
From the CDI extension we now use the callback newly introduced in Spring Data Commons to enable it to trigger eager initialization.
See also: DATACMNS-416.
Since the location of the Hibernate EntityManager implementation changed in Hibernate 4.3 to org.hibernate.jpa.HibernateEntityManager, we now support org.hibernate.jpa.HibernateEntityManager as well as org.hibernate.ejb.HibernateEntityManager as a Hibernate PersistenceProvider.
Original pull request: #55.