java.lang.Object
org.postgresql.pljava.jdbc.AbstractResultSet
org.postgresql.pljava.jdbc.ObjectResultSet
org.postgresql.pljava.jdbc.SingleRowResultSet
org.postgresql.pljava.jdbc.TriggerResultSet
- All Implemented Interfaces:
AutoCloseable
,ResultSet
,Wrapper
A single row, updateable ResultSet specially made for triggers. The
changes made to this ResultSet are remembered and converted to a
SPI_modify_tuple call prior to function return.
- Author:
- Thomas Hallgren
-
Field Summary
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel all changes made to the Tuple.void
close()
Cancels all changes but doesn't really close the set.Object[]
Return a 3 element array describing the changes that have been made to the contained Tuple.int
Returns the concurrency for this ResultSet.protected Object
getObjectValue
(int columnIndex, Class<?> type) If the value has not been changed, forwards toTuple.getObject
, with the usual behavior for type coercion; if it has been changed, returns the exact object that was supplied with the change.protected final TupleDesc
boolean
isClosed()
boolean
Returnstrue
if this row has been updated.void
updateObject
(int columnIndex, Object x) Store this change for later useMethods inherited from class org.postgresql.pljava.jdbc.SingleRowResultSet
absolute, afterLast, beforeFirst, deleteRow, findColumn, first, getFetchDirection, getFetchSize, getHoldability, getMetaData, getRow, getType, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, relative, rowDeleted, rowInserted, setFetchDirection, setFetchSize, updateObject, updateRow
Methods inherited from class org.postgresql.pljava.jdbc.ObjectResultSet
clearWarnings, getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getClob, getDate, getDate, getDouble, getFloat, getInt, getLong, getNumber, getObject, getObject, getObject, getObjectValue, getObjectValue, getRef, getShort, getString, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, getURL, getValue, getValue, getWarnings, refreshRow, updateArray, updateAsciiStream, updateBigDecimal, updateBinaryStream, updateBlob, updateBoolean, updateByte, updateBytes, updateCharacterStream, updateClob, updateDate, updateDouble, updateFloat, updateInt, updateLong, updateNull, updateRef, updateShort, updateString, updateTime, updateTimestamp, wasNull
Methods inherited from class org.postgresql.pljava.jdbc.AbstractResultSet
getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getClob, getCursorName, getDate, getDate, getDouble, getFloat, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getRef, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, getURL, isWrapperFor, unwrap, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateByte, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDouble, updateFloat, updateInt, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateObject, updateObject, updateRef, updateRowId, updateRowId, updateShort, updateSQLXML, updateSQLXML, updateString, updateTime, updateTimestamp
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.ResultSet
updateObject, updateObject, updateObject, updateObject
-
Constructor Details
-
TriggerResultSet
- Throws:
SQLException
-
-
Method Details
-
cancelRowUpdates
Cancel all changes made to the Tuple.- Throws:
SQLException
-
close
Cancels all changes but doesn't really close the set.- Throws:
SQLException
-
getConcurrency
Returns the concurrency for this ResultSet.- Specified by:
getConcurrency
in interfaceResultSet
- Overrides:
getConcurrency
in classSingleRowResultSet
- Throws:
SQLException
- See Also:
-
rowUpdated
Returnstrue
if this row has been updated.- Throws:
SQLException
-
updateObject
Store this change for later use- Throws:
SQLException
-
getChangeIndexesAndValues
Return a 3 element array describing the changes that have been made to the contained Tuple. The first element the original Tuple, the second anint[]
containing the index of each changed value, and the third anObject[]
containing the corresponding values.- Returns:
- The 3 element array or
null
if no change has been made.
-
getObjectValue
If the value has not been changed, forwards toTuple.getObject
, with the usual behavior for type coercion; if it has been changed, returns the exact object that was supplied with the change.When the caller is the JDBC 4.1
ObjectResultSet.getObject(int,Class)
, the caller will check and complain if the returned object is not of the right class.- Specified by:
getObjectValue
in classObjectResultSet
- Throws:
SQLException
-
getTupleDesc
- Specified by:
getTupleDesc
in classSingleRowResultSet
-
isClosed
- Throws:
SQLException
-