Added getBindableValue(int index) to ParameterAccessor.
Adapted ParametersParameterAccessor accordingly.
This commit is contained in:
@@ -49,6 +49,19 @@ public interface ParameterAccessor extends Iterable<Object> {
|
||||
Sort getSort();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the bindable value with the given index. Bindable means, that
|
||||
* {@link Pageable} and {@link Sort} values are skipped without noticed in
|
||||
* the index. For a method signature taking {@link String}, {@link Pageable}
|
||||
* , {@link String}, {@code #getBindableParameter(1)} would return the
|
||||
* second {@link String} value.
|
||||
*
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
Object getBindableValue(int index);
|
||||
|
||||
|
||||
/**
|
||||
* Returns an iterator over all <em>bindable</em> parameters. This means
|
||||
* parameters implementing {@link Pageable} or {@link Sort} will not be
|
||||
|
||||
@@ -89,7 +89,14 @@ public class ParametersParameterAccessor implements ParameterAccessor {
|
||||
}
|
||||
|
||||
|
||||
private Object getBindableValue(int index) {
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.springframework.data.repository.query.ParameterAccessor#getBindableValue
|
||||
* (int)
|
||||
*/
|
||||
public Object getBindableValue(int index) {
|
||||
|
||||
return values[parameters.getBindableParameter(index).getIndex()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user