|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
REC
- The lower bound on the result typepublic interface QueryResultSet<REC>
Encapsulates the results of a QueryEngine
query. This class
allows navigation of the results and access to the selected fields
as columns.
Nested Class Summary | |
---|---|
static class |
QueryResultSet.Collation
The ways in which the results of multiple Repositories can be combined. |
static interface |
QueryResultSet.Row<REC>
Models a result row. |
Method Summary | ||
---|---|---|
boolean |
absolute(int row)
Moves the cursor to the given row number in this ResultSet object. |
|
void |
beforeFirst()
Resets the cursor to the beginning of this QueryResultSet object,
just before the first row. |
|
void |
close()
Close the result set and release any associated resources. |
|
void |
describePlan(PrintStream out)
Prints the query plan for this QueryResultSet . |
|
boolean |
first()
Set the cursor to the beginning of this QueryResultSet to the first
result. |
|
|
getArray(int columnIndex)
Gets the value for columnIndex as an array. |
|
|
getArray(String columnName)
Gets the value for columnName as an int. |
|
BigDecimal |
getBigDecimal(int columnIndex)
Gets the value for columnIndex as a BigDecimal . |
|
BigDecimal |
getBigDecimal(String columnName)
Gets the value for columnName as an BigDecimal . |
|
BigInteger |
getBigInteger(int columnIndex)
Gets the value for columnIndex as a BigInteger . |
|
BigInteger |
getBigInteger(String columnName)
Gets the value for columnName as an BigInteger . |
|
boolean |
getBoolean(int columnIndex)
Gets the value for columnIndex as a boolean. |
|
boolean |
getBoolean(String columnName)
Gets the value for columnName as an boolean. |
|
byte |
getByte(int columnIndex)
Gets the value for columnIndex as a byte. |
|
byte |
getByte(String columnName)
Gets the value for columnName as a byte. |
|
char |
getChar(int columnIndex)
Gets the value for columnIndex as a char. |
|
char |
getChar(String columnName)
Gets the value for columnName as an char. |
|
int |
getCount()
Returns the number of results in this result set. |
|
Currency |
getCurrency(int columnIndex)
Gets the value for columnIndex as a Currency . |
|
Currency |
getCurrency(String columnName)
Gets the value for columnName as a Currency . |
|
Date |
getDate(int columnIndex)
Gets the value for columnIndex as a Date . |
|
Date |
getDate(String columnName)
Gets the value for columnName as an Date . |
|
double |
getDouble(int columnIndex)
Gets the value for columnIndex as a double. |
|
double |
getDouble(String columnName)
Gets the value for columnName as an double. |
|
int |
getEstimatedCount()
Returns the estimated number rows that need to be scanned to fulfill this query. |
|
float |
getFloat(int columnIndex)
Gets the value for columnIndex as a float. |
|
float |
getFloat(String columnName)
Gets the value for columnName as a float. |
|
int |
getInteger(int columnIndex)
Gets the value for columnIndex as an int. |
|
int |
getInteger(String columnName)
Gets the value for columnName as an int. |
|
long |
getLong(int columnIndex)
Gets the value for columnIndex as a long. |
|
long |
getLong(String columnName)
Gets the value for columnName as an long. |
|
|
getObject(int columnIndex)
Gets the value for columnIndex as an object. |
|
|
getObject(String columnName)
Gets the value for columnName as an Object. |
|
QueryPlan |
getPlan(String repository)
Retrieve the QueryPlan for a specific repository. |
|
QueryResult<REC> |
getQueryResult()
Accesses the raw QueryResult for the Query. |
|
REC |
getRawResult()
Gets the raw result object from which query results have been projected. |
|
List<IdxField<REC,?>> |
getSelectedFields()
Gets the fields selected for this QueryResult . |
|
short |
getShort(int columnIndex)
Gets the value for columnIndex as a short. |
|
short |
getShort(String columnName)
Gets the value for columnName as a short. |
|
String |
getString(int columnIndex)
Gets the value for columnIndex as a String. |
|
String |
getString(String columnName)
Gets the value for columnName as an String. |
|
boolean |
isFullScan()
Indicates whether the query must perform a full scan of the repository. |
|
boolean |
next()
Move to the next record. |
|
void |
setCollation(QueryResultSet.Collation collation)
Set the QueryResultSet.Collation . |
Method Detail |
---|
void setCollation(QueryResultSet.Collation collation)
QueryResultSet.Collation
.
collation
- The collation to use for results when operating on multiple repositories.List<IdxField<REC,?>> getSelectedFields()
QueryResult
. The returned
list should not be mutated.
QueryResult
.QueryPlan getPlan(String repository)
repository
-
void close()
boolean absolute(int row)
If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.
If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1) positions the cursor on the last row; calling the method absolute(-2) moves the cursor to the next-to-last row, and so on.
If the row number specified is zero, the cursor is moved to before the first row.
An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row.
Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
row
- the number of the row to which the cursor should move. A value of zero indicates that the cursor
will be positioned before the first row; a positive number indicates the row number counting from
the beginning of the result set; a negative number indicates the row number counting from the end of the result set
true
if the cursor is moved to a position in this ResultSet object; false if the cursor is before the first row or after the last rowvoid beforeFirst()
QueryResultSet
object,
just before the first row.
boolean first()
QueryResultSet
to the first
result.
boolean next()
QueryResult<REC> getQueryResult()
QueryResult
for the Query. The raw result
holds the backing object from which the individual fields projected
in the result were retrieved. All fields that have selected in via
the select operation that produces this result are guaranteed to be
present in the returned object, the presence of non selected fields
in the returned object is dependent on the QueryEngine
implementation.
SELECT Customer FROM Repositories WHERE Customer.lastName = "Jones"
QueryResultSetresult = engine.select(query); for(Customer customer : result) { System.out.println("Found: " + customer.getFirstName() + " " + customer.getLastName()); }
QueryResult
.REC getRawResult()
SELECT Customer.firstName FROM repository WHERE Customer.lastName = "Jones"
QueryResultSetresult = engine.select(query); if(result.next()) { Customer customer = (Customer) result.getRawResult(); }
int getCount()
NOTE: This may result in a full scan of the results to determine
the result size. You might consider calling getEstimatedCount()
instead.
int getEstimatedCount()
Integer.MAX_VALUE
indicates that
a full scan will be required.
NOTE: This may result in a full scan of the results to determine the result size.
boolean isFullScan()
short getShort(String columnName)
columnName
as a short.
columnName
- The name of the column.
columnName
as a short.
QueryException
- If this result set doesn't have such a column or the type is incorrect.byte getByte(String columnName)
columnName
as a byte.
columnName
- The name of the column.
columnName
as a byte.
QueryException
- If this result set doesn't have such a column or the type is incorrect.int getInteger(String columnName)
columnName
as an int.
columnName
- The name of the column.
columnName
as a int.
QueryException
- If this result set doesn't have such a column or the type is incorrect.long getLong(String columnName)
columnName
as an long.
columnName
- The name of the column.
columnName
as a long.
QueryException
- If this result set doesn't have such a column or the type is incorrect.float getFloat(String columnName)
columnName
as a float.
columnName
- The name of the column.
columnName
as a float.
QueryException
- If this result set doesn't have such a column or the type is incorrect.double getDouble(String columnName)
columnName
as an double.
columnName
- The name of the column.
columnName
as a double.
QueryException
- If this result set doesn't have such a column or the type is incorrect.boolean getBoolean(String columnName)
columnName
as an boolean.
columnName
- The name of the column.
columnName
as a boolean.
QueryException
- If this result set doesn't have such a column or the type is incorrect.char getChar(String columnName)
columnName
as an char.
columnName
- The name of the column.
columnName
as a char.
QueryException
- If this result set doesn't have such a column or the type is incorrect.<S> S[] getArray(String columnName)
columnName
as an int.
columnName
- The name of the column.
columnName
as a int.
QueryException
- If this result set doesn't have such a column or the type is incorrect.<S> S getObject(String columnName)
columnName
as an Object.
columnName
- The name of the column.
columnName
as a Object.
QueryException
- If this result set doesn't have such a column.String getString(String columnName)
columnName
as an String.
columnName
- The name of the column.
columnName
as a String.
QueryException
- If this result set doesn't have such a column or the type is incorrect.Date getDate(String columnName)
columnName
as an Date
.
columnName
- The name of the column.
columnName
as a Date
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.BigInteger getBigInteger(String columnName)
columnName
as an BigInteger
.
columnName
- The name of the column.
columnName
as a BigInteger
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.BigDecimal getBigDecimal(String columnName)
columnName
as an BigDecimal
.
columnName
- The name of the column.
columnName
as a BigDecimal
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.Currency getCurrency(String columnName)
columnName
as a Currency
.
columnName
- The name of the column.
columnName
as a Currency
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.short getShort(int columnIndex)
columnIndex
as a short.
columnIndex
- The name of the column.
columnIndex
as a short.
QueryException
- If this result set doesn't have such a column or the type is incorrect.byte getByte(int columnIndex)
columnIndex
as a byte.
columnIndex
- The name of the column.
columnIndex
as a byte.
QueryException
- If this result set doesn't have such a column or the type is incorrect.int getInteger(int columnIndex)
columnIndex
as an int.
columnIndex
- The name of the column.
columnIndex
as a int.
QueryException
- If this result set doesn't have such a column or the type is incorrect.long getLong(int columnIndex)
columnIndex
as a long.
columnIndex
- The name of the column.
columnIndex
as a long.
QueryException
- If this result set doesn't have such a column or the type is incorrect.float getFloat(int columnIndex)
columnIndex
as a float.
columnIndex
- The name of the column.
columnIndex
as a float.
QueryException
- If this result set doesn't have such a column or the type is incorrect.double getDouble(int columnIndex)
columnIndex
as a double.
columnIndex
- The name of the column.
columnIndex
as a double.
QueryException
- If this result set doesn't have such a column or the type is incorrect.boolean getBoolean(int columnIndex)
columnIndex
as a boolean.
columnIndex
- The name of the column.
columnIndex
as a boolean.
QueryException
- If this result set doesn't have such a column or the type is incorrect.char getChar(int columnIndex)
columnIndex
as a char.
columnIndex
- The name of the column.
columnIndex
as a char.
QueryException
- If this result set doesn't have such a column or the type is incorrect.<S> S[] getArray(int columnIndex)
columnIndex
as an array.
columnIndex
- The name of the column.
columnIndex
as an array.
QueryException
- If this result set doesn't have such a column or the type is incorrect.<S> S getObject(int columnIndex)
columnIndex
as an object.
columnIndex
- The name of the column.
columnIndex
as an object.
QueryException
- If this result set doesn't have such a column.String getString(int columnIndex)
columnIndex
as a String.
columnIndex
- The name of the column.
columnIndex
as a String.
QueryException
- If this result set doesn't have such a column or the type is incorrect.Date getDate(int columnIndex)
columnIndex
as a Date
.
columnIndex
- The name of the column.
columnIndex
as a Date
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.BigInteger getBigInteger(int columnIndex)
columnIndex
as a BigInteger
.
columnIndex
- The name of the column.
columnIndex
as a BigInteger
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.BigDecimal getBigDecimal(int columnIndex)
columnIndex
as a BigDecimal
.
columnIndex
- The name of the column.
columnIndex
as a BigDecimal
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.Currency getCurrency(int columnIndex)
columnIndex
as a Currency
.
columnIndex
- The name of the column.
columnIndex
as a Currency
.
QueryException
- If this result set doesn't have such a column or the type is incorrect.void describePlan(PrintStream out)
QueryResultSet
.
out
- The print stream to which to write results.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |