public class SelectArg extends BaseArgumentHolder
NOTE: If the argument has not been set by the time the query is executed, an exception will be thrown.
NOTE: For protections sake, the object cannot be reused with different column names.
Constructor and Description |
---|
SelectArg()
Constructor for when the value will be set later with
setValue(Object) . |
SelectArg(Object value)
Constructor for when the value is known at time of construction.
|
SelectArg(SqlType sqlType)
This constructor is only necessary if you are using the
Where.raw(String, ArgumentHolder...) and similar
methods. |
SelectArg(SqlType sqlType,
Object value)
This constructor is only necessary if you are using the
Where.raw(String, ArgumentHolder...) and similar
methods. |
SelectArg(String columnName,
Object value)
This constructor is only necessary if you are using the
Where.raw(String, ArgumentHolder...) and similar
methods. |
Modifier and Type | Method and Description |
---|---|
protected Object |
getValue()
Return the stored value.
|
protected boolean |
isValueSet()
Return true if the value is set.
|
void |
setValue(Object value)
Set the value associated with this argument.
|
getColumnName, getFieldType, getSqlArgValue, getSqlType, setMetaInfo, setMetaInfo, setMetaInfo, toString
public SelectArg()
setValue(Object)
.public SelectArg(String columnName, Object value)
Where.raw(String, ArgumentHolder...)
and similar
methods.columnName
- Name of the column this argument corresponds to.value
- Value for the select-arg if know at time of construction. Otherwise call setValue(Object)
later.public SelectArg(SqlType sqlType, Object value)
Where.raw(String, ArgumentHolder...)
and similar
methods.sqlType
- Type of the column that this argument corresponds to. Only necessary if you are using the
Where.raw(String, ArgumentHolder...)
and similar methods.value
- Value for the select-arg if know at time of construction. Otherwise call setValue(Object)
later.public SelectArg(SqlType sqlType)
Where.raw(String, ArgumentHolder...)
and similar
methods.sqlType
- Type of the column that this argument corresponds to. Only necessary if you are using the
Where.raw(String, ArgumentHolder...)
and similar methods.public SelectArg(Object value)
SelectArg()
empty constructor and set the value later with setValue(Object)
.
WARNING, This constructor sets the _value_ not the column-name. To set the column-name only, use the
SelectArg(String, Object)
and pass a null as the value.
protected Object getValue()
BaseArgumentHolder
getValue
in class BaseArgumentHolder
public void setValue(Object value)
ArgumentHolder
setValue
in interface ArgumentHolder
setValue
in class BaseArgumentHolder
protected boolean isValueSet()
BaseArgumentHolder
isValueSet
in class BaseArgumentHolder
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.