Polishing.
Move off deprecated classes. Add Nullable annotations. Correct mistakes in documentation. Original pull request #2374
This commit is contained in:
@@ -19,6 +19,7 @@ import org.springframework.data.jpa.repository.query.JpaParameters.JpaParameter;
|
||||
import org.springframework.data.repository.query.Parameter;
|
||||
import org.springframework.data.repository.query.Parameters;
|
||||
import org.springframework.data.repository.query.ParametersParameterAccessor;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.data.repository.query.ParameterAccessor} based on an {@link Parameters} instance. It also
|
||||
@@ -39,6 +40,7 @@ public class JpaParametersParameterAccessor extends ParametersParameterAccessor
|
||||
super(parameters, values);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public <T> T getValue(Parameter parameter) {
|
||||
return super.getValue(parameter.getIndex());
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.data.domain.Slice;
|
||||
import org.springframework.data.domain.SliceImpl;
|
||||
import org.springframework.data.jpa.provider.PersistenceProvider;
|
||||
import org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor;
|
||||
import org.springframework.data.repository.support.PageableExecutionUtils;
|
||||
import org.springframework.data.support.PageableExecutionUtils;
|
||||
import org.springframework.data.util.CloseableIterator;
|
||||
import org.springframework.data.util.StreamUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -75,7 +75,7 @@ public abstract class JpaQueryExecution {
|
||||
* Executes the given {@link AbstractStringBasedJpaQuery} with the given {@link ParameterBinder}.
|
||||
*
|
||||
* @param query must not be {@literal null}.
|
||||
* @param values must not be {@literal null}.
|
||||
* @param accessor must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
@Nullable
|
||||
@@ -112,7 +112,7 @@ public abstract class JpaQueryExecution {
|
||||
* Method to implement {@link AbstractStringBasedJpaQuery} executions by single enum values.
|
||||
*
|
||||
* @param query
|
||||
* @param values
|
||||
* @param accessor
|
||||
* @return
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -87,7 +87,8 @@ public class ParameterBinder {
|
||||
* Binds the parameters to the given query and applies special parameter types (e.g. pagination).
|
||||
*
|
||||
* @param query must not be {@literal null}.
|
||||
* @param values values of method parameters to be assigned to the query parameters.
|
||||
* @param metadata must not be {@literal null}.
|
||||
* @param accessor must not be {@literal null}.
|
||||
*/
|
||||
Query bindAndPrepare(Query query, QueryParameterSetter.QueryMetadata metadata,
|
||||
JpaParametersParameterAccessor accessor) {
|
||||
|
||||
@@ -168,7 +168,7 @@ abstract class QueryParameterSetterFactory {
|
||||
* Evaluates the given {@link Expression} against the given values.
|
||||
*
|
||||
* @param expression must not be {@literal null}.
|
||||
* @param values must not be {@literal null}.
|
||||
* @param accessor must not be {@literal null}.
|
||||
* @return the result of the evaluation.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -250,6 +250,7 @@ abstract class QueryParameterSetterFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Object getValue(JpaParametersParameterAccessor accessor, Parameter parameter) {
|
||||
return accessor.getValue(parameter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user