|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.afcs.warts.handlers.DataHandlerSupport
org.afcs.warts.handlers.LobDataHandlerSupport
The LobDataHandlerSupport implements the
postProcessBind(java.sql.Connection, java.util.List, java.lang.Object)
method on behalf of subclasses, factoring out
common code and requiring the subclasses to implement a new abstract
method writeLobValue(java.sql.ResultSet, java.lang.Object)
.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
Constructor Summary | |
LobDataHandlerSupport(TableDescription tableDescription,
ColumnDescription columnDescription)
Constructs a new instance on behalf of subclasses that will handle data values for the specified column. |
Method Summary | |
void |
postProcessBind(java.sql.Connection connection,
java.util.List primaryKeyValues,
java.lang.Object value)
This method does absolutely nothing, and needs to be overridden by subclasses that actually do require bind post-processing when writing data to the database. |
boolean |
requiresBindPostProcessing()
This method always returns true, as LOB data handlers always need to do bind post-processing to write non-null data into the database. |
boolean |
requiresStreamedLoading()
This method always returns true, as LOB data is always streamed. |
protected abstract void |
writeLobValue(java.sql.ResultSet results,
java.lang.Object newLobValue)
This method is responsible for writing the specified LOB value (which differs in type depending on whether it is a CLOB or a BLOB) to the first column in the specified result set, which should contain a newly initialized LOB locator. |
Methods inherited from class org.afcs.warts.handlers.DataHandlerSupport |
getColumnDescription, getNullType, getTableDescription, isCharacterData, isNullHandler, loadBytesFromStream, logWrongValueTypeWarning, toString, verifyObjectIsString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LobDataHandlerSupport(TableDescription tableDescription, ColumnDescription columnDescription)
tableDescription
- The table that the handler will be handling data
for.columnDescription
- The column that this class will be processing
data for.Method Detail |
public void postProcessBind(java.sql.Connection connection, java.util.List primaryKeyValues, java.lang.Object value) throws java.sql.SQLException
postProcessBind
in class DataHandlerSupport
connection
- The database connection to use.primaryKeyValues
- The primary key values identifying the row that
the specified value has to be written to.value
- The value to write to the database.
java.sql.SQLException
- If a SQL error occurs during binding.public boolean requiresBindPostProcessing()
requiresBindPostProcessing
in class DataHandlerSupport
public boolean requiresStreamedLoading()
requiresStreamedLoading
in class DataHandlerSupport
protected abstract void writeLobValue(java.sql.ResultSet results, java.lang.Object newLobValue) throws java.sql.SQLException
results
- The result set containing the CLOB locator.newLobValue
- The new LOB value.
java.sql.SQLException
- If a SQL error occurs during update.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |