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
AResultimplementation 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 booleanabsoluteInternal(int row)Throws an exception by default.protected booleancontainsAllInternal(java.lang.Object[] objs, Joins joins)Return whether this result contains data for all the given ids or columns.protected booleancontainsInternal(java.lang.Object obj, Joins joins)Return whether this result contains data for the given id or column.JoinscrossJoin(Table localTable, Table foreignTable)Perform a cross join on the given tables.protected intfindObject(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.StringgetCorrelatedVariable()Return correlated variable namejava.lang.ObjectgetEager(FieldMapping key)The eager result for the given key, or null if none.java.lang.StringgetPathStr()SelectImplgetSelect()Select for this result.booleanisDirty()booleanisEmpty()Whether we have any joins.booleanisOuter()Whether this joins path results in outer joins.Joinsjoin(ForeignKey fk, boolean inverse, boolean toMany)Join the columns of the given foreign key.intjoinCount()JoinsjoinRelation(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.JoinSetjoins()java.lang.Objectload(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)Load a pc object using the given store manager.voidmoveJoinsToParent()Move joins that belong to subquery's parentJoinsnewJoins()Returns a no-op joins object by default.protected booleannextInternal()Advance this row.voidnullJoins()JoinsouterJoin(ForeignKey fk, boolean inverse, boolean toMany)Join the columns of the given foreign key.JoinsouterJoinRelation(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.StringBuilderpath()voidpushBack()Push back the last result.voidputEager(FieldMapping key, java.lang.Object res)The eager result for the given key, or null if none.JoinssetCorrelatedVariable(java.lang.String var)Set the correlated variable name being traversed into with the next join.JoinssetJoinContext(Context ctx)Set subquery context when traversing into the next join is in transition from parent context to subquery.org.apache.openjpa.jdbc.sql.PathJoinssetOuter(boolean outer)voidsetSelect(SelectImpl sel)Select for this result.JoinssetSubselect(java.lang.String alias)Set the subquery alias.JoinssetVariable(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:ResultThe eager result for the given key, or null if none.- Specified by:
getEagerin interfaceResult- Overrides:
getEagerin classAbstractResult
-
putEager
public void putEager(FieldMapping key, java.lang.Object res)
Description copied from interface:ResultThe eager result for the given key, or null if none.- Specified by:
putEagerin interfaceResult- Overrides:
putEagerin classAbstractResult
-
load
public java.lang.Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) throws java.sql.SQLException
Description copied from interface:ResultLoad a pc object using the given store manager.- Specified by:
loadin interfaceResult- Overrides:
loadin classAbstractResult- Throws:
java.sql.SQLException
-
newJoins
public Joins newJoins()
Description copied from class:AbstractResultReturns a no-op joins object by default.- Specified by:
newJoinsin interfaceResult- Overrides:
newJoinsin classAbstractResult
-
containsInternal
protected boolean containsInternal(java.lang.Object obj, Joins joins)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).- Overrides:
containsInternalin classResultSetResult
-
containsAllInternal
protected boolean containsAllInternal(java.lang.Object[] objs, Joins joins) throws java.sql.SQLExceptionDescription copied from class:AbstractResultReturn 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:
containsAllInternalin classAbstractResult- Throws:
java.sql.SQLException
-
pushBack
public void pushBack() throws java.sql.SQLExceptionDescription copied from interface:ResultPush 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:
pushBackin interfaceResult- Overrides:
pushBackin classAbstractResult- Throws:
java.sql.SQLException
-
absoluteInternal
protected boolean absoluteInternal(int row) throws java.sql.SQLExceptionDescription copied from class:AbstractResultThrows an exception by default.- Overrides:
absoluteInternalin classResultSetResult- Throws:
java.sql.SQLException
-
nextInternal
protected boolean nextInternal() throws java.sql.SQLExceptionDescription copied from class:AbstractResultAdvance this row.- Overrides:
nextInternalin classResultSetResult- Throws:
java.sql.SQLException
-
findObject
protected int findObject(java.lang.Object obj, Joins joins) throws java.sql.SQLExceptionDescription copied from class:ResultSetResultReturn 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:
findObjectin classResultSetResult- Throws:
java.sql.SQLException
-
isOuter
public boolean isOuter()
Description copied from interface:JoinsWhether 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:JoinsWhether we have any joins.
-
crossJoin
public Joins crossJoin(Table localTable, Table foreignTable)
Description copied from interface:JoinsPerform a cross join on the given tables.
-
join
public Joins join(ForeignKey fk, boolean inverse, boolean toMany)
Description copied from interface:JoinsJoin the columns of the given foreign key.
-
outerJoin
public Joins outerJoin(ForeignKey fk, boolean inverse, boolean toMany)
Description copied from interface:JoinsJoin 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:JoinsJoin the columns of the given foreign key, which represents a relation via the given field name.- Specified by:
joinRelationin interfaceJoins
-
outerJoinRelation
public Joins outerJoinRelation(java.lang.String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany)
Description copied from interface:JoinsJoin the columns of the given foreign key, which represents a relation via the given field name.- Specified by:
outerJoinRelationin interfaceJoins
-
setVariable
public Joins setVariable(java.lang.String var)
Description copied from interface:JoinsSet the variable name being traversed into with the next join.- Specified by:
setVariablein interfaceJoins
-
setSubselect
public Joins setSubselect(java.lang.String alias)
Description copied from interface:JoinsSet the subquery alias.- Specified by:
setSubselectin interfaceJoins
-
setCorrelatedVariable
public Joins setCorrelatedVariable(java.lang.String var)
Description copied from interface:JoinsSet the correlated variable name being traversed into with the next join.- Specified by:
setCorrelatedVariablein interfaceJoins
-
setJoinContext
public Joins setJoinContext(Context ctx)
Description copied from interface:JoinsSet subquery context when traversing into the next join is in transition from parent context to subquery.- Specified by:
setJoinContextin interfaceJoins
-
getCorrelatedVariable
public java.lang.String getCorrelatedVariable()
Description copied from interface:JoinsReturn correlated variable name- Specified by:
getCorrelatedVariablein interfaceJoins
-
moveJoinsToParent
public void moveJoinsToParent()
Description copied from interface:JoinsMove joins that belong to subquery's parent- Specified by:
moveJoinsToParentin interfaceJoins
-
-