public class NumericBetweenParametersProvider extends Object implements ParameterValuesProvider
For example, if there's a table BOOKS with a numeric PK id, using a query like:
SELECT * FROM BOOKS WHERE id BETWEEN ? AND ?
You can take advantage of this class to automatically generate the parameters of the BETWEEN clause, based on the passed constructor parameters.
| Constructor and Description |
|---|
NumericBetweenParametersProvider(long minVal,
long maxVal)
NumericBetweenParametersProvider constructor.
|
NumericBetweenParametersProvider(long fetchSize,
long minVal,
long maxVal)
NumericBetweenParametersProvider constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Serializable[][] |
getParameterValues()
Returns the necessary parameters array to use for query in parallel a table.
|
NumericBetweenParametersProvider |
ofBatchNum(int batchNum) |
NumericBetweenParametersProvider |
ofBatchSize(long batchSize) |
public NumericBetweenParametersProvider(long minVal,
long maxVal)
minVal - the lower bound of the produced "from" valuesmaxVal - the upper bound of the produced "to" valuespublic NumericBetweenParametersProvider(long fetchSize,
long minVal,
long maxVal)
fetchSize - the max distance between the produced from/to pairsminVal - the lower bound of the produced "from" valuesmaxVal - the upper bound of the produced "to" valuespublic NumericBetweenParametersProvider ofBatchSize(long batchSize)
public NumericBetweenParametersProvider ofBatchNum(int batchNum)
public Serializable[][] getParameterValues()
ParameterValuesProvidergetParameterValues in interface ParameterValuesProviderCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.