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.
| 构造器和说明 |
|---|
NumericBetweenParametersProvider(long minVal,
long maxVal)
NumericBetweenParametersProvider constructor.
|
NumericBetweenParametersProvider(long fetchSize,
long minVal,
long maxVal)
NumericBetweenParametersProvider constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 ParameterValuesProviderCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.