A lot of jUnit tests had in the method header a `throws` that is useless. For example `throws Exception` on a method where no exception is thrown. Removing this noice will make the tests more redable.
Original pull request #2433
Removed Given/When/Then comments.
They are of limited use, especially since it is debatable what belongs in which section.
See #2176
Original pull request #2401
The Auditable interface introduces Optional getters, which when combined with Query by Example results in cryptic errors. By ignoring a probe's field that contains an Optional.empty, Query by Example works properly.
NOTE: This fix actually tests outside the originally detected scope of Auditable, verifying that ALL Optional.empty() fields are properly handled.
Closes#2176
Original pull request #2401
Hibernate 5.4.22 started including types managed by custom user types in the embeddables exposed via JPA's Metamodel API. This causes those to be considered types to explicitly map (read: unfold) in Spring Data REST. We now exposed a cleaned up view on this via a tweak in JpaPersistentPropertyImpl (ultimately in JpaMetamodel) looking for @Embeddable annotation on types allegedly considered embeddable by Hibernate.
Fixes#2421.
The error message for nonexistent properties inside query derivation now wraps the named property with single quotes. This breaks a test case that was looking for spaces before and after.
Forward ported to 3.0.x
See #2418.
With the commit for GH-2363, we introduced an unguarded call to ReturnedType.getTypeToRead(), which could return null under certain conditions. Unfortunately Spring Data JPA dod not contain a test case that triggered that scenario.
This commit switches to ReturnedType.getReturnedType() which is non-nullable and lets us inspect the calls results for interfaces, which we need to create the JPA query properly.
Fixes GH-2408
Test based on JNDI injection removed, along with the context configuration xml used by the test.
The classes used for mocking the JNDI context are no longer part of Spring Framework.
RequiredAnnotationBeanPostProcessor removed from configuration.
It's no longer provided by Spring Framework.
Closes#2385
Spring Data JPA is now a multimodule project.
The artifacts build are still separate, except for the documentation which is now a single one.
Closes # 2316
Moves to spring-data-commons 3.0.0
Moves of deprecated and now removed AuditHandler constructor.
Set source version to 16 since the AspectJ-Maven-Plugin does not support Java 17 source yet.
Closes#2309
We now use IdentifiableType.hasSingleIdAttribute() to detect whether a type should have an IdClass. hasSingleIdAttribute is defined to return false if an IdClass is being used. It could also return false in case multiple identifier attributes are in place (composite Id) which is a bit of a grey area. At least we avoid using Hibernate-specific API.
Original pull request #2412
See #2330Closes#2391
Introduce a repository method that makes it clear the return value is a reference. Deprecate the previous methods.
Closes#2232
Original pull request #2398