Back port of the fix for DATAJPA-664 to make sure interface types can be used for associations. This broke in the Dijkstra/Evans train due to the fix in DATACMNS-479 and now most recently pops up in the use of Maps with interfaces as values.
Related tickets: DATAJPA-664, DATACMNS-479.
We now use an improved regular expression to detect identifier clauses in JPQL queries to be able to derive count queries for queries that use non-ASCII characters in entity names.
We now not only detect alias in left (outer) joins but basically all of them to find out whether or not to prefix sort expressions with the root alias.
Added new ….and(…) methods to JpaSort to take a Direction and Paths or Attributes to allow more concise definition of additional orders.
Slightly changed the method signature for methods on Path taking a Plural attribute to satisfy the compiler.
Slightly refactored general infrastructure integration tests to make sure they're executed during the build. Added neccesary ignores to prevent the test cases from running into spec violations.
SimpleJpaRepository.count(Specification) now uses QueryUtils.executeCountQuery(…) to make sure we correctly treat Specifications with group-by clauses.
Spring 4.1.3 introduces a regression in the way transaction managers are detected if multiple ones are available. This can be worked around my marking the default transaction manager as primary which is what we do for our tests now.
Related issue: SPR-12577.
We now support an Iterable of composite primary keys to be passed to findAll(…). Note that since there is no direct support in JPA to perform this query we have to execute a entityManager.find(…) query for every given id, which could lead to performance problems - use with care!
Original pull request: #127.
Specifications now implements Serializable to be able to transfer them across systems boundaries. Introduced special Serializable Specification types for composed and negated Specifications.
Note that currently only Hibernate and EclipseLink expression structures implement Serializable - OpenJPA's don't.
Original pull request: #86.
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.
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.
Renamed CustomAbstractPersistableIntergrationTests to AbstractPersistableIntergrationTests. Reordered declarations in persistence(2).xml to make sure we retain alphabetic sorting.
Original pull request: #115.
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.
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.
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.
Refactored JpaMappingContext to be able to work with multiple instances of Metamodel. This removes the need to wire a dedicated one in JpaMetamodelContextFactoryBean and thus makes it independent of a particular EntityManager(Factory). This significantly eases the implementation of the configuration integration.
Some persistence providers do not bump the version number in an initial call to EntityManager.persist(…). Thus, in case of a primitive version property we cannot distinguish between a new entity and one already persisted. We now fall back to id inspection whenever we find a primitive version property.
Original pull request: #103.
JPA requires mapping file locations to be classpath relative. Previously we handed the full path to the file (including protocol and JAR path) to the provider, which they happened to understand by accident. To be more spec compliant, we now massage the detected URIs into the expected format.
Original pull request: #81.
Previously, we only checked the version attribute's value against null, which effectively invalidly reported a new entity being non-new in case it used primitive types for the version attribute (as it has a default value then).
We now explicitly check for primitive version property types and consider default values to indicate new state.