|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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(java.lang.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(java.lang.Object[] objs)
Return true if all the given ids or columns are available in the result. |
void |
endDataRequest()
Ends a data request. |
java.sql.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. |
java.sql.Array |
getArray(java.lang.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. |
java.io.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. |
java.io.InputStream |
getAsciiStream(java.lang.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. |
java.math.BigDecimal |
getBigDecimal(Column col,
Joins joins)
Return the value stored in the given column. |
java.math.BigDecimal |
getBigDecimal(java.lang.Object obj)
Return the value stored in the given column or id. |
java.math.BigInteger |
getBigInteger(Column col,
Joins joins)
Return the value stored in the given column. |
java.math.BigInteger |
getBigInteger(java.lang.Object obj)
Return the value stored in the given column or id. |
java.io.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. |
java.io.InputStream |
getBinaryStream(java.lang.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. |
java.sql.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. |
java.sql.Blob |
getBlob(java.lang.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(java.lang.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(java.lang.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(java.lang.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. |
java.util.Calendar |
getCalendar(Column col,
Joins joins)
Return the value stored in the given column. |
java.util.Calendar |
getCalendar(java.lang.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(java.lang.Object obj)
Return the value stored in the given column or id. |
java.io.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. |
java.io.Reader |
getCharacterStream(java.lang.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. |
java.sql.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. |
java.sql.Clob |
getClob(java.lang.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. |
java.sql.Date |
getDate(Column col,
java.util.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. |
java.util.Date |
getDate(Column col,
Joins joins)
Return the value stored in the given column. |
java.util.Date |
getDate(java.lang.Object obj)
Return the value stored in the given column or id. |
java.sql.Date |
getDate(java.lang.Object obj,
java.util.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(java.lang.Object obj)
Return the value stored in the given column or id. |
java.lang.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(java.lang.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(java.lang.Object obj)
Return the value stored in the given column or id. |
java.io.InputStream |
getLOBStream(JDBCStore store,
java.lang.Object obj)
|
java.util.Locale |
getLocale(Column col,
Joins joins)
Return the value stored in the given column. |
java.util.Locale |
getLocale(java.lang.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(java.lang.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. |
java.lang.Object |
getMappedByValue()
If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship. |
java.lang.Number |
getNumber(Column col,
Joins joins)
Return the value stored in the given column. |
java.lang.Number |
getNumber(java.lang.Object obj)
Return the value stored in the given column or id. |
java.lang.Object |
getObject(Column col,
java.lang.Object arg,
Joins joins)
Return the value stored in the given column. |
java.lang.Object |
getObject(java.lang.Object obj,
int metaType,
java.lang.Object arg)
Return the value stored in the given column or id. |
java.sql.Ref |
getRef(Column col,
java.util.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. |
java.sql.Ref |
getRef(java.lang.Object obj,
java.util.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(java.lang.Object obj)
Return the value stored in the given column or id. |
java.lang.Object |
getSQLObject(Column col,
java.util.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. |
java.lang.Object |
getSQLObject(java.lang.Object obj,
java.util.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. |
java.lang.String |
getString(Column col,
Joins joins)
Return the value stored in the given column. |
java.lang.String |
getString(java.lang.Object obj)
Return the value stored in the given column or id. |
java.sql.Time |
getTime(Column col,
java.util.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. |
java.sql.Time |
getTime(java.lang.Object obj,
java.util.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. |
java.sql.Timestamp |
getTimestamp(Column col,
java.util.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. |
java.sql.Timestamp |
getTimestamp(java.lang.Object obj,
java.util.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. |
java.lang.Object |
load(ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load a pc object using the given store manager. |
java.lang.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,
java.lang.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(java.lang.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(java.lang.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 java.lang.Object getEager(FieldMapping key)
Result
getEager in interface Result
public void putEager(FieldMapping key,
java.lang.Object res)
Result
putEager in interface Resultpublic Joins newJoins()
Result
newJoins in interface Resultpublic void close()
Result
close in interface Resultclose in interface Closeablepublic boolean isLocking()
Result
isLocking in interface Result
public boolean supportsRandomAccess()
throws java.sql.SQLException
Result
supportsRandomAccess in interface Resultjava.sql.SQLException
public boolean absolute(int row)
throws java.sql.SQLException
Result
absolute in interface Resultjava.sql.SQLException
public boolean next()
throws java.sql.SQLException
Result
next in interface Resultjava.sql.SQLException
public void pushBack()
throws java.sql.SQLException
ResultResult.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 Resultjava.sql.SQLException
public int size()
throws java.sql.SQLException
Result
size in interface Resultjava.sql.SQLException
public boolean contains(java.lang.Object obj)
throws java.sql.SQLException
Result
contains in interface Resultjava.sql.SQLException
public boolean containsAll(java.lang.Object[] objs)
throws java.sql.SQLException
Result
containsAll in interface Resultjava.sql.SQLException
public boolean contains(Column col,
Joins joins)
throws java.sql.SQLException
Result
contains in interface Resultjava.sql.SQLException
public boolean containsAll(Column[] cols,
Joins joins)
throws java.sql.SQLException
Result
containsAll in interface Resultjava.sql.SQLExceptionpublic ClassMapping getBaseMapping()
Result
getBaseMapping in interface Resultpublic void setBaseMapping(ClassMapping mapping)
Result
setBaseMapping in interface Resultpublic FieldMapping getMappedByFieldMapping()
Result
getMappedByFieldMapping in interface Resultpublic void setMappedByFieldMapping(FieldMapping fieldMapping)
Result
setMappedByFieldMapping in interface Resultpublic java.lang.Object getMappedByValue()
Result
getMappedByValue in interface Resultpublic void setMappedByValue(java.lang.Object mappedByValue)
Result
setMappedByValue in interface Resultpublic int indexOf()
Result
indexOf in interface Result
public java.lang.Object load(ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch)
throws java.sql.SQLException
Result
load in interface Resultjava.sql.SQLException
public java.lang.Object load(ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch,
Joins joins)
throws java.sql.SQLException
Result
load in interface Resultjava.sql.SQLException
public java.sql.Array getArray(java.lang.Object obj)
throws java.sql.SQLException
Result
getArray in interface Resultjava.sql.SQLException
public java.io.InputStream getAsciiStream(java.lang.Object obj)
throws java.sql.SQLException
Result
getAsciiStream in interface Resultjava.sql.SQLException
public java.math.BigDecimal getBigDecimal(java.lang.Object obj)
throws java.sql.SQLException
Result
getBigDecimal in interface Resultjava.sql.SQLException
public java.math.BigInteger getBigInteger(java.lang.Object obj)
throws java.sql.SQLException
Result
getBigInteger in interface Resultjava.sql.SQLException
public java.io.InputStream getBinaryStream(java.lang.Object obj)
throws java.sql.SQLException
Result
getBinaryStream in interface Resultjava.sql.SQLException
public java.io.InputStream getLOBStream(JDBCStore store,
java.lang.Object obj)
throws java.sql.SQLException
getLOBStream in interface Resultjava.sql.SQLException
public java.sql.Blob getBlob(java.lang.Object obj)
throws java.sql.SQLException
Result
getBlob in interface Resultjava.sql.SQLException
public boolean getBoolean(java.lang.Object obj)
throws java.sql.SQLException
Result
getBoolean in interface Resultjava.sql.SQLException
public byte getByte(java.lang.Object obj)
throws java.sql.SQLException
Result
getByte in interface Resultjava.sql.SQLException
public byte[] getBytes(java.lang.Object obj)
throws java.sql.SQLException
Result
getBytes in interface Resultjava.sql.SQLException
public java.util.Calendar getCalendar(java.lang.Object obj)
throws java.sql.SQLException
Result
getCalendar in interface Resultjava.sql.SQLException
public char getChar(java.lang.Object obj)
throws java.sql.SQLException
Result
getChar in interface Resultjava.sql.SQLException
public java.io.Reader getCharacterStream(java.lang.Object obj)
throws java.sql.SQLException
Result
getCharacterStream in interface Resultjava.sql.SQLException
public java.sql.Clob getClob(java.lang.Object obj)
throws java.sql.SQLException
Result
getClob in interface Resultjava.sql.SQLException
public java.util.Date getDate(java.lang.Object obj)
throws java.sql.SQLException
Result
getDate in interface Resultjava.sql.SQLException
public java.sql.Date getDate(java.lang.Object obj,
java.util.Calendar cal)
throws java.sql.SQLException
Result
getDate in interface Resultjava.sql.SQLException
public double getDouble(java.lang.Object obj)
throws java.sql.SQLException
Result
getDouble in interface Resultjava.sql.SQLException
public float getFloat(java.lang.Object obj)
throws java.sql.SQLException
Result
getFloat in interface Resultjava.sql.SQLException
public int getInt(java.lang.Object obj)
throws java.sql.SQLException
Result
getInt in interface Resultjava.sql.SQLException
public java.util.Locale getLocale(java.lang.Object obj)
throws java.sql.SQLException
Result
getLocale in interface Resultjava.sql.SQLException
public long getLong(java.lang.Object obj)
throws java.sql.SQLException
Result
getLong in interface Resultjava.sql.SQLException
public java.lang.Number getNumber(java.lang.Object obj)
throws java.sql.SQLException
Result
getNumber in interface Resultjava.sql.SQLException
public java.lang.Object getObject(java.lang.Object obj,
int metaType,
java.lang.Object arg)
throws java.sql.SQLException
Result
getObject in interface Resultobj - 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
java.sql.SQLException
public java.lang.Object getSQLObject(java.lang.Object obj,
java.util.Map map)
throws java.sql.SQLException
Result
getSQLObject in interface Resultjava.sql.SQLException
public java.sql.Ref getRef(java.lang.Object obj,
java.util.Map map)
throws java.sql.SQLException
Result
getRef in interface Resultjava.sql.SQLException
public short getShort(java.lang.Object obj)
throws java.sql.SQLException
Result
getShort in interface Resultjava.sql.SQLException
public java.lang.String getString(java.lang.Object obj)
throws java.sql.SQLException
Result
getString in interface Resultjava.sql.SQLException
public java.sql.Time getTime(java.lang.Object obj,
java.util.Calendar cal)
throws java.sql.SQLException
Result
getTime in interface Resultjava.sql.SQLException
public java.sql.Timestamp getTimestamp(java.lang.Object obj,
java.util.Calendar cal)
throws java.sql.SQLException
Result
getTimestamp in interface Resultjava.sql.SQLException
public java.sql.Array getArray(Column col,
Joins joins)
throws java.sql.SQLException
Result
getArray in interface Resultjava.sql.SQLException
public java.io.InputStream getAsciiStream(Column col,
Joins joins)
throws java.sql.SQLException
Result
getAsciiStream in interface Resultjava.sql.SQLException
public java.math.BigDecimal getBigDecimal(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBigDecimal in interface Resultjava.sql.SQLException
public java.math.BigInteger getBigInteger(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBigInteger in interface Resultjava.sql.SQLException
public java.io.InputStream getBinaryStream(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBinaryStream in interface Resultjava.sql.SQLException
public java.sql.Blob getBlob(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBlob in interface Resultjava.sql.SQLException
public boolean getBoolean(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBoolean in interface Resultjava.sql.SQLException
public byte getByte(Column col,
Joins joins)
throws java.sql.SQLException
Result
getByte in interface Resultjava.sql.SQLException
public byte[] getBytes(Column col,
Joins joins)
throws java.sql.SQLException
Result
getBytes in interface Resultjava.sql.SQLException
public java.util.Calendar getCalendar(Column col,
Joins joins)
throws java.sql.SQLException
Result
getCalendar in interface Resultjava.sql.SQLException
public char getChar(Column col,
Joins joins)
throws java.sql.SQLException
Result
getChar in interface Resultjava.sql.SQLException
public java.io.Reader getCharacterStream(Column col,
Joins joins)
throws java.sql.SQLException
Result
getCharacterStream in interface Resultjava.sql.SQLException
public java.sql.Clob getClob(Column col,
Joins joins)
throws java.sql.SQLException
Result
getClob in interface Resultjava.sql.SQLException
public java.util.Date getDate(Column col,
Joins joins)
throws java.sql.SQLException
Result
getDate in interface Resultjava.sql.SQLException
public java.sql.Date getDate(Column col,
java.util.Calendar cal,
Joins joins)
throws java.sql.SQLException
Result
getDate in interface Resultjava.sql.SQLException
public double getDouble(Column col,
Joins joins)
throws java.sql.SQLException
Result
getDouble in interface Resultjava.sql.SQLException
public float getFloat(Column col,
Joins joins)
throws java.sql.SQLException
Result
getFloat in interface Resultjava.sql.SQLException
public int getInt(Column col,
Joins joins)
throws java.sql.SQLException
Result
getInt in interface Resultjava.sql.SQLException
public java.util.Locale getLocale(Column col,
Joins joins)
throws java.sql.SQLException
Result
getLocale in interface Resultjava.sql.SQLException
public long getLong(Column col,
Joins joins)
throws java.sql.SQLException
Result
getLong in interface Resultjava.sql.SQLException
public java.lang.Number getNumber(Column col,
Joins joins)
throws java.sql.SQLException
Result
getNumber in interface Resultjava.sql.SQLException
public java.lang.Object getObject(Column col,
java.lang.Object arg,
Joins joins)
throws java.sql.SQLException
Result
getObject in interface Resultcol - the column whose data to fetcharg - some JDBC data access methods use an argument, such
as a Calendar or Map
java.sql.SQLException
public java.lang.Object getSQLObject(Column col,
java.util.Map map,
Joins joins)
throws java.sql.SQLException
Result
getSQLObject in interface Resultjava.sql.SQLException
public java.sql.Ref getRef(Column col,
java.util.Map map,
Joins joins)
throws java.sql.SQLException
Result
getRef in interface Resultjava.sql.SQLException
public short getShort(Column col,
Joins joins)
throws java.sql.SQLException
Result
getShort in interface Resultjava.sql.SQLException
public java.lang.String getString(Column col,
Joins joins)
throws java.sql.SQLException
Result
getString in interface Resultjava.sql.SQLException
public java.sql.Time getTime(Column col,
java.util.Calendar cal,
Joins joins)
throws java.sql.SQLException
Result
getTime in interface Resultjava.sql.SQLException
public java.sql.Timestamp getTimestamp(Column col,
java.util.Calendar cal,
Joins joins)
throws java.sql.SQLException
Result
getTimestamp in interface Resultjava.sql.SQLException
public boolean wasNull()
throws java.sql.SQLException
Result
wasNull in interface Resultjava.sql.SQLExceptionpublic void startDataRequest(java.lang.Object mapping)
Result
startDataRequest in interface Resultpublic void endDataRequest()
ResultResult.startDataRequest(java.lang.Object). The calls can be nested as follws startDataRequest (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 | |||||||||