public static class QueryReader.Column extends SqlObject
appendTo
method is called.
This enables the user to get parameters correctly from a ResultSet
where the position is not known at query creation time.
Note: a Column may not be used in more than one place in the query.ALL_SYMBOL, NULL_VALUE, QUESTION_MARK
Constructor and Description |
---|
Column(QueryReader outer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addIndex(int index) |
void |
appendTo(AppendableExt app)
Appends this object to the given AppendableExt.
|
protected void |
collectSchemaObjects(ValidationContext vContext)
Used during Query.validate() calls to collect the dbschema objects
referenced in a query.
|
boolean |
getBoolean(ResultSet rs)
Calls getBoolean on the given ResultSet for the position of this
Column.
|
SqlObject |
getCustomColumnObject() |
int |
getIndex() |
int |
getInt(ResultSet rs)
Calls getInt on the given ResultSet for the position of this Column.
|
long |
getLong(ResultSet rs)
Calls getLong on the given ResultSet for the position of this Column.
|
Object |
getObject(ResultSet rs)
Calls getObject on the given ResultSet for the position of this Column.
|
String |
getString(ResultSet rs)
Calls getString on the given ResultSet for the position of this Column.
|
boolean |
isInQuery() |
QueryReader.Column |
setColumnObject(Column columnObj)
Sets the actual sql to be generated by this column.
|
QueryReader.Column |
setCustomColumnObject(Object columnObj)
Sets the actual sql to be generated by this column.
|
void |
updateBoolean(boolean value,
ResultSet rs)
Calls updateBoolean on the given ResultSet with the given value
for the position of this PlaceHolder.
|
void |
updateBoolean(Boolean value,
ResultSet rs)
Calls updateBoolean on the given ResultSet with the given value for
the position of this PlaceHolder.
|
void |
updateInt(Integer value,
ResultSet rs)
Calls updateInt on the given ResultSet with the given value for
the position of this PlaceHolder.
|
void |
updateInt(int value,
ResultSet rs)
Calls updateInt on the given ResultSet with the given value
for the position of this PlaceHolder.
|
void |
updateLong(long value,
ResultSet rs)
Calls updateLong on the given ResultSet with the given value
for the position of this PlaceHolder.
|
void |
updateLong(Long value,
ResultSet rs)
Calls updateLong on the given ResultSet with the given value for
the position of this PlaceHolder.
|
void |
updateNull(ResultSet rs)
Calls updateNull on the given ResultSet with the given sql type
for the position of this PlaceHolder.
|
void |
updateObject(Object value,
ResultSet rs)
Calls updateObject on the given ResultSet with the given value for the
position of this PlaceHolder.
|
void |
updateString(String value,
ResultSet rs)
Calls updateString on the given ResultSet with the given value
for the position of this PlaceHolder.
|
collectSchemaObjects, doValidate, toString
toString, toString
public Column(QueryReader outer)
public QueryReader.Column setColumnObject(Column columnObj)
public QueryReader.Column setCustomColumnObject(Object columnObj)
Object
-> SqlObject
conversions handled by
Converter.toColumnSqlObject(Object)
.
public SqlObject getCustomColumnObject()
public boolean isInQuery()
public int getIndex()
protected void addIndex(int index)
public int getInt(ResultSet rs) throws SQLException
Since there is no possible null
value return for this method if
this Column was not in the query, the caller is expected to already
know if this is a valid call (possibly via isInQuery()
).
SQLException
public long getLong(ResultSet rs) throws SQLException
Since there is no possible null
value return for this method if
this Column was not in the query, the caller is expected to already
know if this is a valid call (possibly via isInQuery()
).
SQLException
public boolean getBoolean(ResultSet rs) throws SQLException
Since there is no possible null
value return for this method if
this Column was not in the query, the caller is expected to already
know if this is a valid call (possibly via isInQuery()
).
SQLException
public String getString(ResultSet rs) throws SQLException
Returns null
if this Column was not in the query.
SQLException
public Object getObject(ResultSet rs) throws SQLException
Returns null
if this Column was not in the query.
SQLException
public void updateNull(ResultSet rs) throws SQLException
SQLException
public void updateInt(int value, ResultSet rs) throws SQLException
SQLException
public void updateInt(Integer value, ResultSet rs) throws SQLException
null
,
calls updateNull with the sql type INTEGER
.SQLException
public void updateLong(long value, ResultSet rs) throws SQLException
SQLException
public void updateLong(Long value, ResultSet rs) throws SQLException
null
,
calls updateNull with the sql type BIGINT
.SQLException
public void updateBoolean(boolean value, ResultSet rs) throws SQLException
SQLException
public void updateBoolean(Boolean value, ResultSet rs) throws SQLException
null
,
calls updateNull with the sql type BOOLEAN
.SQLException
public void updateString(String value, ResultSet rs) throws SQLException
SQLException
public void updateObject(Object value, ResultSet rs) throws SQLException
SQLException
protected void collectSchemaObjects(ValidationContext vContext)
SqlObject
collectSchemaObjects
in class SqlObject
vContext
- handle to the current validation contextpublic final void appendTo(AppendableExt app) throws IOException
Appendee
appendTo
in interface Appendee
appendTo
in class AppendeeObject
app
- the AppendableExt to which this class should append itselfIOException
- if the append failsCopyright © 2006–2021 OpenHMS. All rights reserved.