In case a derived query uses a DTO, we now create a select clause that uses a constructor expression for the DTO type. This wasn't supported before and expexted either an interface-based projection or an explicit query using a constructor expression.
Fixes#2363.
For some reason, EclipseLinkNamespaceUserRepositoryTests freezes. Can't figure out the source, so we are disabling it for now.
See #2329
Original pull request: #2345.
Rename Projector to EntityGraphFactory. Remove QuerydslProjector and TypedQueryProjector. Remove MappingContext creation.
See #2329
Original pull request: #2345.
When a property path based projection is specified we still return the root entity.
But we do provide a fetchgraph.
The JPA implementation will (should) load only the specified attributes eagerly.
It most likely will also load all other attributes from all selected tables.
Once we have infrastructure in place for for multilevel projections the same approach can and should be used for those.
Currently this is not the case.
Closes#2329
Original pull request: #2345.
We now consider `@Query(countName = "…")` when the actual query is a string query or named query using Properties to declare its query. Named queries using JPA named queries remain unchanged.
Closes#2217
We now use the IdClass type for lookups when the entity defines a `@IdClass`. Previously, we uses the type of the defined singular identifier attribute which lead to invalid queries.
Closes#2330
Fix version reference to Spring Data Commons. Avoid stream creation when fetching all/one/first element. Move off deprecated API. Add override comments. Add null guargs.
See #2294
Original pull request: #2326.
Add support for both QueryByExampleExecutor and QuerydslPredicateExecutor. This is used in SimpleJpaRepository and QuerydslJpaPredicateExecutor, resulting in various test cases proving support by both examples and Querydsl predicates.
NOTE: Class-based DTOs are NOT supported yet.
See #2294
Original pull request: #2326.
* Introduce Testcontainers as the mechanism to test against real data stores.
* Alter CI to handle running Testcontainers in reduced privilege mode.
* Run the data store specific test cases ONLY for the baseline Java 8 test execution.
See #2256.
When registered procedure output parameters, if the method annotated with @Procedure has a collection return type or an entity return type, then use ResultSet. Otherwise, handle either the array (Object[]) or the primitive types.
* Throw a proper exception when using an @Procedure-annotated method and no transaction is active.
* Introduce refCursor as a boolean flag to @Procedure denoting when to use REF_CURSORs for OUT parameters..
* Extract a ProcedureParameter command object to ease usage of a parameter's name, type and mode. (NOTE: javax.persistence already has "StoredProcedureParameter".)
NOTE: Integration testing of stored procedures is very limited by lack of HSQL's support for REF CURSORS. See ##2256 to track future work for potential testing against MySQL, Oracle, Postgres, or SQL Server.
See: #1959, #409.
Related: #2014.
Remove the @Repository annotation from interfaces in the examples, since it is not necessary on Spring Data interfaces (and creates a warning log anyway).
Closes#2234
Original pull request #2235
A few test that used reflection to access the actual SQL executed by a Query object failed with `java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not "opens java.lang.reflect" to unnamed module @1b9e1916`.
This change replaces the reflection used by a proper call to `unwrap`.
Original pull request #2231