Removed QueryExtractor from JpaQueryLookupStrategy entirely as it's not needed anymore. Slightly adapted method signatures for consistent parameter order.
Original pull request: #408.
PersistenceProvider.potentiallyConvertEmptyCollection(…) is no longer necessary. The single relevant implementation got inlined in the single usage location. This in turn made a bunch of PersistenceProvider passing around superfluous which in turn get removed as well.
Original pull request: #408.
Signed-off-by: Jens Schauder <jschauder@pivotal.io>
Moved JpaQueryMethodFactory creation into a separate class.
Removed http URL in copyright statement.
Simplified bean injection of JpaQueryMethodFactory.build
Originial pull request: #305.
Signed-off-by: Jens Schauder <jschauder@pivotal.io>
Improved naming and formatting.
Made the `QueryExtractor` an argument of the `JpaQueryMethodFactory` constructor instead of its method.
Original pull request: #305.
This change allows to add a special parameter type by overriding org.springframework.data.jpa.repository.query.JpaParameters.JpaParameter.isBindable().
A "special parameter type" is a type of parameter that does not get bound to the query via the normal mechanism but gets some special treatment like `Class` or `Pageable`).
Original pull request: #305.
The caching was broken because ParameterMetadata used for the key lacked a proper equals and hashCode implementation.
Also it references the EntityManager and itself gets referenced in the ParameterBinder and therefore can't safely be cached.
Signed-off-by: Jens Schauder <jschauder@pivotal.io>
Original pull request: #402.
Since `\P{P}` doesn't include things like `<`, `>`, or `|` those where considered part of the parameter name when they weren't separated from it by whitespace.
This is now fixed.
Original pull request: #405.
Improved source layout of the changed section.
Fixed one more occurrence of `_Customer` to `Customer_`.
Signed-off-by: Jens Schauder <jschauder@pivotal.io>
According to hibernate documentation, The name of the metamodel class is derived from the name of the managed class by appending "_" to the name of the managed class.
To resolve XSD files properly from the classpath, their HTTPS reference must be present in the spring.schemas to avoid internet interaction for resolving an XSD file.
We now use a set to collect all the EntityManagerBeanDefinitions returned from the application context. Spring Framework recently changed the bean names by type lookup behavior to also consider the return type of a factory bean so that we now see Spring defined EntityManagerFactory beans twice as we look them up via the EMF interface as well as via AbstractEntityManagerFactoryBean. Using a set as the target unifies them into one logical bean definition again.
Also, merge CrudMethodMetadataPostProcessor with ExposeRepositoryInvocationInterceptor as exposing the MethodInvocation is only required for CrudMethodMetadata.
Evaluate JpaQuery-kind once instead for each invocation as the method signature isn't changing between invocations. Add early returns. Reuse cached annotation lookup results. Replace forEach calls with for-loops.
We now reuse JpaParametersParameterAccessor as much as possible to avoid constant recreation. This change required several signature changes to accept JpaParametersParameterAccessor instead of raw Object[] values.
The original NullPointerException was caused by a known bug in the JDK.
While using Optional is a valid workaround Optional (and Stream) have been sources of performance degradations.
Therefore I removed the Optional and the Stream based implementation and replaced it with an iterative one.
Original pull request: #390.
See also: https://stackoverflow.com/questions/24630963/java-8-nullpointerexception-in-collectors-tomap