|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.sql.MergedResult
public class MergedResult
Result that merges multiple result delegates. Support exists for maintaining ordering of the internally-held results, provided that each of the individual results is itself ordered.
Nested Class Summary | |
---|---|
static interface |
MergedResult.ResultComparator
Comparator for ordering result rows. |
Constructor Summary | |
---|---|
MergedResult(Result[] res)
Constructor; supply delegates. |
|
MergedResult(Result[] res,
MergedResult.ResultComparator comp)
Constructor; supply delegates and comparator for ordering results. |
Method Summary | |
---|---|
boolean |
absolute(int row)
Move to the given 0-based row in the result, or return false if the row does not exist. |
void |
close()
Free the resources used by this result; do not close the SQL connection. |
boolean |
contains(Column col,
Joins joins)
Return true if the given column is available in the result. |
boolean |
contains(Object obj)
Return true if the given id or column is available in the result. |
boolean |
containsAll(Column[] cols,
Joins joins)
Return true if all the given columns are available in the result. |
boolean |
containsAll(Object[] objs)
Return true if all the given ids or columns are available in the result. |
void |
endDataRequest()
Ends a data request. |
Array |
getArray(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Array |
getArray(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
InputStream |
getAsciiStream(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
InputStream |
getAsciiStream(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
ClassMapping |
getBaseMapping()
If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row. |
BigDecimal |
getBigDecimal(Column col,
Joins joins)
Return the value stored in the given column. |
BigDecimal |
getBigDecimal(Object obj)
Return the value stored in the given column or id. |
BigInteger |
getBigInteger(Column col,
Joins joins)
Return the value stored in the given column. |
BigInteger |
getBigInteger(Object obj)
Return the value stored in the given column or id. |
InputStream |
getBinaryStream(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
InputStream |
getBinaryStream(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
Blob |
getBlob(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Blob |
getBlob(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
boolean |
getBoolean(Column col,
Joins joins)
Return the value stored in the given column. |
boolean |
getBoolean(Object obj)
Return the value stored in the given column or id. |
byte |
getByte(Column col,
Joins joins)
Return the value stored in the given column. |
byte |
getByte(Object obj)
Return the value stored in the given column or id. |
byte[] |
getBytes(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
byte[] |
getBytes(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
Calendar |
getCalendar(Column col,
Joins joins)
Return the value stored in the given column. |
Calendar |
getCalendar(Object obj)
Return the value stored in the given column or id. |
char |
getChar(Column col,
Joins joins)
Return the value stored in the given column. |
char |
getChar(Object obj)
Return the value stored in the given column or id. |
Reader |
getCharacterStream(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Reader |
getCharacterStream(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
Clob |
getClob(Column col,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Clob |
getClob(Object obj)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
Date |
getDate(Column col,
Calendar cal,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Date |
getDate(Column col,
Joins joins)
Return the value stored in the given column. |
Date |
getDate(Object obj)
Return the value stored in the given column or id. |
Date |
getDate(Object obj,
Calendar cal)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
double |
getDouble(Column col,
Joins joins)
Return the value stored in the given column. |
double |
getDouble(Object obj)
Return the value stored in the given column or id. |
Object |
getEager(FieldMapping key)
The eager result for the given key, or null if none. |
float |
getFloat(Column col,
Joins joins)
Return the value stored in the given column. |
float |
getFloat(Object obj)
Return the value stored in the given column or id. |
int |
getInt(Column col,
Joins joins)
Return the value stored in the given column. |
int |
getInt(Object obj)
Return the value stored in the given column or id. |
InputStream |
getLOBStream(JDBCStore store,
Object obj)
|
Locale |
getLocale(Column col,
Joins joins)
Return the value stored in the given column. |
Locale |
getLocale(Object obj)
Return the value stored in the given column or id. |
long |
getLong(Column col,
Joins joins)
Return the value stored in the given column. |
long |
getLong(Object obj)
Return the value stored in the given column or id. |
FieldMapping |
getMappedByFieldMapping()
If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship. |
Object |
getMappedByValue()
If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship. |
Number |
getNumber(Column col,
Joins joins)
Return the value stored in the given column. |
Number |
getNumber(Object obj)
Return the value stored in the given column or id. |
Object |
getObject(Column col,
Object arg,
Joins joins)
Return the value stored in the given column. |
Object |
getObject(Object obj,
int metaType,
Object arg)
Return the value stored in the given column or id. |
Ref |
getRef(Column col,
Map map,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Ref |
getRef(Object obj,
Map map)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
short |
getShort(Column col,
Joins joins)
Return the value stored in the given column. |
short |
getShort(Object obj)
Return the value stored in the given column or id. |
Object |
getSQLObject(Column col,
Map map,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Object |
getSQLObject(Object obj,
Map map)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
String |
getString(Column col,
Joins joins)
Return the value stored in the given column. |
String |
getString(Object obj)
Return the value stored in the given column or id. |
Time |
getTime(Column col,
Calendar cal,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Time |
getTime(Object obj,
Calendar cal)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
Timestamp |
getTimestamp(Column col,
Calendar cal,
Joins joins)
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set. |
Timestamp |
getTimestamp(Object obj,
Calendar cal)
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set. |
int |
indexOf()
The index of the select within the UNION that the current row corresponds to, or 0. |
boolean |
isLocking()
If true, then any results loaded from this Result will be locked in the database. |
Object |
load(ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load a pc object using the given store manager. |
Object |
load(ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch,
Joins joins)
Load a pc object using the given store manager. |
Joins |
newJoins()
Return a new joins instance to use for traversing to related data. |
boolean |
next()
Advance to the next row, or return false if there are no more rows in the result. |
void |
pushBack()
Push back the last result. |
void |
putEager(FieldMapping key,
Object res)
The eager result for the given key, or null if none. |
void |
setBaseMapping(ClassMapping mapping)
If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row. |
void |
setMappedByFieldMapping(FieldMapping fieldMapping)
If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship. |
void |
setMappedByValue(Object mappedByValue)
If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship. |
int |
size()
Return the number of rows in this result. |
void |
startDataRequest(Object mapping)
Informs this receiver about the application element for which a subsequent data request will be made. |
boolean |
supportsRandomAccess()
Return true if the result supports random access. |
boolean |
wasNull()
Return true if the last value fetched was null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MergedResult(Result[] res)
public MergedResult(Result[] res, MergedResult.ResultComparator comp)
Method Detail |
---|
public Object getEager(FieldMapping key)
Result
getEager
in interface Result
public void putEager(FieldMapping key, Object res)
Result
putEager
in interface Result
public Joins newJoins()
Result
newJoins
in interface Result
public void close()
Result
close
in interface Result
close
in interface Closeable
public boolean isLocking()
Result
isLocking
in interface Result
public boolean supportsRandomAccess() throws SQLException
Result
supportsRandomAccess
in interface Result
SQLException
public boolean absolute(int row) throws SQLException
Result
absolute
in interface Result
SQLException
public boolean next() throws SQLException
Result
next
in interface Result
SQLException
public void pushBack() throws SQLException
Result
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.
pushBack
in interface Result
SQLException
public int size() throws SQLException
Result
size
in interface Result
SQLException
public boolean contains(Object obj) throws SQLException
Result
contains
in interface Result
SQLException
public boolean containsAll(Object[] objs) throws SQLException
Result
containsAll
in interface Result
SQLException
public boolean contains(Column col, Joins joins) throws SQLException
Result
contains
in interface Result
SQLException
public boolean containsAll(Column[] cols, Joins joins) throws SQLException
Result
containsAll
in interface Result
SQLException
public ClassMapping getBaseMapping()
Result
getBaseMapping
in interface Result
public void setBaseMapping(ClassMapping mapping)
Result
setBaseMapping
in interface Result
public FieldMapping getMappedByFieldMapping()
Result
getMappedByFieldMapping
in interface Result
public void setMappedByFieldMapping(FieldMapping fieldMapping)
Result
setMappedByFieldMapping
in interface Result
public Object getMappedByValue()
Result
getMappedByValue
in interface Result
public void setMappedByValue(Object mappedByValue)
Result
setMappedByValue
in interface Result
public int indexOf()
Result
indexOf
in interface Result
public Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
Result
load
in interface Result
SQLException
public Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) throws SQLException
Result
load
in interface Result
SQLException
public Array getArray(Object obj) throws SQLException
Result
getArray
in interface Result
SQLException
public InputStream getAsciiStream(Object obj) throws SQLException
Result
getAsciiStream
in interface Result
SQLException
public BigDecimal getBigDecimal(Object obj) throws SQLException
Result
getBigDecimal
in interface Result
SQLException
public BigInteger getBigInteger(Object obj) throws SQLException
Result
getBigInteger
in interface Result
SQLException
public InputStream getBinaryStream(Object obj) throws SQLException
Result
getBinaryStream
in interface Result
SQLException
public InputStream getLOBStream(JDBCStore store, Object obj) throws SQLException
getLOBStream
in interface Result
SQLException
public Blob getBlob(Object obj) throws SQLException
Result
getBlob
in interface Result
SQLException
public boolean getBoolean(Object obj) throws SQLException
Result
getBoolean
in interface Result
SQLException
public byte getByte(Object obj) throws SQLException
Result
getByte
in interface Result
SQLException
public byte[] getBytes(Object obj) throws SQLException
Result
getBytes
in interface Result
SQLException
public Calendar getCalendar(Object obj) throws SQLException
Result
getCalendar
in interface Result
SQLException
public char getChar(Object obj) throws SQLException
Result
getChar
in interface Result
SQLException
public Reader getCharacterStream(Object obj) throws SQLException
Result
getCharacterStream
in interface Result
SQLException
public Clob getClob(Object obj) throws SQLException
Result
getClob
in interface Result
SQLException
public Date getDate(Object obj) throws SQLException
Result
getDate
in interface Result
SQLException
public Date getDate(Object obj, Calendar cal) throws SQLException
Result
getDate
in interface Result
SQLException
public double getDouble(Object obj) throws SQLException
Result
getDouble
in interface Result
SQLException
public float getFloat(Object obj) throws SQLException
Result
getFloat
in interface Result
SQLException
public int getInt(Object obj) throws SQLException
Result
getInt
in interface Result
SQLException
public Locale getLocale(Object obj) throws SQLException
Result
getLocale
in interface Result
SQLException
public long getLong(Object obj) throws SQLException
Result
getLong
in interface Result
SQLException
public Number getNumber(Object obj) throws SQLException
Result
getNumber
in interface Result
SQLException
public Object getObject(Object obj, int metaType, Object arg) throws SQLException
Result
getObject
in interface Result
obj
- the column or id whose data to fetchmetaType
- the type code from JavaTypes
or
JavaSQLTypes
for the type of the data; if
obj
is a column, you may specify -1
to use the column's recorded java typearg
- some JDBC data access methods use an argument, such
as a Calendar
or Map
SQLException
public Object getSQLObject(Object obj, Map map) throws SQLException
Result
getSQLObject
in interface Result
SQLException
public Ref getRef(Object obj, Map map) throws SQLException
Result
getRef
in interface Result
SQLException
public short getShort(Object obj) throws SQLException
Result
getShort
in interface Result
SQLException
public String getString(Object obj) throws SQLException
Result
getString
in interface Result
SQLException
public Time getTime(Object obj, Calendar cal) throws SQLException
Result
getTime
in interface Result
SQLException
public Timestamp getTimestamp(Object obj, Calendar cal) throws SQLException
Result
getTimestamp
in interface Result
SQLException
public Array getArray(Column col, Joins joins) throws SQLException
Result
getArray
in interface Result
SQLException
public InputStream getAsciiStream(Column col, Joins joins) throws SQLException
Result
getAsciiStream
in interface Result
SQLException
public BigDecimal getBigDecimal(Column col, Joins joins) throws SQLException
Result
getBigDecimal
in interface Result
SQLException
public BigInteger getBigInteger(Column col, Joins joins) throws SQLException
Result
getBigInteger
in interface Result
SQLException
public InputStream getBinaryStream(Column col, Joins joins) throws SQLException
Result
getBinaryStream
in interface Result
SQLException
public Blob getBlob(Column col, Joins joins) throws SQLException
Result
getBlob
in interface Result
SQLException
public boolean getBoolean(Column col, Joins joins) throws SQLException
Result
getBoolean
in interface Result
SQLException
public byte getByte(Column col, Joins joins) throws SQLException
Result
getByte
in interface Result
SQLException
public byte[] getBytes(Column col, Joins joins) throws SQLException
Result
getBytes
in interface Result
SQLException
public Calendar getCalendar(Column col, Joins joins) throws SQLException
Result
getCalendar
in interface Result
SQLException
public char getChar(Column col, Joins joins) throws SQLException
Result
getChar
in interface Result
SQLException
public Reader getCharacterStream(Column col, Joins joins) throws SQLException
Result
getCharacterStream
in interface Result
SQLException
public Clob getClob(Column col, Joins joins) throws SQLException
Result
getClob
in interface Result
SQLException
public Date getDate(Column col, Joins joins) throws SQLException
Result
getDate
in interface Result
SQLException
public Date getDate(Column col, Calendar cal, Joins joins) throws SQLException
Result
getDate
in interface Result
SQLException
public double getDouble(Column col, Joins joins) throws SQLException
Result
getDouble
in interface Result
SQLException
public float getFloat(Column col, Joins joins) throws SQLException
Result
getFloat
in interface Result
SQLException
public int getInt(Column col, Joins joins) throws SQLException
Result
getInt
in interface Result
SQLException
public Locale getLocale(Column col, Joins joins) throws SQLException
Result
getLocale
in interface Result
SQLException
public long getLong(Column col, Joins joins) throws SQLException
Result
getLong
in interface Result
SQLException
public Number getNumber(Column col, Joins joins) throws SQLException
Result
getNumber
in interface Result
SQLException
public Object getObject(Column col, Object arg, Joins joins) throws SQLException
Result
getObject
in interface Result
col
- the column whose data to fetcharg
- some JDBC data access methods use an argument, such
as a Calendar
or Map
SQLException
public Object getSQLObject(Column col, Map map, Joins joins) throws SQLException
Result
getSQLObject
in interface Result
SQLException
public Ref getRef(Column col, Map map, Joins joins) throws SQLException
Result
getRef
in interface Result
SQLException
public short getShort(Column col, Joins joins) throws SQLException
Result
getShort
in interface Result
SQLException
public String getString(Column col, Joins joins) throws SQLException
Result
getString
in interface Result
SQLException
public Time getTime(Column col, Calendar cal, Joins joins) throws SQLException
Result
getTime
in interface Result
SQLException
public Timestamp getTimestamp(Column col, Calendar cal, Joins joins) throws SQLException
Result
getTimestamp
in interface Result
SQLException
public boolean wasNull() throws SQLException
Result
wasNull
in interface Result
SQLException
public void startDataRequest(Object mapping)
Result
startDataRequest
in interface Result
public void endDataRequest()
Result
Result.startDataRequest(java.lang.Object)
. The calls can be nested as follwsstartDataRequest (relation); startDataRequest (relationsField); getObject("COLUMN_Y"); endDataRequest (); endDataRequest ();
endDataRequest
in interface Result
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |