T
- the type of DBObject returned by this resultpublic final class DBResult<T extends DBObject>
extends java.lang.Object
implements java.lang.Iterable<T>
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.atomic.AtomicInteger |
PREFETCH_THRESHOLD
The threshold to before we use pre-fetch
|
static VersionENV |
VERSION
the version to use
|
Constructor and Description |
---|
DBResult(DBClassAbstract dbClassAbstract,
DataSource ds)
Creates new DBResult
|
DBResult(DBClassAbstract dbClassAbstract,
DataSource ds,
java.util.ArrayList aList,
DBCriteria criteria)
Creates new DBResult
|
DBResult(DBClassAbstract dbClassAbstract,
DataSource ds,
PossibleRowsHolder pr,
DBCriteria criteria)
Creates new DBResult
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(long rowId)
does this record set contain this record ?
|
boolean |
doesIntersect(DBResult otherSet)
does this result set intersect with the other ?
|
T |
findNext()
The next DBObject
|
int |
getActRowCount()
Get the actual row count
|
DBCriteria |
getCriteria()
Get the current criteria for the DBResult
|
int |
getCurrentRowNumber()
Return the current row number zero offset, -1 is before the first record.
|
DBClassConcrete |
getDBClassConcrete()
Returns the DBClassConcrete for this result set
|
DataSource |
getDS()
get the data source
|
int |
getEstDatabaseLoadCount()
The Estimated number of records that will need to be loaded from the database.
|
int |
getEstRowCount()
The estimated row count.
|
T |
getObject(int requestedRow)
Map requested row to the sorted row number and then call the getObjectUnsorted method
|
T |
getObjectUnsorted(int row)
Returned the object at the requested row.
|
java.lang.String |
getOrderBy()
Returns the current order by clause.
|
PossibleRowsHolder |
getPossibleRows()
Get the possible rows holder for the DBResult
|
boolean |
has2Plus()
Do we have 2 or more matching rows ?
|
boolean |
hasAllRowsBeenScanned()
Have we scanned to the end of the list of possible rows ?
|
boolean |
hasMore()
Are we at the end of the record set.
|
boolean |
hasRow(int row)
Do we have this row ?
|
boolean |
hasRows()
Do we have any rows ? 1 or more
|
DBResult<T> |
intersect(DBResult otherSet)
get the result that intersect
|
boolean |
isRowCountEstimate()
Will/did getEstRowCount() return an estimate or actual row count
|
boolean |
isSorted()
Is it sorted ?
|
java.util.Iterator<T> |
iterator() |
DBObject[] |
makeList()
Make a array of matching DBObjects
|
long[] |
makeRowList()
Deprecated.
|
LargeLongArray |
makeRowLLA()
The list of row IDs
|
DBObject[] |
makeUnsortedList()
the unsorted list of results.
|
T |
next()
The next DBObject
|
DBResult<T> |
rewind()
Rewinds the record set to the first row.
|
DBResult<T> |
setMaxRowForEstimate(int maxRows)
Set the maximum number of rows to load from database for getEstRowCount()
If estimation is greater than this value, we don't get the actual row count.
|
DBResult<T> |
setOrderBy(java.lang.String order)
Sets the order of that the result set is in the format of the order statement is :-
fieldPath DESC;fieldPath ASC
|
DBResult<T> |
setOrderBy(java.lang.String fieldPath,
boolean sortDescending)
A short hand method to set the order by for a particular field.
|
DBResult<T> |
setOrderByKey()
A short hand method of setting the order by
clause to be the primary key.
|
DBResult<T> |
setPrefetchSize(int size)
Sets the number of records to pre-fetch ( scan ahead)
|
public static final java.util.concurrent.atomic.AtomicInteger PREFETCH_THRESHOLD
public static final VersionENV VERSION
public DBResult(@Nonnull DBClassAbstract dbClassAbstract, @Nonnull DataSource ds)
dbClassAbstract
- The base class for this record setds
- Your data sourcepublic DBResult(@Nonnull DBClassAbstract dbClassAbstract, @Nonnull DataSource ds, @Nullable java.util.ArrayList aList, @Nullable DBCriteria criteria)
dbClassAbstract
- The base class for this record setaList
- The list of possible DBObjectscriteria
- The criteria to filter the list with.ds
- Your data sourcepublic DBResult(@Nonnull DBClassAbstract dbClassAbstract, @Nonnull DataSource ds, @Nullable PossibleRowsHolder pr, @Nullable DBCriteria criteria)
dbClassAbstract
- The base class for this record setpr
- The list of possible rowscriteria
- The criteria to filter the rows with.ds
- Your data source@CheckReturnValue public boolean doesIntersect(@Nonnull DBResult otherSet)
otherSet
- the other result set@CheckReturnValue @Nonnull public DBResult<T> intersect(@Nonnull DBResult otherSet)
otherSet
- the other result set@CheckReturnValue public boolean contains(long rowId)
rowId
- The row to check@Nonnull public DBResult<T> setOrderByKey() throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
@CheckReturnValue @Nonnull public java.lang.String getOrderBy()
@CheckReturnValue public boolean isSorted()
@CheckReturnValue @Nonnull public DataSource getDS()
@Nonnull public DBResult<T> setOrderBy(@Nullable java.lang.String order) throws java.lang.NoSuchFieldException
order
- The order by clause.java.lang.NoSuchFieldException
@Nonnull public DBResult<T> setPrefetchSize(int size) throws java.lang.NoSuchFieldException
size
- positive number will enable scan ahead.java.lang.NoSuchFieldException
@Nonnull public DBResult<T> setOrderBy(@Nonnull java.lang.String fieldPath, boolean sortDescending) throws java.lang.NoSuchFieldException
fieldPath
- The field pathsortDescending
- Descending ?java.lang.NoSuchFieldException
@CheckReturnValue public boolean hasMore() throws java.lang.Exception
java.lang.Exception
- A serious problem occurred.@CheckReturnValue public int getCurrentRowNumber()
@CheckReturnValue @Nullable public T next()
@CheckReturnValue @Nonnull public T findNext() throws NotFoundException
NotFoundException
- if there is no more rows.@CheckReturnValue public boolean hasRow(@Nonnegative int row)
row
- The row to check. Starting from 0@CheckReturnValue public boolean hasRows()
@CheckReturnValue public boolean has2Plus()
@CheckReturnValue @Nonnegative public int getActRowCount()
@CheckReturnValue public boolean isRowCountEstimate()
@CheckReturnValue @Nonnegative public int getEstDatabaseLoadCount()
@Nonnull public DBResult<T> setMaxRowForEstimate(@Nonnegative int maxRows)
maxRows
- the max rows.@CheckReturnValue public boolean hasAllRowsBeenScanned()
@CheckReturnValue @Nonnegative public int getEstRowCount()
@CheckReturnValue @Nonnull public DBObject[] makeList()
@CheckReturnValue @Nonnull public DBObject[] makeUnsortedList()
@CheckReturnValue @Nonnull public PossibleRowsHolder getPossibleRows()
@CheckReturnValue @Nullable public DBCriteria getCriteria()
@CheckReturnValue @Nonnull @Deprecated public long[] makeRowList()
@CheckReturnValue @Nonnull public LargeLongArray makeRowLLA()
@CheckReturnValue @Nullable public DBClassConcrete getDBClassConcrete()
@CheckReturnValue @Nullable public T getObject(@Nonnegative int requestedRow)
requestedRow
- The row to fetch.@CheckReturnValue @Nullable public T getObjectUnsorted(@Nonnegative int row)
row
- The row to retrieve.stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.