DATAJPA-612 - Allow @EntityGraph on a method inherited from JpaRepository.

We now respect the @EntityGraph annotations on redeclared CRUD methods. CrudMethodMetadata now looks for @EntityGraph annotations, and - if present - the appropriate entity graph configuration is applied within SimpleJpaRepository.applyRepositoryMethodMetadata(…).

Previously we mistakenly treated the @EntityGraph annotation as a Query annotation which triggered a query resolution process that tried to find a named or create a derived query and failed. Removed @QueryAnnotation from @EntityGraph, since it should only be used to mark store specific @Query annotations.

Renamed Jpa21QueryCustomizer to Jpa21Utils. Moved Jpa21Utils to org.springframework.data.jpa.util to avoid potential dependency cycles.

Added EclipseLink and OpenJPA specific subclasses for the EntityGraphRepositoryMethodsIntegrationTests to make sure the tests are executed for EclipseLink and OpenJPA as well.

Original pull request: #109.
DATAJPA-617 - Avoid potential transaction rollbacks during named query lookups.

We now use a dedicated EntityManager for the named query lookup in NamedQuery.hasNamedQuery(…). Previously we used the given EntityManager to lookup the named query which will cause the transaction to be rolled back due to the Exception thrown in the case that the named query couldn't be found.

Added fast path to NamedQuery.lookupFrom(…) that now uses NamedQuery.hasNamedQuery(…) to test if a query exists or not. Pulled the check for the presence of a named count query from doCreateCountQuery(…) up to the NamedCountQuery constructor. This makes sure that the check is only performed once.

Original pull request: #110.
DATAJPA-619 - JpaPersistentPropertyImpl now considers JPA access definition annotations.

JpaPersistentPropertyImpl now looks up both Spring Data and JPA access type definition annotations from both property and type level. Property-level definitions trump type-level ones, Spring Data ones trump JPA ones if defined on the same level.

In support of DATAREST-269 to be able to work around id access issues when working with proxies created by JPA providers.

Related ticket: DATAREST-269.
DATAJPA-620 - Avoid potential infinite loop in CrudMethodMetadataPostProcessor.

We now use a ConcurrentHashMap for the metadata cache. Previously we just used an plain HashMap in a potential concurrent read / write situation which could lead to an infinite loop on put.

Original pull request: #111.
DATAJPA-477 - Avoid query creation in PagedExecution if count query returns 0.

We now skip the query creation if we detect that the preceding count query returned 0 or no results. Previously we always created a query in every case even if it was not necessary.

Original pull request: #113.
DATAJPA-605 - JpaPersistentProperty implementation now detects JPA's @Version annotation.

Added override for JpaPersistentPropertyImpl.isVersionProperty() to also consider properties annotated with JPA's @Version annotation as version property.

Related pull request: #108.
DATAJPA-623 - Fixed package cycles accidentally introduced.

Moved JpaEntityMetadata and DefaultJpaEntityMetadata to query package to avoid a cyclic dependency to it. Jpa21Utils now also resides in the query package as the util package must not depend on other project packages.

Updated the Sonargraph architecture description by adding new architectural artifacts for mapping, the CDI support and utilities. Defined allowed dependencies more strictly to detect architecture violations more aggressively.
DATAJPA-624 - Fix SonarQube warnings as far as possible/reasonable.

Added private constructor to Jpa21Utils to prevent instantiation. Removed unused parameter query in Querydsl.toOrderSpecifier(…). Inline currently unnecessary computeParameterValue(…) method in ParameterBinder. Return cached crudMethodMetadata instead of always creating and caching a new instance in CrudMethodMetadataPostProcessor. Removed unnecessary final modifier from DefaultCrudMethodMetadata. Introduced constant for error message in SimpleJpaRepository as well as for join alias group index in QueryUtils. Prevent instantiation of BeanDefinitionNames by making it an interface instead of a class.

Reduced the usage of EvaluationContextProvider in JpaQueryLookupStrategy implementation. Removed unnecessary fixed sized set initialization in JpaQueryMethod static initializer block. Made JpaResultConverters final since it is not meant to be sub-classed. Avoid potential unsafe reference based equality check in StringQuery/hasPosition(..). Removed dead store in ClasspathScanningPersistenceUnitPostProessor.scanForMappingFileLocations. Encapsulated access to fields in EntityManagerFactoryBeanDefinition.

Original pull request: #114.
DATAJPA-624 - Polished fixes for SonarQube warnings.

Added missing author tag in BeanDefinitionNames. Instead of providing an accessor for EvaluationContextProvider in AbstractQueryLookupStrategy we now only use the property in the type that actually needs it. Removed obsolete method in ParameterBinder. Polished formatting and JavaDoc in EntityManagerFactoryBeanDefinition.

Original pull request: #114.
DATAJPA-627 - Typo in BeanDefinitionNames.

Fixed bean name of jpaMa{ppp->pp}ingContext.

Original pull request: #117.
DATAJPA-630 - Add IdentifierAccessor implementation that avoids proxy resolution for id lookups.

We now customize the IdentifierAccessor returned from JpaPersistentEntity.getIdentifierAccessor(…) to allow the identifier lookup use persistence provider specific means. This is needed to make sure we lookup identifiers for proxies correctly for which a field value lookup would not succeed (as the providers do not pre-populate the identifier field).
DATAJPA-622 - AbstractPersistable.isNew() is now annotated with @Transient.

We now mark AbstractPersistable.isNew() property as @Transient for JPA in order to make sure that no JPA provider complains about a missing setter in case a user derives a domain entity from AbstractPersistable. Without this it isn't possible to bootstrap a PersistenceContext.

Original pull request: #115.
DATAJPA-622 - Polishing.

Renamed CustomAbstractPersistableIntergrationTests to AbstractPersistableIntergrationTests. Reordered declarations in persistence(2).xml to make sure we retain alphabetic sorting.

Original pull request: #115.
DATAJPA-628 - Use a shared SpelParser instead of recreating it.

We now use a shared SpelExpressionParser and propagate this through the String-based JpaRepositoryQuery implementations to avoid reinstantiations.

Cleaned up ParameterBinder inheritance hierarchy by merging (and removing) ExpressionAwareParameterBinder into SpelExpressionStringQueryParameterBinder.

Original pull request: #121.
DATAJPA-628 - Polishing.

Made central SpelExpressionParser static.

Original pull request: #121.
DATAJPA-631 - ResourceLoader improvements in ClasspathScanningPersistenceUnitPostProcessor.

A custom ResourceLoader configured on ClasspathScanningPersistenceUnitPostProcessor is now propagated to the ClassPathScanningCandidateComponentProvider used for looking up entity classes. We also forward the configured environment so that profile annotations are evaluated as well.

Related issue: DATACMNS-591.
DATAJPA-632 - Fix SimpleJpaQueryUnit test after cleanups in Spring Data Commons.

We now use a JpaQueryMethod instance rather than a mock as isPageQuery() cannot be mocked anymore as it has been made final.

Related issue: DATACMNS-601.
DATAJPA-634 - Switched to HTTPS for repository declarations.
DATAJPA-629 - Allow SpEL template expressions in combination with parameter expressions in @Query.

Previously SpEL template expressions like #{#entityName} could not be used in conjunction with parameter expressions in @Query because the SpEL template parser tried to evaluate the dynamic parameter expressions as well. We now mask the parameters prior to evaluating the SpEL template expression.

Original pull request: #122.
DATAJPA-606 - Improve handling of empty arrays and collections in query parameters.

Introduced potentiallyConvertEmptyCollection method to PersistenceProvider for provider specific handling of empty collections. Special handling is performed for Hibernate and EclipseLink. Conversion is performed in ParameterMetadata.prepare(…). Renamed ParameterMetadataProvider.accessor to bindableParameterValues.

Original pull request: #123.