Commits on Oct 21, 2016
  1. DATAJPA-984 - Improved translation of one-element tuples in projections.

    If a query returns a one-element tuple and that single element returned is type-compatible to the type to be returned we return it as is. Previously, we insisted on creating a Map from the tuple (which usually works for projection interfaces).
    This is needed to support custom simple types (i.e. types that the JPA provider can convert itself but which are not exposed through the metamodel - usually types managed through JPA AttributeConverters or provider specific conversion mechanisms).
    olivergierke committed Oct 21, 2016
Commits on Sep 29, 2016
Commits on Sep 28, 2016
  1. DATAJPA-974 - Query for tuples now uses joins correctly.

    When creating the selections for a derived query using a projection we now explicitly create joins for plural attributes. Looks like Hibernate fails to create a proper query if the path is referred to via root.get(…) and the select clause includes references to other non-plural attributes.
    olivergierke committed Sep 28, 2016
Commits on Sep 23, 2016
  1. DATAJPA-970 - Remove explicit group name from alias detection pattern.

    We now use the group index instead of an explicit name. This fixes problems when using the pattern on Java 6.
    Original pull request: #181.
    christophstrobl committed with olivergierke Sep 23, 2016
Commits on Sep 21, 2016
Commits on Sep 20, 2016
  1. DATAJPA-965 - Polishing.

    Removed some unnecessary overrides in JpaOrder.
    olivergierke committed Sep 14, 2016
  2. DATAJPA-965 - Fix potential blind SQL injection in Sort when used in …

    …combination with @Query.
    We now decline sort expressions that contain functions such as ORDER BY LENGTH(name) when used with repository having a String query defined via the @Query annotation.
    Think of a query method as follows:
    @Query("select p from Person p where LOWER(p.lastname) = LOWER(:lastname)")
    List<Person> findByLastname(@Param("lastname") String lastname, Sort sort);
    Calls to findByLastname("lannister", new Sort("LENGTH(firstname)")) from now on throw an Exception indicating function calls are not allowed within the _ORDER BY_ clause. However you still can use JpaSort.unsafe("LENGTH(firstname)") to restore the behavior.
    Kudos to Niklas Särökaari, Joona Immonen, Arto Santala, Antti Virtanen, Michael Holopainen and Antti Ahola who brought this to our attention.
    christophstrobl committed with olivergierke Sep 6, 2016
Commits on Sep 9, 2016
  1. DATAJPA-962 - Update Travis build profiles.

    Disabled the build profile for Spring 4.2 and enabled ones for Spring 5.
    olivergierke committed Sep 8, 2016
Commits on Sep 7, 2016
  1. DATAJPA-960 - Fixed alias detection for queries not containing an alias.

    We're now more lenient against manually defined queries that do not contain aliases when adding order by clauses to them. The alias detection now doesn't accidentally pick up "where" anymore in case no primary alias is declared and the code applying the order by clause only qualifies the expressions created if there actually is an alias in the first place.
    olivergierke committed Sep 4, 2016
Commits on Sep 4, 2016
  1. DATAJPA-956 - Fixed accidental pick up of non-EntityManagerFactor JND…

    …I objects.
    We now exclude all candidates beans that could theoretically become an EntityManagerFactory unless we definitely know so.
    Previously bean definitions for JndiObjectFactoryBean that didn't expose an expected type (e.g. ones defined via JavaConfig) were propagated to the creation of a DefaultJpaContext.
    olivergierke committed Sep 3, 2016
Commits on Aug 20, 2016
Commits on Aug 17, 2016
  1. DATAJPA-951 - Prevent preemptive conversion to Optional in JpaQueryEx…

    JpaQueryExecution applies a ConversionService to convert between low-level types such as integers, longs and byte arrays. That ConversionService also preemptively converts objects into JDK 8's Optional in case the invoked method's return type is Optional.
    We now explicitly remove the converter taking care of the latter to avoid Optionals to be created before the actual result conversion is applied, as it needs to see the raw value to create DTOs or interface based projections correctly.
    olivergierke committed Aug 17, 2016
Commits on Aug 11, 2016
  1. DATAJPA-938 - Enable DOTALL mode for regular expression detecting con…

    …structor expressions in manually declared queries.
    The usage of the DOTALL mode makes sure that line breaks in query definitions don't cause any trouble when trying to detect constructor expressions.
    olivergierke committed Aug 10, 2016
Commits on Aug 5, 2016
  1. DATAJPA-912 - Fix broken test in RepositoryWithCompositeKeyTests.

    Use a page size of 1 to enforce a count query creation. The expected exception is only visible with Hibernate 4.1.x when a count query is issued.
    Related pull request: #174.
    mp911de committed Aug 5, 2016
Commits on Aug 4, 2016
  1. DATAJPA-938 - Fixed constructor expression detection in QueryUtils.

    Slightly loosened our regular expression to detect constructor expressions as previously it didn't match select expressions that contained a distinct clause.
    olivergierke committed Jul 31, 2016
Commits on Aug 2, 2016
  1. DATAJPA-941 - Avoid causing exceptions in JPA type check.

    We're now using Class.isInstance(…) in favor of .cast(…) in JpaClassUtils.isOfType(…) as the latter causes exceptions to be thrown unnecessarily.
    olivergierke committed Aug 2, 2016
Commits on Jul 27, 2016
Commits on Jul 20, 2016
  1. DATAJPA-413 - Polishing.

    Removed some unnecessary accessor methods.
    Original pull request: #133.
    olivergierke committed Jul 20, 2016
  2. DATAJPA-413 - Guard identifier derivation against null values and add…

    … tests.
    Added guard against null values in identifiers. Null values can occur because id generation was not completed yet. Add tests for identifier derivation using @IdClass for Hibernate, OpenJPA and EclipseLink.
    Original pull request: #133.
    mp911de committed with olivergierke Jul 18, 2016
  3. DATAJPA-413 - Improved handling of entities annotated with @IdClass.

    Added special handling for IdClass' typed id values to prevent
    nested identifier classes from failing to be populated in JpaMetamodelEntityInformation.
    Original pull request: #133.
    thomasdarimont committed with olivergierke Feb 10, 2015
  4. DATAJPA-912 - Optimize paged query execution.

    We execute paged queries now in an optimized way. The data is obtained for each paged execution but the count query is deferred. We determine the total from the pageable and the results in which we don't hit the page size bounds (i.e. results are less than a full page without offset or results are greater 0 and less than a full page with offset). In all other cases we issue an additional count query.
    mp911de committed with olivergierke Jun 29, 2016
  5. DATAJPA-932 - Integrate version badge from

    Add version badge from and replace fixed version numbers with a placeholder.
    mp911de committed Jul 20, 2016
Commits on Jul 19, 2016
  1. DATAJPA-929 - Further guards against null values returned from Manage…

    Extracted the functionality to check for JPA managed types into a dedicated wrapper for the JPA Metamodel. This allows all clients to benefit from the null guards we have to put in place due to [0]. Adapted the fix introduced for DATAJPA-904 to make use of the newly created infrastructure, too.
    olivergierke committed Jul 19, 2016
Commits on Jul 14, 2016
  1. DATAJPA-923 - QueryByExamplePredicateBuilder now considers match mode.

    We now inspect QueryByExamplePredicateBuilder.isAndMatching() to decide whether to concatenate the predicates built using and or or.
    Related tickets: DATACMNS-879.
    olivergierke committed Jul 2, 2016
Commits on Jul 1, 2016