Package org.apache.openjpa.jdbc.sql
Class ResultSetResult
java.lang.Object
org.apache.openjpa.jdbc.sql.AbstractResult
org.apache.openjpa.jdbc.sql.ResultSetResult
- Direct Known Subclasses:
SelectImpl.SelectResult
Base
Result implementation wrapped around a result set.
Column objects, column names, or column indexes (as Number
instances) can be used to retrieve result set data.- Author:
- Abe White
-
Constructor Summary
ConstructorsConstructorDescriptionResultSetResult(Connection conn, ResultSet rs, DBDictionary dict) Constructor.ResultSetResult(Connection conn, Statement stmnt, ResultSet rs, JDBCStore store) Constructor.ResultSetResult(Connection conn, Statement stmnt, ResultSet rs, DBDictionary dict) Constructor.ResultSetResult(ResultSet rs, JDBCStore store) JDBC 2 constructor.ResultSetResult(ResultSet rs, DBDictionary dict) JDBC 2 constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanabsoluteInternal(int row) Throws an exception by default.voidclose()Closes all eager results.protected booleancontainsInternal(Object obj, Joins joins) Return whether this result contains data for the given id or column.protected intfindObject(Object obj, Joins joins) Return the 1-based result set index for the given column or id, or a non-positive number if the column is not contained in this result.protected ArraygetArrayInternal(Object obj, Joins joins) protected InputStreamgetAsciiStreamInternal(Object obj, Joins joins) protected BigDecimalgetBigDecimalInternal(Object obj, Joins joins) protected BigIntegergetBigIntegerInternal(Object obj, Joins joins) protected InputStreamgetBinaryStreamInternal(Object obj, Joins joins) protected BlobgetBlobInternal(Object obj, Joins joins) protected booleangetBooleanInternal(Object obj, Joins joins) protected bytegetByteInternal(Object obj, Joins joins) protected byte[]getBytesInternal(Object obj, Joins joins) protected CalendargetCalendarInternal(Object obj, Joins joins) protected ReadergetCharacterStreamInternal(Object obj, Joins joins) protected chargetCharInternal(Object obj, Joins joins) protected ClobgetClobInternal(Object obj, Joins joins) booleanWhether to close the backing connection when this result is closed.protected DategetDateInternal(Object obj, Calendar cal, Joins joins) protected DategetDateInternal(Object obj, Joins joins) Return the dictionary in use.protected doublegetDoubleInternal(Object obj, Joins joins) protected floatgetFloatInternal(Object obj, Joins joins) protected intgetIntInternal(Object obj, Joins joins) protected InputStreamgetLOBStreamInternal(JDBCStore store, Object obj, Joins joins) protected LocalDategetLocalDateInternal(Object obj, Joins joins) protected LocalDateTimegetLocalDateTimeInternal(Object obj, Joins joins) protected LocalegetLocaleInternal(Object obj, Joins joins) protected LocalTimegetLocalTimeInternal(Object obj, Joins joins) protected longgetLongInternal(Object obj, Joins joins) protected NumbergetNumberInternal(Object obj, Joins joins) protected ObjectgetObjectInternal(Object obj, int metaTypeCode, Object arg, Joins joins) Return the value stored in the given id or column.protected OffsetDateTimegetOffsetDateTimeInternal(Object obj, Joins joins) protected OffsetTimegetOffsetTimeInternal(Object obj, Joins joins) protected RefgetRefInternal(Object obj, Map map, Joins joins) Return the backing result set.protected shortgetShortInternal(Object obj, Joins joins) protected ObjectgetSQLObjectInternal(Object obj, Map map, Joins joins) Return the statement that produced this result.getStore()Optional store manager used to deserialize blobs containing references to persistent objects.protected ObjectgetStreamInternal(JDBCStore store, Object obj, int metaTypeCode, Object arg, Joins joins) protected StringgetStringInternal(Object obj, Joins joins, boolean isClobString) protected TimegetTimeInternal(Object obj, Calendar cal, Joins joins) protected TimestampgetTimestampInternal(Object obj, Calendar cal, Joins joins) protected booleanAdvance this row.voidsetCloseConnection(boolean closeConn) Whether to close the backing connection when this result is closed.voidsetCloseStatement(boolean closeStatement) voidOptional store manager used to deserialize blobs containing references to persistent objects.intsize()Return the number of rows in this result.booleanReturns false by default.protected ObjectTranslate the user-given id or column.booleanwasNull()Return true if the last value fetched was null.Methods inherited from class org.apache.openjpa.jdbc.sql.AbstractResult
absolute, checkNull, closeEagerMap, contains, contains, containsAll, containsAll, containsAllInternal, endDataRequest, getArray, getArray, getAsciiStream, getAsciiStream, getBaseMapping, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCalendar, getCalendar, getChar, getChar, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getEager, getEagerMap, getFloat, getFloat, getInt, getInt, getLOBStream, getLocalDate, getLocalDateTime, getLocale, getLocale, getLocalTime, getLong, getLong, getMappedByFieldMapping, getMappedByValue, getNumber, getNumber, getObject, getObject, getOffsetDateTime, getOffsetTime, getRef, getRef, getShort, getShort, getSQLObject, getSQLObject, getString, getString, getTime, getTime, getTimestamp, getTimestamp, indexOf, isLocking, load, load, newJoins, next, pushBack, putEager, setBaseMapping, setEagerMap, setIndexOf, setLocking, setMappedByFieldMapping, setMappedByValue, startDataRequest
-
Constructor Details
-
ResultSetResult
Constructor. -
ResultSetResult
Constructor. -
ResultSetResult
Constructor. -
ResultSetResult
JDBC 2 constructor. Relies on being able to retrieve the statement from the result set, and the connection from the statement.- Throws:
SQLException
-
ResultSetResult
JDBC 2 constructor. Relies on being able to retrieve the statement from the result set, and the connection from the statement.- Throws:
SQLException
-
-
Method Details
-
getStatement
Return the statement that produced this result. -
getResultSet
Return the backing result set. -
getDBDictionary
Return the dictionary in use. -
getStore
Optional store manager used to deserialize blobs containing references to persistent objects. -
setStore
Optional store manager used to deserialize blobs containing references to persistent objects. -
getCloseConnection
public boolean getCloseConnection()Whether to close the backing connection when this result is closed. Defaults to true. -
setCloseConnection
public void setCloseConnection(boolean closeConn) Whether to close the backing connection when this result is closed. Defaults to true. -
setCloseStatement
public void setCloseStatement(boolean closeStatement) -
close
public void close()Description copied from class:AbstractResultCloses all eager results. -
supportsRandomAccess
Description copied from class:AbstractResultReturns false by default.- Specified by:
supportsRandomAccessin interfaceResult- Overrides:
supportsRandomAccessin classAbstractResult- Throws:
SQLException
-
absoluteInternal
Description copied from class:AbstractResultThrows an exception by default.- Overrides:
absoluteInternalin classAbstractResult- Throws:
SQLException
-
nextInternal
Description copied from class:AbstractResultAdvance this row.- Specified by:
nextInternalin classAbstractResult- Throws:
SQLException
-
size
Description copied from interface:ResultReturn the number of rows in this result.- Throws:
SQLException
-
containsInternal
Description copied from class:AbstractResultReturn whether this result contains data for the given id or column. The id or column has not beed passed throughAbstractResult.translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins).- Specified by:
containsInternalin classAbstractResult- Throws:
SQLException
-
getArrayInternal
- Overrides:
getArrayInternalin classAbstractResult- Throws:
SQLException
-
getAsciiStreamInternal
- Overrides:
getAsciiStreamInternalin classAbstractResult- Throws:
SQLException
-
getBigDecimalInternal
- Overrides:
getBigDecimalInternalin classAbstractResult- Throws:
SQLException
-
getNumberInternal
- Overrides:
getNumberInternalin classAbstractResult- Throws:
SQLException
-
getBigIntegerInternal
- Overrides:
getBigIntegerInternalin classAbstractResult- Throws:
SQLException
-
getBinaryStreamInternal
- Overrides:
getBinaryStreamInternalin classAbstractResult- Throws:
SQLException
-
getBlobInternal
- Overrides:
getBlobInternalin classAbstractResult- Throws:
SQLException
-
getBooleanInternal
- Overrides:
getBooleanInternalin classAbstractResult- Throws:
SQLException
-
getByteInternal
- Overrides:
getByteInternalin classAbstractResult- Throws:
SQLException
-
getBytesInternal
- Overrides:
getBytesInternalin classAbstractResult- Throws:
SQLException
-
getCalendarInternal
- Overrides:
getCalendarInternalin classAbstractResult- Throws:
SQLException
-
getLocalDateInternal
- Overrides:
getLocalDateInternalin classAbstractResult- Throws:
SQLException
-
getLocalTimeInternal
- Overrides:
getLocalTimeInternalin classAbstractResult- Throws:
SQLException
-
getLocalDateTimeInternal
- Overrides:
getLocalDateTimeInternalin classAbstractResult- Throws:
SQLException
-
getOffsetTimeInternal
- Overrides:
getOffsetTimeInternalin classAbstractResult- Throws:
SQLException
-
getOffsetDateTimeInternal
- Overrides:
getOffsetDateTimeInternalin classAbstractResult- Throws:
SQLException
-
getCharInternal
- Overrides:
getCharInternalin classAbstractResult- Throws:
SQLException
-
getCharacterStreamInternal
- Overrides:
getCharacterStreamInternalin classAbstractResult- Throws:
SQLException
-
getClobInternal
- Overrides:
getClobInternalin classAbstractResult- Throws:
SQLException
-
getDateInternal
- Overrides:
getDateInternalin classAbstractResult- Throws:
SQLException
-
getDateInternal
- Overrides:
getDateInternalin classAbstractResult- Throws:
SQLException
-
getDoubleInternal
- Overrides:
getDoubleInternalin classAbstractResult- Throws:
SQLException
-
getFloatInternal
- Overrides:
getFloatInternalin classAbstractResult- Throws:
SQLException
-
getIntInternal
- Overrides:
getIntInternalin classAbstractResult- Throws:
SQLException
-
getLocaleInternal
- Overrides:
getLocaleInternalin classAbstractResult- Throws:
SQLException
-
getLongInternal
- Overrides:
getLongInternalin classAbstractResult- Throws:
SQLException
-
getStreamInternal
protected Object getStreamInternal(JDBCStore store, Object obj, int metaTypeCode, Object arg, Joins joins) throws SQLException - Specified by:
getStreamInternalin classAbstractResult- Throws:
SQLException
-
getObjectInternal
protected Object getObjectInternal(Object obj, int metaTypeCode, Object arg, Joins joins) throws SQLException Description copied from class:AbstractResultReturn the value stored in the given id or column.- Specified by:
getObjectInternalin classAbstractResult- Throws:
SQLException
-
getSQLObjectInternal
- Overrides:
getSQLObjectInternalin classAbstractResult- Throws:
SQLException
-
getRefInternal
- Overrides:
getRefInternalin classAbstractResult- Throws:
SQLException
-
getShortInternal
- Overrides:
getShortInternalin classAbstractResult- Throws:
SQLException
-
getStringInternal
protected String getStringInternal(Object obj, Joins joins, boolean isClobString) throws SQLException - Overrides:
getStringInternalin classAbstractResult- Throws:
SQLException
-
getTimeInternal
- Overrides:
getTimeInternalin classAbstractResult- Throws:
SQLException
-
getTimestampInternal
- Overrides:
getTimestampInternalin classAbstractResult- Throws:
SQLException
-
wasNull
Description copied from interface:ResultReturn true if the last value fetched was null.- Specified by:
wasNullin interfaceResult- Overrides:
wasNullin classAbstractResult- Throws:
SQLException
-
translate
Description copied from class:AbstractResultTranslate the user-given id or column. This method is called before delegating to anyget*Internalmethods with the exception ofgetObjectInternal. Return the original value by default.- Overrides:
translatein classAbstractResult- Throws:
SQLException
-
findObject
Return the 1-based result set index for the given column or id, or a non-positive number if the column is not contained in this result.- Throws:
SQLException
-
getLOBStreamInternal
protected InputStream getLOBStreamInternal(JDBCStore store, Object obj, Joins joins) throws SQLException - Overrides:
getLOBStreamInternalin classAbstractResult- Throws:
SQLException
-