|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j256.ormlite.stmt.BaseArgumentHolder
com.j256.ormlite.stmt.SelectArg
public class SelectArg
An argument to a select SQL statement. After the query is constructed, the caller can set the value on this argument and run the query. Then the argument can be set again and the query re-executed. This is equivalent in SQL to a ? argument.
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.j256.ormlite.stmt.BaseArgumentHolder |
---|
getColumnName, getFieldType, getSqlArgValue, getSqlType, setMetaInfo, setMetaInfo, setMetaInfo, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.j256.ormlite.stmt.ArgumentHolder |
---|
getColumnName, getFieldType, getSqlArgValue, getSqlType, setMetaInfo, setMetaInfo, setMetaInfo |
Constructor Detail |
---|
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.
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |