org.apache.openjpa.jdbc.sql
Class SelectImpl.SelectResult

java.lang.Object
  extended by org.apache.openjpa.jdbc.sql.AbstractResult
      extended by org.apache.openjpa.jdbc.sql.ResultSetResult
          extended by org.apache.openjpa.jdbc.sql.SelectImpl.SelectResult
All Implemented Interfaces:
Result, Closeable
Enclosing class:
SelectImpl

public static class SelectImpl.SelectResult
extends ResultSetResult

A Result implementation wrapped around this select.


Constructor Summary
SelectImpl.SelectResult(Connection conn, Statement stmnt, ResultSet rs, DBDictionary dict)
          Constructor.
 
Method Summary
protected  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.
 Joins crossJoin(Table localTable, Table foreignTable)
          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.
 Object getEager(FieldMapping key)
          The eager result for the given key, or null if none.
 SelectImpl getSelect()
          Select for this result.
 boolean isDirty()
          Return true if this instance has a path, any joins, or a variable.
 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()
          Return the maximum number of joins contained in this instance at any time.
 Joins 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()
          Return the set of Join elements, or null if none.
 Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
          Load a pc object using the given store manager.
 Joins newJoins()
          Returns a no-op joins object by default.
protected  boolean nextInternal()
          Advance this row.
 void nullJoins()
          Null the set of Join elements.
 Joins outerJoin(ForeignKey fk, boolean inverse, boolean toMany)
          Join the columns of the given foreign key.
 Joins 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.
 StringBuffer path()
          Return the relation path traversed by these joins, or null if none.
 void pushBack()
          Push back the last result.
 void putEager(FieldMapping key, Object res)
          The eager result for the given key, or null if none.
 org.apache.openjpa.jdbc.sql.PathJoins setOuter(boolean outer)
          Mark this as an outer joins set.
 void setSelect(SelectImpl sel)
          Select for this result.
 Joins setSubselect(String alias)
          Set the subquery alias.
 Joins 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, getLocaleInternal, getLongInternal, getNumberInternal, getObjectInternal, getRefInternal, getResultSet, getShortInternal, getSQLObjectInternal, getStatement, getStore, getStringInternal, getTimeInternal, getTimestampInternal, setCloseConnection, 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, getLocale, getLocale, getLong, getLong, getNumber, getNumber, getObject, getObject, getRef, getRef, getShort, getShort, getSQLObject, getSQLObject, getString, getString, getTime, getTime, getTimestamp, getTimestamp, indexOf, isLocking, load, next, setBaseMapping, setEagerMap, setIndexOf, setLocking, startDataRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectImpl.SelectResult

public SelectImpl.SelectResult(Connection conn,
                               Statement stmnt,
                               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 Object getEager(FieldMapping key)
Description copied from interface: Result
The eager result for the given key, or null if none.

Specified by:
getEager in interface Result
Overrides:
getEager in class AbstractResult

putEager

public void putEager(FieldMapping key,
                     Object res)
Description copied from interface: Result
The eager result for the given key, or null if none.

Specified by:
putEager in interface Result
Overrides:
putEager in class AbstractResult

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 interface Result
Overrides:
load in class AbstractResult
Throws:
SQLException

newJoins

public Joins newJoins()
Description copied from class: AbstractResult
Returns a no-op joins object by default.

Specified by:
newJoins in interface Result
Overrides:
newJoins in class AbstractResult

containsInternal

protected boolean containsInternal(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 through AbstractResult.translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins).

Overrides:
containsInternal in class ResultSetResult

containsAllInternal

protected boolean containsAllInternal(Object[] objs,
                                      Joins joins)
                               throws 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 through AbstractResult.translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins). Delegates to AbstractResult.containsInternal(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins) by default.

Overrides:
containsAllInternal in class AbstractResult
Throws:
SQLException

pushBack

public void pushBack()
              throws SQLException
Description copied from interface: Result
Push back the last result. In other words, just ignore the next call to Result.next(). After the first time this method is called, additional calls before a call to Result.next() or Result.absolute(int) should have no further affect.

Specified by:
pushBack in interface Result
Overrides:
pushBack in class AbstractResult
Throws:
SQLException

absoluteInternal

protected boolean absoluteInternal(int row)
                            throws SQLException
Description copied from class: AbstractResult
Throws an exception by default.

Overrides:
absoluteInternal in class ResultSetResult
Throws:
SQLException

nextInternal

protected boolean nextInternal()
                        throws SQLException
Description copied from class: AbstractResult
Advance this row.

Overrides:
nextInternal in class ResultSetResult
Throws:
SQLException

findObject

protected int findObject(Object obj,
                         Joins joins)
                  throws 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 class ResultSetResult
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)
Mark this as an outer joins set.


isDirty

public boolean isDirty()
Return true if this instance has a path, any joins, or a variable.


path

public StringBuffer path()
Return the relation path traversed by these joins, or null if none.


joins

public org.apache.openjpa.jdbc.sql.JoinSet joins()
Return the set of Join elements, or null if none.


joinCount

public int joinCount()
Return the maximum number of joins contained in this instance at any time.


nullJoins

public void nullJoins()
Null the set of Join elements.


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(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.


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.


setVariable

public Joins setVariable(String var)
Description copied from interface: Joins
Set the variable name being traversed into with the next join.


setSubselect

public Joins setSubselect(String alias)
Description copied from interface: Joins
Set the subquery alias.



Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.