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
ConstructorDescriptionResultSetResult
(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 boolean
absoluteInternal
(int row) Throws an exception by default.void
close()
Closes all eager results.protected boolean
containsInternal
(Object obj, Joins joins) Return whether this result contains data for the given id or column.protected int
findObject
(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 Array
getArrayInternal
(Object obj, Joins joins) protected InputStream
getAsciiStreamInternal
(Object obj, Joins joins) protected BigDecimal
getBigDecimalInternal
(Object obj, Joins joins) protected BigInteger
getBigIntegerInternal
(Object obj, Joins joins) protected InputStream
getBinaryStreamInternal
(Object obj, Joins joins) protected Blob
getBlobInternal
(Object obj, Joins joins) protected boolean
getBooleanInternal
(Object obj, Joins joins) protected byte
getByteInternal
(Object obj, Joins joins) protected byte[]
getBytesInternal
(Object obj, Joins joins) protected Calendar
getCalendarInternal
(Object obj, Joins joins) protected Reader
getCharacterStreamInternal
(Object obj, Joins joins) protected char
getCharInternal
(Object obj, Joins joins) protected Clob
getClobInternal
(Object obj, Joins joins) boolean
Whether to close the backing connection when this result is closed.protected Date
getDateInternal
(Object obj, Calendar cal, Joins joins) protected Date
getDateInternal
(Object obj, Joins joins) Return the dictionary in use.protected double
getDoubleInternal
(Object obj, Joins joins) protected float
getFloatInternal
(Object obj, Joins joins) protected int
getIntInternal
(Object obj, Joins joins) protected InputStream
getLOBStreamInternal
(JDBCStore store, Object obj, Joins joins) protected LocalDate
getLocalDateInternal
(Object obj, Joins joins) protected LocalDateTime
getLocalDateTimeInternal
(Object obj, Joins joins) protected Locale
getLocaleInternal
(Object obj, Joins joins) protected LocalTime
getLocalTimeInternal
(Object obj, Joins joins) protected long
getLongInternal
(Object obj, Joins joins) protected Number
getNumberInternal
(Object obj, Joins joins) protected Object
getObjectInternal
(Object obj, int metaTypeCode, Object arg, Joins joins) Return the value stored in the given id or column.protected OffsetDateTime
getOffsetDateTimeInternal
(Object obj, Joins joins) protected OffsetTime
getOffsetTimeInternal
(Object obj, Joins joins) protected Ref
getRefInternal
(Object obj, Map map, Joins joins) Return the backing result set.protected short
getShortInternal
(Object obj, Joins joins) protected Object
getSQLObjectInternal
(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 Object
getStreamInternal
(JDBCStore store, Object obj, int metaTypeCode, Object arg, Joins joins) protected String
getStringInternal
(Object obj, Joins joins, boolean isClobString) protected Time
getTimeInternal
(Object obj, Calendar cal, Joins joins) protected Timestamp
getTimestampInternal
(Object obj, Calendar cal, Joins joins) protected boolean
Advance this row.void
setCloseConnection
(boolean closeConn) Whether to close the backing connection when this result is closed.void
setCloseStatement
(boolean closeStatement) void
Optional store manager used to deserialize blobs containing references to persistent objects.int
size()
Return the number of rows in this result.boolean
Returns false by default.protected Object
Translate the user-given id or column.boolean
wasNull()
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:AbstractResult
Closes all eager results. -
supportsRandomAccess
Description copied from class:AbstractResult
Returns false by default.- Specified by:
supportsRandomAccess
in interfaceResult
- Overrides:
supportsRandomAccess
in classAbstractResult
- Throws:
SQLException
-
absoluteInternal
Description copied from class:AbstractResult
Throws an exception by default.- Overrides:
absoluteInternal
in classAbstractResult
- Throws:
SQLException
-
nextInternal
Description copied from class:AbstractResult
Advance this row.- Specified by:
nextInternal
in classAbstractResult
- Throws:
SQLException
-
size
Description copied from interface:Result
Return the number of rows in this result.- Throws:
SQLException
-
containsInternal
Description copied from class:AbstractResult
Return 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:
containsInternal
in classAbstractResult
- Throws:
SQLException
-
getArrayInternal
- Overrides:
getArrayInternal
in classAbstractResult
- Throws:
SQLException
-
getAsciiStreamInternal
- Overrides:
getAsciiStreamInternal
in classAbstractResult
- Throws:
SQLException
-
getBigDecimalInternal
- Overrides:
getBigDecimalInternal
in classAbstractResult
- Throws:
SQLException
-
getNumberInternal
- Overrides:
getNumberInternal
in classAbstractResult
- Throws:
SQLException
-
getBigIntegerInternal
- Overrides:
getBigIntegerInternal
in classAbstractResult
- Throws:
SQLException
-
getBinaryStreamInternal
- Overrides:
getBinaryStreamInternal
in classAbstractResult
- Throws:
SQLException
-
getBlobInternal
- Overrides:
getBlobInternal
in classAbstractResult
- Throws:
SQLException
-
getBooleanInternal
- Overrides:
getBooleanInternal
in classAbstractResult
- Throws:
SQLException
-
getByteInternal
- Overrides:
getByteInternal
in classAbstractResult
- Throws:
SQLException
-
getBytesInternal
- Overrides:
getBytesInternal
in classAbstractResult
- Throws:
SQLException
-
getCalendarInternal
- Overrides:
getCalendarInternal
in classAbstractResult
- Throws:
SQLException
-
getLocalDateInternal
- Overrides:
getLocalDateInternal
in classAbstractResult
- Throws:
SQLException
-
getLocalTimeInternal
- Overrides:
getLocalTimeInternal
in classAbstractResult
- Throws:
SQLException
-
getLocalDateTimeInternal
- Overrides:
getLocalDateTimeInternal
in classAbstractResult
- Throws:
SQLException
-
getOffsetTimeInternal
- Overrides:
getOffsetTimeInternal
in classAbstractResult
- Throws:
SQLException
-
getOffsetDateTimeInternal
- Overrides:
getOffsetDateTimeInternal
in classAbstractResult
- Throws:
SQLException
-
getCharInternal
- Overrides:
getCharInternal
in classAbstractResult
- Throws:
SQLException
-
getCharacterStreamInternal
- Overrides:
getCharacterStreamInternal
in classAbstractResult
- Throws:
SQLException
-
getClobInternal
- Overrides:
getClobInternal
in classAbstractResult
- Throws:
SQLException
-
getDateInternal
- Overrides:
getDateInternal
in classAbstractResult
- Throws:
SQLException
-
getDateInternal
- Overrides:
getDateInternal
in classAbstractResult
- Throws:
SQLException
-
getDoubleInternal
- Overrides:
getDoubleInternal
in classAbstractResult
- Throws:
SQLException
-
getFloatInternal
- Overrides:
getFloatInternal
in classAbstractResult
- Throws:
SQLException
-
getIntInternal
- Overrides:
getIntInternal
in classAbstractResult
- Throws:
SQLException
-
getLocaleInternal
- Overrides:
getLocaleInternal
in classAbstractResult
- Throws:
SQLException
-
getLongInternal
- Overrides:
getLongInternal
in classAbstractResult
- Throws:
SQLException
-
getStreamInternal
protected Object getStreamInternal(JDBCStore store, Object obj, int metaTypeCode, Object arg, Joins joins) throws SQLException - Specified by:
getStreamInternal
in classAbstractResult
- Throws:
SQLException
-
getObjectInternal
protected Object getObjectInternal(Object obj, int metaTypeCode, Object arg, Joins joins) throws SQLException Description copied from class:AbstractResult
Return the value stored in the given id or column.- Specified by:
getObjectInternal
in classAbstractResult
- Throws:
SQLException
-
getSQLObjectInternal
- Overrides:
getSQLObjectInternal
in classAbstractResult
- Throws:
SQLException
-
getRefInternal
- Overrides:
getRefInternal
in classAbstractResult
- Throws:
SQLException
-
getShortInternal
- Overrides:
getShortInternal
in classAbstractResult
- Throws:
SQLException
-
getStringInternal
protected String getStringInternal(Object obj, Joins joins, boolean isClobString) throws SQLException - Overrides:
getStringInternal
in classAbstractResult
- Throws:
SQLException
-
getTimeInternal
- Overrides:
getTimeInternal
in classAbstractResult
- Throws:
SQLException
-
getTimestampInternal
- Overrides:
getTimestampInternal
in classAbstractResult
- Throws:
SQLException
-
wasNull
Description copied from interface:Result
Return true if the last value fetched was null.- Specified by:
wasNull
in interfaceResult
- Overrides:
wasNull
in classAbstractResult
- Throws:
SQLException
-
translate
Description copied from class:AbstractResult
Translate the user-given id or column. This method is called before delegating to anyget*Internal
methods with the exception ofgetObjectInternal
. Return the original value by default.- Overrides:
translate
in 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:
getLOBStreamInternal
in classAbstractResult
- Throws:
SQLException
-