@Experimental public class JdbcNumericBetweenParametersProvider extends Object implements JdbcParameterValuesProvider
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 |
|---|
JdbcNumericBetweenParametersProvider(long minVal,
long maxVal)
NumericBetweenParametersProviderJdbc constructor.
|
JdbcNumericBetweenParametersProvider(long fetchSize,
long minVal,
long maxVal)
NumericBetweenParametersProviderJdbc constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Serializable[][] |
getParameterValues()
Returns the necessary parameters array to use for query in parallel a table.
|
JdbcNumericBetweenParametersProvider |
ofBatchNum(int batchNum) |
JdbcNumericBetweenParametersProvider |
ofBatchSize(long batchSize) |
public JdbcNumericBetweenParametersProvider(long minVal,
long maxVal)
minVal - the lower bound of the produced "from" valuesmaxVal - the upper bound of the produced "to" valuespublic JdbcNumericBetweenParametersProvider(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 JdbcNumericBetweenParametersProvider ofBatchSize(long batchSize)
public JdbcNumericBetweenParametersProvider ofBatchNum(int batchNum)
public Serializable[][] getParameterValues()
JdbcParameterValuesProvidergetParameterValues in interface JdbcParameterValuesProviderCopyright © 2022–2024 The Apache Software Foundation. All rights reserved.