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
public static class SelectImpl.SelectResult extends ResultSetResult
AResult
implementation wrapped around this select.
-
-
Constructor Summary
Constructors Constructor Description SelectResult(java.sql.Connection conn, java.sql.Statement stmnt, java.sql.ResultSet rs, DBDictionary dict)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
absoluteInternal(int row)
Throws an exception by default.protected boolean
containsAllInternal(java.lang.Object[] objs, Joins joins)
Return whether this result contains data for all the given ids or columns.protected boolean
containsInternal(java.lang.Object obj, Joins joins)
Return whether this result contains data for the given id or column.Joins
crossJoin(Table localTable, Table foreignTable)
Perform a cross join on the given tables.protected int
findObject(java.lang.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.java.lang.String
getCorrelatedVariable()
Return correlated variable namejava.lang.Object
getEager(FieldMapping key)
The eager result for the given key, or null if none.java.lang.String
getPathStr()
SelectImpl
getSelect()
Select for this result.boolean
isDirty()
boolean
isEmpty()
Whether we have any joins.boolean
isOuter()
Whether this joins path results in outer joins.Joins
join(ForeignKey fk, boolean inverse, boolean toMany)
Join the columns of the given foreign key.int
joinCount()
Joins
joinRelation(java.lang.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()
java.lang.Object
load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
Load a pc object using the given store manager.void
moveJoinsToParent()
Move joins that belong to subquery's parentJoins
newJoins()
Returns a no-op joins object by default.protected boolean
nextInternal()
Advance this row.void
nullJoins()
Joins
outerJoin(ForeignKey fk, boolean inverse, boolean toMany)
Join the columns of the given foreign key.Joins
outerJoinRelation(java.lang.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.java.lang.StringBuilder
path()
void
pushBack()
Push back the last result.void
putEager(FieldMapping key, java.lang.Object res)
The eager result for the given key, or null if none.Joins
setCorrelatedVariable(java.lang.String var)
Set the correlated variable name being traversed into with the next join.Joins
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.Joins
setSubselect(java.lang.String alias)
Set the subquery alias.Joins
setVariable(java.lang.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 Detail
-
SelectResult
public SelectResult(java.sql.Connection conn, java.sql.Statement stmnt, java.sql.ResultSet rs, DBDictionary dict)
Constructor.
-
-
Method Detail
-
getSelect
public SelectImpl getSelect()
Select for this result.
-
setSelect
public void setSelect(SelectImpl sel)
Select for this result.
-
getEager
public java.lang.Object getEager(FieldMapping key)
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
public void putEager(FieldMapping key, java.lang.Object res)
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 java.lang.Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) throws java.sql.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:
java.sql.SQLException
-
newJoins
public Joins newJoins()
Description copied from class:AbstractResult
Returns a no-op joins object by default.- Specified by:
newJoins
in interfaceResult
- Overrides:
newJoins
in classAbstractResult
-
containsInternal
protected boolean containsInternal(java.lang.Object obj, Joins joins)
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
protected boolean containsAllInternal(java.lang.Object[] objs, Joins joins) throws java.sql.SQLException
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:
java.sql.SQLException
-
pushBack
public void pushBack() throws java.sql.SQLException
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:
java.sql.SQLException
-
absoluteInternal
protected boolean absoluteInternal(int row) throws java.sql.SQLException
Description copied from class:AbstractResult
Throws an exception by default.- Overrides:
absoluteInternal
in classResultSetResult
- Throws:
java.sql.SQLException
-
nextInternal
protected boolean nextInternal() throws java.sql.SQLException
Description copied from class:AbstractResult
Advance this row.- Overrides:
nextInternal
in classResultSetResult
- Throws:
java.sql.SQLException
-
findObject
protected int findObject(java.lang.Object obj, Joins joins) throws java.sql.SQLException
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:
java.sql.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
public java.lang.StringBuilder path()
-
getPathStr
public java.lang.String 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
public Joins crossJoin(Table localTable, Table foreignTable)
Description copied from interface:Joins
Perform a cross join on the given tables.
-
join
public Joins join(ForeignKey fk, boolean inverse, boolean toMany)
Description copied from interface:Joins
Join the columns of the given foreign key.
-
outerJoin
public Joins outerJoin(ForeignKey fk, boolean inverse, boolean toMany)
Description copied from interface:Joins
Join the columns of the given foreign key.
-
joinRelation
public Joins joinRelation(java.lang.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(java.lang.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
public Joins setVariable(java.lang.String var)
Description copied from interface:Joins
Set the variable name being traversed into with the next join.- Specified by:
setVariable
in interfaceJoins
-
setSubselect
public Joins setSubselect(java.lang.String alias)
Description copied from interface:Joins
Set the subquery alias.- Specified by:
setSubselect
in interfaceJoins
-
setCorrelatedVariable
public Joins setCorrelatedVariable(java.lang.String var)
Description copied from interface:Joins
Set the correlated variable name being traversed into with the next join.- Specified by:
setCorrelatedVariable
in interfaceJoins
-
setJoinContext
public Joins setJoinContext(Context ctx)
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
-
getCorrelatedVariable
public java.lang.String getCorrelatedVariable()
Description copied from interface:Joins
Return correlated variable name- Specified by:
getCorrelatedVariable
in interfaceJoins
-
moveJoinsToParent
public void moveJoinsToParent()
Description copied from interface:Joins
Move joins that belong to subquery's parent- Specified by:
moveJoinsToParent
in interfaceJoins
-
-