public static class Query.QueryParams
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
maxParamIndex
The index of the maximum parameter set.
|
java.lang.Object[] |
parameters
The set of positional parameters
|
Constructor and Description |
---|
QueryParams() |
Modifier and Type | Method and Description |
---|---|
void |
ensureParameterSize(int fitIndex)
Makes sure the array that holds the parameters for this query is large enough to accommodate
the
fitIndex -th parameter. |
int |
getCardinality(int pos)
Returns the cardinality of the parameter on a specific position.
|
void |
insertParam(int pos,
java.util.List<java.lang.Object> args)
Inserts a list of parameters at a specified position.
|
void |
insertParam(int pos,
java.lang.Object[] args)
Inserts a list of parameters at a specified position.
|
void |
removeParam(int pos)
Removes one of the query's parameter and shifting all the parameters on higher offset one position to
the left.
|
void |
replaceParam(int pos,
java.util.List<java.lang.Object> args)
Replaces a query parameter with a list of values.
|
void |
replaceParam(int pos,
java.lang.Object[] args)
Replaces a query parameter with a list of values.
|
void |
setParameter(int index,
java.lang.Object arg)
Sets the value of a parameter for this query.
|
public java.lang.Object[] parameters
public int maxParamIndex
public void ensureParameterSize(int fitIndex)
fitIndex
-th parameter. If the index fits the current size nothing is performed.
Otherwise the array is reallocated and the existing parameters are copied to their fixed
positions. To improve performance, more space is allocated so that this operation will not
happen at each method call.fitIndex
- The index of the latest added parameter.public void setParameter(int index, java.lang.Object arg)
index
- The index of the parameter to be set (0-base).arg
- The parameter value.public void removeParam(int pos)
pos
- The offset of the parameter to be removed.public void replaceParam(int pos, java.util.List<java.lang.Object> args)
n - 1
, where n
is the number of values in the args
list. All existing
parameters at higher offsets than pos
are shifted to the right by n - 1
positions.pos
- The offset of the parameter to be replaced.args
- A list of replacement parameters.public void replaceParam(int pos, java.lang.Object[] args)
n - 1
, where n
is the number of values in the args
list. All existing
parameters at higher offsets than pos
are shifted to the right by n - 1
positions.pos
- The offset of the parameter to be replaced.args
- A list of replacement parameters.public void insertParam(int pos, java.util.List<java.lang.Object> args)
n
, where n
is the number of values in the args
list. All existing parameters
at higher offsets than pos
are shifted to the right by n
positions.pos
- The offset after which to insert the new list.args
- The list of parameters to be added.public void insertParam(int pos, java.lang.Object[] args)
n
, where n
is the number of values in the args
list. All existing parameters
at higher offsets than pos
are shifted to the right by n
positions.pos
- The offset after which to insert the new list.args
- The list of parameters to be added.public int getCardinality(int pos)
pos
- The position of the parameter to be analysed.