Package org.apache.openjpa.jdbc.sql
Class SelectImpl.SelectResult
java.lang.Object
org.apache.openjpa.jdbc.sql.AbstractResult
org.apache.openjpa.jdbc.sql.ResultSetResult
org.apache.openjpa.jdbc.sql.SelectImpl.SelectResult
- Enclosing class:
- SelectImpl
A
Result
implementation wrapped around this select.-
Constructor Summary
ConstructorDescriptionSelectResult
(Connection conn, Statement stmnt, ResultSet rs, DBDictionary dict) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
absoluteInternal
(int row) Throws an exception by default.protected boolean
containsAllInternal
(Object[] objs, Joins joins) Return whether this result contains data for all the given ids or columns.protected boolean
containsInternal
(Object obj, Joins joins) Return whether this result contains data for the given id or column.Perform a cross join on the given tables.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.Return correlated variable namegetEager
(FieldMapping key) The eager result for the given key, or null if none.Select for this result.boolean
isDirty()
boolean
isEmpty()
Whether we have any joins.boolean
isOuter()
Whether this joins path results in outer joins.join
(ForeignKey fk, boolean inverse, boolean toMany) Join the columns of the given foreign key.int
joinRelation
(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany) Join the columns of the given foreign key, which represents a relation via the given field name.org.apache.openjpa.jdbc.sql.JoinSet
joins()
load
(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) Load a pc object using the given store manager.void
Move joins that belong to subquery's parentnewJoins()
Returns a no-op joins object by default.protected boolean
Advance this row.void
outerJoin
(ForeignKey fk, boolean inverse, boolean toMany) Join the columns of the given foreign key.outerJoinRelation
(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany) Join the columns of the given foreign key, which represents a relation via the given field name.path()
void
pushBack()
Push back the last result.void
putEager
(FieldMapping key, Object res) The eager result for the given key, or null if none.Set the correlated variable name being traversed into with the next join.setJoinContext
(Context ctx) Set subquery context when traversing into the next join is in transition from parent context to subquery.org.apache.openjpa.jdbc.sql.PathJoins
setOuter
(boolean outer) void
setSelect
(SelectImpl sel) Select for this result.setSubselect
(String alias) Set the subquery alias.setVariable
(String var) Set the variable name being traversed into with the next join.Methods inherited from class org.apache.openjpa.jdbc.sql.ResultSetResult
close, getArrayInternal, getAsciiStreamInternal, getBigDecimalInternal, getBigIntegerInternal, getBinaryStreamInternal, getBlobInternal, getBooleanInternal, getByteInternal, getBytesInternal, getCalendarInternal, getCharacterStreamInternal, getCharInternal, getClobInternal, getCloseConnection, getDateInternal, getDateInternal, getDBDictionary, getDoubleInternal, getFloatInternal, getIntInternal, getLOBStreamInternal, getLocalDateInternal, getLocalDateTimeInternal, getLocaleInternal, getLocalTimeInternal, getLongInternal, getNumberInternal, getObjectInternal, getOffsetDateTimeInternal, getOffsetTimeInternal, getRefInternal, getResultSet, getShortInternal, getSQLObjectInternal, getStatement, getStore, getStreamInternal, getStringInternal, getTimeInternal, getTimestampInternal, setCloseConnection, setCloseStatement, setStore, size, supportsRandomAccess, translate, wasNull
Methods inherited from class org.apache.openjpa.jdbc.sql.AbstractResult
absolute, checkNull, closeEagerMap, contains, contains, containsAll, containsAll, 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, 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, next, setBaseMapping, setEagerMap, setIndexOf, setLocking, setMappedByFieldMapping, setMappedByValue, startDataRequest
-
Constructor Details
-
SelectResult
Constructor.
-
-
Method Details
-
getSelect
Select for this result. -
setSelect
Select for this result. -
getEager
Description copied from interface:Result
The eager result for the given key, or null if none.- Specified by:
getEager
in interfaceResult
- Overrides:
getEager
in classAbstractResult
-
putEager
Description copied from interface:Result
The eager result for the given key, or null if none.- Specified by:
putEager
in interfaceResult
- Overrides:
putEager
in classAbstractResult
-
load
public Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) throws SQLException Description copied from interface:Result
Load a pc object using the given store manager.- Specified by:
load
in interfaceResult
- Overrides:
load
in classAbstractResult
- Throws:
SQLException
-
newJoins
Description copied from class:AbstractResult
Returns a no-op joins object by default.- Specified by:
newJoins
in interfaceResult
- Overrides:
newJoins
in classAbstractResult
-
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)
.- Overrides:
containsInternal
in classResultSetResult
-
containsAllInternal
Description copied from class:AbstractResult
Return whether this result contains data for all the given ids or columns. The ids or columns have not been passed throughAbstractResult.translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins)
. Delegates toAbstractResult.containsInternal(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins)
by default.- Overrides:
containsAllInternal
in classAbstractResult
- Throws:
SQLException
-
pushBack
Description copied from interface:Result
Push back the last result. In other words, just ignore the next call toResult.next()
. After the first time this method is called, additional calls before a call toResult.next()
orResult.absolute(int)
should have no further affect.- Specified by:
pushBack
in interfaceResult
- Overrides:
pushBack
in classAbstractResult
- Throws:
SQLException
-
absoluteInternal
Description copied from class:AbstractResult
Throws an exception by default.- Overrides:
absoluteInternal
in classResultSetResult
- Throws:
SQLException
-
nextInternal
Description copied from class:AbstractResult
Advance this row.- Overrides:
nextInternal
in classResultSetResult
- Throws:
SQLException
-
findObject
Description copied from class:ResultSetResult
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.- Overrides:
findObject
in classResultSetResult
- Throws:
SQLException
-
isOuter
public boolean isOuter()Description copied from interface:Joins
Whether this joins path results in outer joins. -
setOuter
public org.apache.openjpa.jdbc.sql.PathJoins setOuter(boolean outer) -
isDirty
public boolean isDirty() -
path
-
getPathStr
-
joins
public org.apache.openjpa.jdbc.sql.JoinSet joins() -
joinCount
public int joinCount() -
nullJoins
public void nullJoins() -
isEmpty
public boolean isEmpty()Description copied from interface:Joins
Whether we have any joins. -
crossJoin
Description copied from interface:Joins
Perform a cross join on the given tables. -
join
Description copied from interface:Joins
Join the columns of the given foreign key. -
outerJoin
Description copied from interface:Joins
Join the columns of the given foreign key. -
joinRelation
public Joins joinRelation(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany) Description copied from interface:Joins
Join the columns of the given foreign key, which represents a relation via the given field name.- Specified by:
joinRelation
in interfaceJoins
-
outerJoinRelation
public Joins outerJoinRelation(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany) Description copied from interface:Joins
Join the columns of the given foreign key, which represents a relation via the given field name.- Specified by:
outerJoinRelation
in interfaceJoins
-
setVariable
Description copied from interface:Joins
Set the variable name being traversed into with the next join.- Specified by:
setVariable
in interfaceJoins
-
setSubselect
Description copied from interface:Joins
Set the subquery alias.- Specified by:
setSubselect
in interfaceJoins
-
setJoinContext
Description copied from interface:Joins
Set subquery context when traversing into the next join is in transition from parent context to subquery.- Specified by:
setJoinContext
in interfaceJoins
-
moveJoinsToParent
public void moveJoinsToParent()Description copied from interface:Joins
Move joins that belong to subquery's parent- Specified by:
moveJoinsToParent
in interfaceJoins
-