#include <cursor.h>

Public Member Functions | |
| int | getNumberOfRecords () const |
| Get number of selected records. | |
| void | remove () |
| Remove current record. | |
| bool | isEmpty () const |
| Checks whether selection is empty. | |
| bool | isUpdateCursor () const |
| Check whether this cursor can be used for update. | |
| bool | isLimitReached () const |
| Checks whether limit for number of selected reacord is reached. | |
| oid_t * | toArrayOfOid (oid_t *arr) const |
| Extract OIDs of selected recrods in array. | |
| int | select (dbQuery &query, dbCursorType aType, void *paramStruct=NULL) |
| Execute query. | |
| int | select (dbQuery &query, void *paramStruct=NULL) |
| Execute query with default cursor type. | |
| int | select (char const *condition, dbCursorType aType, void *paramStruct=NULL) |
| Execute query. | |
| int | select (char const *condition, void *paramStruct=NULL) |
| Execute query with default cursor type. | |
| int | select (dbCursorType aType) |
| Select all records from the table. | |
| int | select () |
| Select all records from the table with default cursor type. | |
| int | selectByKey (char const *key, void const *value) |
| Select all records from the table with specfied value of the key. | |
| int | selectByKeyRange (char const *key, void const *minValue, void const *maxValue) |
| Select all records from the table with specfied range of the key values. | |
| void | update () |
| Update current record. | |
| void | removeAll () |
| Remove all records in the table. | |
| void | removeAllSelected () |
| Remove all selected records. | |
| void | setSelectionLimit (size_t lim) |
| Specify maximal number of records to be selected. | |
| void | unsetSelectionLimit () |
| Remove selection limit. | |
| void | setPrefetchMode (bool mode) |
| Set prefetch mode. | |
| void | enableCheckForDuplicates (bool enabled) |
| Enable or disable duplicates checking (if programmer knows that disjuncts in query do not intersect, then he can disable duplicate checking and avoid bitmap allocation. | |
| void | reset () |
| Reset cursor. | |
| bool | isLast () const |
| Check whether current record is the last one in the selection. | |
| bool | isFirst () const |
| Check whether current record is the first one in the selection. | |
| void | freeze () |
| Freeze cursor. | |
| void | unfreeze () |
| Unfreeze cursor. | |
| bool | skip (int n) |
| Skip specified number of records. | |
| int | seek (oid_t oid) |
| Position cursor on the record with the specified OID. | |
| dbTableDescriptor * | getTable () |
| Get table for which cursor is opened. | |
| void | setTable (dbTableDescriptor *aTable) |
| Set table for the cursor. | |
| void | setRecord (void *rec) |
| Set destination for selected record rec - buffer to which fields of current record will be fetched. | |
| void * | getRecord () |
| Get pointer to the location where fields of the current record are fetched. | |
| bool | isInSelection (oid_t oid) |
| Check if record with specified OID is in selection. | |
| void | fetch () |
| Fetch current record. | |
| bool | hasNext () const |
| Check if there is more records in the selection. | |
| dbAnyCursor () | |
| ~dbAnyCursor () | |
Protected Member Functions | |
| void | checkForDuplicates () |
| void | deallocateBitmap () |
| bool | isMarked (oid_t oid) |
| void | setStatementLimit (dbQuery const &q) |
| void | truncateSelection () |
| void | mark (oid_t oid) |
| bool | add (oid_t oid) |
| byte * | fetchNext () |
| byte * | fetchPrev () |
| bool | gotoNext () |
| bool | gotoPrev () |
| bool | gotoFirst () |
| bool | gotoLast () |
| bool | moveNext () |
| bool | movePrev () |
| void | setCurrent (dbAnyReference const &ref) |
| void | adjustReferences (size_t base, size_t size, long shift) |
| dbAnyCursor (dbTableDescriptor &aTable, dbCursorType aType, byte *rec) | |
Protected Attributes | |
| dbDatabase * | db |
| dbTableDescriptor * | table |
| dbCursorType | type |
| dbCursorType | defaultType |
| dbSelection | selection |
| bool | allRecords |
| oid_t | firstId |
| oid_t | lastId |
| oid_t | currId |
| byte * | record |
| size_t | limit |
| int4 * | bitmap |
| size_t | bitmapSize |
| bool | eliminateDuplicates |
| bool | checkForDuplicatedIsEnabled |
| bool | prefetch |
| bool | removed |
| bool | lastRecordWasDeleted |
| size_t | stmtLimitStart |
| size_t | stmtLimitLen |
| size_t | nSkipped |
| void * | paramBase |
Friends | |
| class | dbAnyContainer |
| class | dbDatabase |
| class | dbHashTable |
| class | dbTtreeNode |
| class | dbRtreePage |
| class | dbSubSql |
| class | dbStatement |
| class | dbServer |
| class | dbCLI |
| class | JniResultSet |
| dbAnyCursor | ( | dbTableDescriptor & | aTable, | |
| dbCursorType | aType, | |||
| byte * | rec | |||
| ) | [inline, protected] |
| dbAnyCursor | ( | ) | [inline] |
| ~dbAnyCursor | ( | ) |
| int getNumberOfRecords | ( | ) | const [inline] |
Get number of selected records.
| void remove | ( | ) |
Remove current record.
| bool isEmpty | ( | ) | const [inline] |
Checks whether selection is empty.
| bool isUpdateCursor | ( | ) | const [inline] |
Check whether this cursor can be used for update.
| bool isLimitReached | ( | ) | const [inline] |
Checks whether limit for number of selected reacord is reached.
Extract OIDs of selected recrods in array.
| arr | if arr is not null, then this array is used as destination (it should be at least selection.nRows long)If arr is null, then new array is created by new oid_t[] and returned by this method |
arr is not null, then arr, otherwise array created by this method | int select | ( | dbQuery & | query, | |
| dbCursorType | aType, | |||
| void * | paramStruct = NULL | |||
| ) | [inline] |
Execute query.
| query | selection criteria | |
| aType | cursor type: dbCursorForUpdate, dbCursorViewOnly | |
| paramStruct | pointer to structure with parameters. If you want to create reentrant precompiled query, i.e. query which can be used concurrently by different threadsm you should avoid to use static variables in such query, and instead of it place paramters into some structure, specify in query relative offsets to the parameters, fill local structure and pass pointer to it to select method. |
| int select | ( | dbQuery & | query, | |
| void * | paramStruct = NULL | |||
| ) | [inline] |
Execute query with default cursor type.
| query | selection criteria | |
| paramStruct | pointer to structure with parameters. |
| int select | ( | char const * | condition, | |
| dbCursorType | aType, | |||
| void * | paramStruct = NULL | |||
| ) | [inline] |
Execute query.
| condition | selection criteria | |
| aType | cursor type: dbCursorForUpdate, dbCursorViewOnly | |
| paramStruct | pointer to structure with parameters. |
| int select | ( | char const * | condition, | |
| void * | paramStruct = NULL | |||
| ) | [inline] |
Execute query with default cursor type.
| condition | selection criteria | |
| paramStruct | pointer to structure with parameters. |
| int select | ( | dbCursorType | aType | ) | [inline] |
Select all records from the table.
| aType | cursor type: dbCursorForUpdate, dbCursorViewOnly |
| int select | ( | ) | [inline] |
Select all records from the table with default cursor type.
| int selectByKey | ( | char const * | key, | |
| void const * | value | |||
| ) |
Select all records from the table with specfied value of the key.
| key | name of the key field | |
| value | searched value of the key |
| int selectByKeyRange | ( | char const * | key, | |
| void const * | minValue, | |||
| void const * | maxValue | |||
| ) |
Select all records from the table with specfied range of the key values.
| key | name of the key field | |
| minValue | inclusive low bound for key values, if NULL then there is no low bound | |
| maxValue | inclusive high bound for key values, if NULL then there is no high bound |
| void update | ( | ) | [inline] |
Update current record.
You should changed value of current record before and then call update method to save changes to the database
| void removeAll | ( | ) | [inline] |
Remove all records in the table.
| void removeAllSelected | ( | ) |
Remove all selected records.
| void setSelectionLimit | ( | size_t | lim | ) | [inline] |
Specify maximal number of records to be selected.
| void unsetSelectionLimit | ( | ) | [inline] |
Remove selection limit.
| void setPrefetchMode | ( | bool | mode | ) | [inline] |
Set prefetch mode.
By default, current record is fetch as soon as it is becomes current. But sometimesyou need only OIDs of selected records. In this case setting prefetchMode to false can help.
| mode | if false then current record is not fetched. You should explicitly call fetch method if you want to fetch it. |
| void enableCheckForDuplicates | ( | bool | enabled | ) | [inline] |
Enable or disable duplicates checking (if programmer knows that disjuncts in query do not intersect, then he can disable duplicate checking and avoid bitmap allocation.
| void reset | ( | ) |
| bool isLast | ( | ) | const |
Check whether current record is the last one in the selection.
NULL | bool isFirst | ( | ) | const |
Check whether current record is the first one in the selection.
NULL | void freeze | ( | ) |
Freeze cursor.
This method makes it possible to save current state of cursor, close transaction to allow other threads to proceed, and then later restore state of the cursor using unfreeze method and continue traversal through selected records.
| void unfreeze | ( | ) |
Unfreeze cursor.
This method starts new transaction and restore state of the cursor
| bool skip | ( | int | n | ) |
Skip specified number of records.
| n | if positive then skip n records forward, if negative then skip -n records backward |
true if specified number of records was successfully skipped, false if there is no next (n > 0) or previous (n < 0) record in the selction. | int seek | ( | oid_t | oid | ) |
Position cursor on the record with the specified OID.
| oid | object identifier of record |
| dbTableDescriptor* getTable | ( | ) | [inline] |
Get table for which cursor is opened.
| void setTable | ( | dbTableDescriptor * | aTable | ) | [inline] |
Set table for the cursor.
| aTable | table which records will be iterated |
| void setRecord | ( | void * | rec | ) | [inline] |
Set destination for selected record rec - buffer to which fields of current record will be fetched.
| void* getRecord | ( | ) | [inline] |
Get pointer to the location where fields of the current record are fetched.
| bool isInSelection | ( | oid_t | oid | ) |
Check if record with specified OID is in selection.
true if record with such OID was selected | void fetch | ( | ) | [inline] |
Fetch current record.
You should use this method only if prefetch mode is disabled
| bool hasNext | ( | ) | const |
Check if there is more records in the selection.
| void checkForDuplicates | ( | ) | [protected] |
| void deallocateBitmap | ( | ) | [protected] |
| bool isMarked | ( | oid_t | oid | ) | [inline, protected] |
| void setStatementLimit | ( | dbQuery const & | q | ) | [inline, protected] |
| void truncateSelection | ( | ) | [inline, protected] |
| void mark | ( | oid_t | oid | ) | [inline, protected] |
| bool add | ( | oid_t | oid | ) | [inline, protected] |
| byte * fetchNext | ( | ) | [protected] |
| byte * fetchPrev | ( | ) | [protected] |
| bool gotoNext | ( | ) | [protected] |
| bool gotoPrev | ( | ) | [protected] |
| bool gotoFirst | ( | ) | [protected] |
| bool gotoLast | ( | ) | [protected] |
| bool moveNext | ( | ) | [protected] |
| bool movePrev | ( | ) | [protected] |
| void setCurrent | ( | dbAnyReference const & | ref | ) | [protected] |
| void adjustReferences | ( | size_t | base, | |
| size_t | size, | |||
| long | shift | |||
| ) | [inline, protected] |
friend class dbAnyContainer [friend] |
friend class dbDatabase [friend] |
friend class dbHashTable [friend] |
friend class dbTtreeNode [friend] |
friend class dbRtreePage [friend] |
friend class dbSubSql [friend] |
friend class dbStatement [friend] |
friend class dbServer [friend] |
friend class dbCLI [friend] |
friend class JniResultSet [friend] |
dbDatabase* db [protected] |
dbTableDescriptor* table [protected] |
dbCursorType type [protected] |
dbCursorType defaultType [protected] |
dbSelection selection [protected] |
bool allRecords [protected] |
Reimplemented in dbCursor, and dbCursor< dbTimeSeriesBlock< T > >.
size_t limit [protected] |
size_t bitmapSize [protected] |
bool eliminateDuplicates [protected] |
bool checkForDuplicatedIsEnabled [protected] |
bool prefetch [protected] |
bool removed [protected] |
bool lastRecordWasDeleted [protected] |
size_t stmtLimitStart [protected] |
size_t stmtLimitLen [protected] |
size_t nSkipped [protected] |
void* paramBase [protected] |