Package FairCom.CtreeDb
Class CTRecord
Deals with the record concept. The CTRecord object is the "atomic" or basic
element of the database system, in the sense that it has the smallest piece
of integrated information. It represents the information in the data
structure defined in the table. Multiple records may belong to one table, but
a record belongs to only one table. The records are several times defined as
the "rows" in the tables.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the number of batch records loaded into batch buffer for GET, RANGE or PHYSBATCH_MODE
operations.int
Retrieves the number of records locked during a GET, RANGE or PHYSBATCH_MODE
operation.int
Retrieves the currentBATCH_MODE
.int
Retrieves the total number of records selected by a batch retrieval operation.byte[]
BuildTargetKey
(int FindMode) Build a target key based on data in record buffervoid
Clear()
Clears the current record buffervoid
ClearField
(int FieldNbr) Clears the content of a fieldvoid
ClearField
(String FieldName) Clears the content of a fieldvoid
CndxCompile
(String expression) Initializes and compiles a conditional expression String.boolean
CndxEval()
Evaluates a conditional expression compiled byCndxCompile(java.lang.String)
.void
CndxFree()
Releases any resources allocated by CndxCompile.Retrieves the conditional expression stringboolean
Compares two records.void
Delete()
Deletes the current record from tablevoid
EndBatch()
A batch operation must be terminated by calling EndBatch method.void
finalize()
Frees Record objectboolean
Find
(int FindMode) Finds a record based on a given key into the record objectboolean
FindRowid
(long rowid, int FindMode) Finds a record by it's rowid Valueboolean
FindTarget
(byte[] Value, int FindMode) Find a record using a target than the current default index key lengthboolean
First()
Moves to first record in tablevoid
Turn off Full Text Searchvoid
FullTextSearchOn
(String query) Set the full text search criteriaRetrieves a the active Result Setint
Retrives the current record default index numberRetrives the current record default index nameGetFieldAsBigDecimal
(int FieldNumber) Retrieves the field contents as a BigDecimal valueGetFieldAsBigDecimal
(String FieldName) Retrieves the field contents as a BigDecimal valueGetFieldAsBoolean
(int FieldNumber) Retrieves the field contents as a Boolean valueGetFieldAsBoolean
(String FieldName) Retrieves the field contents as a Boolean valuebyte[]
GetFieldAsBytes
(int FieldNumber) Retrieves the field contents as a byte[] valuebyte[]
GetFieldAsBytes
(String FieldName) Retrieves the field contents as a byte[] valueGetFieldAsCalendar
(int FieldNumber) Retrieves the field contents as a Calendar valueGetFieldAsCalendar
(String FieldName) Retrieves the field contents as a Calendar valueGetFieldAsDouble
(int FieldNumber) Retrieves the field contents as a Double valueGetFieldAsDouble
(String FieldName) Retrieves the field contents as a Double valueGetFieldAsFloat
(int FieldNumber) Retrieves the field contents as a Float valueGetFieldAsFloat
(String FieldName) Retrieves the field contents as a Float valueGetFieldAsInt
(int FieldNumber) Retrieves the field contents as a Integer valueGetFieldAsInt
(String FieldName) Retrieves the field contents as a Integer valueGetFieldAsJSON
(int FieldNumber) Retrieves the field contents as a string in JSON formatGetFieldAsJSON
(String FieldName) Retrieves the field contents as a string in JSON formatGetFieldAsLong
(int FieldNumber) Retrieves the field contents as a Long valueGetFieldAsLong
(String FieldName) Retrieves the field contents as a Long valueGetFieldAsString
(int FieldNumber) Retrieves the field contents as a String objectGetFieldAsString
(String FieldName) Retrieves the field contents as a String objectint
GetFieldByName
(String FieldName) Retrieves the field number based on the field nameint
GetFieldLength
(int FieldNbr) Retrieves the field actual data lengthint
GetFieldLength
(String FieldName) Retrieves the field actual data lengthGetFieldName
(int FieldNumber) Retrieves the field name based on the field numberint
GetFieldOffset
(int FieldNbr) Retrieves the field offset in the current recordint
GetFieldOffset
(String FieldName) Retrieves the field offset in the current recordint
GetFieldSize
(int FieldNbr) Retrieves the field defined sizeint
GetFieldSize
(String FieldName) Retrieves the field defined sizeint
GetFieldType
(int FieldNumber) Retrieves the field type based on the field numberint
GetFieldType
(String FieldName) Retrieves the field type based on the field nameRetrieves the current filter expression textGet detail about Full Text Search errorbyte[]
Retrieves the current record bufferlong
Retrieves the number of records in the current record handle.long
Retrieves the offset of the nth record of the current index.int
Retrieves the record lengthint
Retrieves the current record lock modelong
Retrieves the current record offset positionlong
GetRecordPosAtOffset
(long Position) Retrieves the offset of the nth record of the current index.int
Retrieves the record allocated sizelong
GetRowid()
Retrieves the current record's rowid Valuevoid
Inserts a new record into batch buffer maintained internally by c-treeDB.boolean
Indicates if a batch operation is active or not.boolean
IsEdited()
Checks if a record buffer has been modified.boolean
Indicates if a filter condition is active for this record objectboolean
Indicate if Full Text Search is active on the recordboolean
IsNew()
Checks if a record buffer is cleared.boolean
IsNullField
(int FieldNumber) Checks if a given field is Null for the current recordboolean
IsNullField
(String FieldName) Checks if a given field is Null for the current recordboolean
Indicates if record set is active or not.boolean
IsVariableField
(int FieldNbr) Indicates if a field is in the variable portion of a recordboolean
IsVariableField
(String FieldName) Indicates if a field is in the variable portion of a recordboolean
JumpTo
(int offset) Jumps to the "offset"th record past the current record using the current index.boolean
Last()
Moves to last record in tableboolean
Next()
Moves to next record in tablevoid
If the mode of the batch operation is one of GET, RANGE or PHYS of theBATCH_MODE
, then it may be necessary to retrieve all records that match the batch criteria.boolean
If the mode of the batch operation is one of GET, RANGE or PHYS of theBATCH_MODE
, then it may be necessary to retrieve all records that match the batch criteria.boolean
Prev()
Moves to previous record in tablevoid
Read()
Rereads the current recordvoid
Deactivates the record setvoid
RecordSetOn
(int siglen) Activates the record set.void
Reset()
Resets the record to its initial conditionvoid
SeekRecord
(long offset) Moves the record to position pointed by offsetvoid
SetBatch
(int mode) Attempts to initiate a specified operation on a group of records with keys matching a partial key Value, an index range expression, or the entire table by physical order.void
SetBatch
(int mode, int targetLen, int bufferLen) Attempts to initiate a specified operation on a group of records with keys matching a partial key Value, an index range expression, or the entire table by physical order.void
SetDefaultFullTextIndex
(int indexno) Set the new record default Full Text index numbervoid
SetDefaultIndex
(int indexno) Sets the new record default index numbervoid
SetDefaultIndex
(String name) Sets the new record default index by its namevoid
SetEdited
(boolean flag) Sets the changed record flagvoid
SetFieldAsBigDecimal
(int FieldNumber, BigDecimal Value) Sets the field contents as a BigDecimal valuevoid
SetFieldAsBigDecimal
(String FieldName, BigDecimal Value) Sets the field contents as a BigDecimal valuevoid
SetFieldAsBoolean
(int FieldNumber, Boolean Value) Sets the field contents as a boolean valuevoid
SetFieldAsBoolean
(String FieldName, Boolean Value) Sets the field contents as a boolean valuevoid
SetFieldAsBytes
(int FieldNumber, byte[] arr) Sets the field contents as a byte[] valuevoid
SetFieldAsBytes
(String FieldName, byte[] arr) Sets the field contents as a byte[] valuevoid
SetFieldAsCalendar
(int FieldNumber, Calendar Value) Sets the field contents as a Calendar valuevoid
SetFieldAsCalendar
(String FieldName, Calendar Value) Sets the field contents as a Calendar valuevoid
SetFieldAsDouble
(int FieldNumber, Double Value) Sets the field contents as a Double valuevoid
SetFieldAsDouble
(String FieldName, Double Value) Sets the field contents as a Double valuevoid
SetFieldAsFloat
(int FieldNumber, Float Value) Sets the field contents as a Float valuevoid
SetFieldAsFloat
(String FieldName, Float Value) Sets the field contents as a Float valuevoid
SetFieldAsInt
(int FieldNumber, Integer Value) Sets the field contents as an Integer valuevoid
SetFieldAsInt
(String FieldName, Integer Value) Sets the field contents as an Integer valuevoid
SetFieldAsJSON
(int FieldNumber, String Value) Sets the field contents as a JSON valuevoid
SetFieldAsJSON
(String FieldName, String Value) Sets the field contents as a JSON valuevoid
SetFieldAsLong
(int FieldNumber, Long Value) Sets the field contents as a long valuevoid
SetFieldAsLong
(String FieldName, Long Value) Sets the field contents as a long valuevoid
SetFieldAsString
(int FieldNumber, String Value) Sets the field contents as a String valuevoid
SetFieldAsString
(String FieldName, String Value) Sets the field contents as a String valuevoid
Sets or clears record filter condition.void
SetNew
(boolean flag) Sets the new record flagvoid
SetRecordBuffer
(byte[] Buffer) Sets the current record buffervoid
Releases current record lockvoid
Write()
Writes the record buffer to diskMethods inherited from class CTBase
Abort, Begin, ClearSavePoint, Commit, GetAutoCommit, GetHandle, GetKeepLock, GetLockMode, GetOperation, GetTransactionMode, IsLockActive, IsTransActive, IsUnicodeLib, Lock, PrepareCommit, RestoreSavePoint, SetAutoCommit, SetHandle, SetKeepLock, SetOperation, SetSavePoint, SetTransactionMode, Unlock
-
Constructor Details
-
CTRecord
Constructor for CTRecord class based on a CTTable object- Parameters:
Handle
- ExistingCTTable
handle- Throws:
CTException
- in case of error- See Also:
-
CTRecord
Copy constructor for CTRecord class- Parameters:
Handle
- Existing Record handle to be duplicated- Throws:
CTException
- in case of error- See Also:
-
-
Method Details
-
getParent
- Returns:
- the CTTable that owns this CTRecord.
-
finalize
public void finalize()Frees Record object -
First
Moves to first record in table- Returns:
- true if it has moved to the first record, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
Last
Moves to last record in table- Returns:
- true if it has moved to the last record, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
Next
Moves to next record in table- Returns:
- true if it has moved to the next record, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
Prev
Moves to previous record in table- Returns:
- true if it has moved to the previous record, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
Find
Finds a record based on a given key into the record object- Parameters:
FindMode
-FIND_MODE
to be used in the search- Returns:
- true if record was found, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
Clear
Clears the current record buffer- Throws:
CTException
- in case of error- See Also:
-
Read
Rereads the current record- Throws:
CTException
- in case of error- See Also:
-
Write
Writes the record buffer to disk- Throws:
CTException
- in case of error- See Also:
-
Delete
Deletes the current record from table- Throws:
CTException
- in case of error- See Also:
-
IsNew
public boolean IsNew()Checks if a record buffer is cleared. It means that if aWrite()
is called, an insert record will be executed.- Returns:
- true if the record buffer has been cleared, otherwise false
- See Also:
-
IsEdited
public boolean IsEdited()Checks if a record buffer has been modified.- Returns:
- true if the record has been modified, otherwise false
- See Also:
-
SetNew
Sets the new record flag- Parameters:
flag
- true to mark the record as new. Setting it to false the record will marked as not new- Throws:
CTException
- in case of error- See Also:
-
SetEdited
Sets the changed record flag- Parameters:
flag
- true to mark the record as modified, setting it to false the record edited flag will be set to false.- Throws:
CTException
- in case of error- See Also:
-
GetDefaultIndex
public int GetDefaultIndex()Retrives the current record default index number- Returns:
- Current default index number
- See Also:
-
GetDefaultIndexName
Retrives the current record default index name- Returns:
- Current default index number name
- See Also:
-
SetDefaultIndex
Sets the new record default index number- Parameters:
indexno
- New record default index number- Throws:
CTException
- in case of error- See Also:
-
SetDefaultIndex
Sets the new record default index by its name- Parameters:
name
- New record default index name- Throws:
CTException
- in case of error- See Also:
-
GetRecordLength
public int GetRecordLength()Retrieves the record length- Returns:
- Current record length
- See Also:
-
GetRecordSize
public int GetRecordSize()Retrieves the record allocated size- Returns:
- Current record size
- See Also:
-
GetRecordPos
Retrieves the current record offset position- Returns:
- Current record offset
- Throws:
CTException
- in case of error- See Also:
-
SeekRecord
Moves the record to position pointed by offset- Parameters:
offset
- record offset position- Throws:
CTException
- in case of error- See Also:
-
IsNullField
Checks if a given field is Null for the current record- Parameters:
FieldName
- Field name to be checked- Returns:
- true is field is Null, otherwise false
- Throws:
CTException
- in case of error- See Also:
-
IsNullField
public boolean IsNullField(int FieldNumber) Checks if a given field is Null for the current record- Parameters:
FieldNumber
- Field number to be checked- Returns:
- true is field is Null, otherwise false
- See Also:
-
GetFieldName
Retrieves the field name based on the field number- Parameters:
FieldNumber
- Field number to retrive its name- Returns:
- Field name
- Throws:
CTException
- in case of error- See Also:
-
GetFieldType
Retrieves the field type based on the field name- Parameters:
FieldName
- Field name to retrieve its type- Returns:
FIELD_TYPE
- Throws:
CTException
- in case of error- See Also:
-
GetFieldType
Retrieves the field type based on the field number- Parameters:
FieldNumber
- Field number to get its type- Returns:
FIELD_TYPE
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsString
Retrieves the field contents as a String object- Parameters:
FieldName
- Field name to be retrieved.- Returns:
- Field content as a String
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsString
Retrieves the field contents as a String object- Parameters:
FieldNumber
- Field number to be retrieved.- Returns:
- Field content as a String
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsJSON
Retrieves the field contents as a string in JSON format- Parameters:
FieldName
- Field name to be retrieved.- Returns:
- Field content as a string in JSON format
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsJSON
Retrieves the field contents as a string in JSON format- Parameters:
FieldNumber
- Field number to be retrieved.- Returns:
- Field content as a string in JSON format
- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBoolean
Sets the field contents as a boolean value- Parameters:
FieldName
- Field name to be setValue
- New boolean value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBoolean
Sets the field contents as a boolean value- Parameters:
FieldNumber
- Field number to be setValue
- New boolean value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsLong
Sets the field contents as a long value- Parameters:
FieldName
- Field name to be setValue
- New long value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsLong
Sets the field contents as a long value- Parameters:
FieldNumber
- Field number to be setValue
- New long value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBigDecimal
Sets the field contents as a BigDecimal value- Parameters:
FieldName
- Field name to be setValue
- New BigDecimal value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBigDecimal
Sets the field contents as a BigDecimal value- Parameters:
FieldNumber
- Field number to be setValue
- New BigDecimal value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBytes
Sets the field contents as a byte[] value- Parameters:
FieldName
- Field name to be setarr
- New byte[] value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsBytes
Sets the field contents as a byte[] value- Parameters:
FieldNumber
- Field number to be setarr
- New byte[] value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsString
Sets the field contents as a String value- Parameters:
FieldName
- Field name to be setValue
- New String value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsString
Sets the field contents as a String value- Parameters:
FieldNumber
- Field number to be setValue
- New String value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsJSON
Sets the field contents as a JSON value- Parameters:
FieldNumber
- Field number to be setValue
- New JSON value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsJSON
Sets the field contents as a JSON value- Parameters:
FieldName
- Field name to be setValue
- New JSON value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsInt
Sets the field contents as an Integer value- Parameters:
FieldName
- Field name to be setValue
- New Integer value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsInt
Sets the field contents as an Integer value- Parameters:
FieldNumber
- Field number to be setValue
- New Integer value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsDouble
Sets the field contents as a Double value- Parameters:
FieldName
- Field name to be setValue
- New Double value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsDouble
Sets the field contents as a Double value- Parameters:
FieldNumber
- Field number to be setValue
- New Double value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsFloat
Sets the field contents as a Float value- Parameters:
FieldName
- Field name to be setValue
- New Float value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsFloat
Sets the field contents as a Float value- Parameters:
FieldNumber
- Field number to be setValue
- New Float value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsCalendar
Sets the field contents as a Calendar value- Parameters:
FieldName
- Field name to be setValue
- New Calendar value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
SetFieldAsCalendar
Sets the field contents as a Calendar value- Parameters:
FieldNumber
- Field number to be setValue
- New Calendar value to be assigned to be field- Throws:
CTException
- in case of error- See Also:
-
GetFieldByName
Retrieves the field number based on the field name- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field number
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBigDecimal
Retrieves the field contents as a BigDecimal value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a BigDecimal value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBigDecimal
Retrieves the field contents as a BigDecimal value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a BigDecimal value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBoolean
Retrieves the field contents as a Boolean value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Boolean value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBoolean
Retrieves the field contents as a Boolean value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Boolean value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBytes
Retrieves the field contents as a byte[] value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a byte[] value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsBytes
Retrieves the field contents as a byte[] value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a byte[] value
- Throws:
CTException
- in case of error- See Also:
-
GetRecordBuffer
Retrieves the current record buffer- Returns:
- Record contents as byte array
- Throws:
CTException
- in case of error- See Also:
-
SetRecordBuffer
Sets the current record buffer- Parameters:
Buffer
- The new record buffer- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsCalendar
Retrieves the field contents as a Calendar value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Calendar value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsCalendar
Retrieves the field contents as a Calendar value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Calendar value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsDouble
Retrieves the field contents as a Double value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Double value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsDouble
Retrieves the field contents as a Double value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Double value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsFloat
Retrieves the field contents as a Float value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Float value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsFloat
Retrieves the field contents as a Float value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Float value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsInt
Retrieves the field contents as a Integer value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Integer value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsInt
Retrieves the field contents as a Integer value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Integer value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsLong
Retrieves the field contents as a Long value- Parameters:
FieldName
- Field name to be retrieved- Returns:
- Field content as a Long value
- Throws:
CTException
- in case of error- See Also:
-
GetFieldAsLong
Retrieves the field contents as a Long value- Parameters:
FieldNumber
- Field number to be retrieved- Returns:
- Field content as a Long value
- Throws:
CTException
- in case of error- See Also:
-
GetRecordCount
Retrieves the number of records in the current record handle.- Returns:
- Total number of records
- Throws:
CTException
- in case of error- See Also:
-
RecordSetOn
Activates the record set.- Parameters:
siglen
- Number of key bytes.- Throws:
CTException
- in case of error- See Also:
-
RecordSetOff
Deactivates the record set- Throws:
CTException
- in case of error- See Also:
-
Reset
Resets the record to its initial condition- Throws:
CTException
- in case of error- See Also:
-
IsVariableField
Indicates if a field is in the variable portion of a record- Parameters:
FieldName
- Field name to be checked- Returns:
- true if a field is in the variable portion of a record, false otherwise
- Throws:
CTException
- in case of error- See Also:
-
IsVariableField
public boolean IsVariableField(int FieldNbr) Indicates if a field is in the variable portion of a record- Parameters:
FieldNbr
- Field number to be checked- Returns:
- true if a field is in the variable portion of a record, false otherwise
- See Also:
-
GetFieldLength
Retrieves the field actual data length- Parameters:
FieldName
- Field name to be checked- Returns:
- Field data actual length
- Throws:
CTException
- in case of error- See Also:
-
GetFieldLength
public int GetFieldLength(int FieldNbr) Retrieves the field actual data length- Parameters:
FieldNbr
- Field number to be checked- Returns:
- Field data actual length
- See Also:
-
GetFieldSize
Retrieves the field defined size- Parameters:
FieldName
- Field name to be checked- Returns:
- Defined field size
- Throws:
CTException
- in case of error- See Also:
-
GetFieldSize
public int GetFieldSize(int FieldNbr) Retrieves the field defined size- Parameters:
FieldNbr
- Field number to be checked- Returns:
- Defined field size
- See Also:
-
GetFieldOffset
Retrieves the field offset in the current record- Parameters:
FieldName
- Field name to be checked- Returns:
- Field offset
- Throws:
CTException
- in case of error- See Also:
-
GetFieldOffset
public int GetFieldOffset(int FieldNbr) Retrieves the field offset in the current record- Parameters:
FieldNbr
- Field number to be checked- Returns:
- Field offset
- See Also:
-
ClearField
Clears the content of a field- Parameters:
FieldName
- Field name to be cleared- Throws:
CTException
- in case of error- See Also:
-
ClearField
Clears the content of a field- Parameters:
FieldNbr
- Field number to be cleared- Throws:
CTException
- in case of error- See Also:
-
UnlockRecord
Releases current record lock- Throws:
CTException
- in case of error- See Also:
-
GetRowid
Retrieves the current record's rowid Value- Returns:
- Current Rowid value
- Throws:
CTException
- in case of error- See Also:
-
FindRowid
Finds a record by it's rowid Value- Parameters:
rowid
- Rowid of record you are looking forFindMode
-FIND_MODE
to be used in the search- Returns:
- true if the record is found, or false if it is not
- Throws:
CTException
- in case of error- See Also:
-
CndxCompile
Initializes and compiles a conditional expression String.- Parameters:
expression
- Conditional expression to be compiled- Throws:
CTException
- in case of error- See Also:
-
CndxEval
Evaluates a conditional expression compiled byCndxCompile(java.lang.String)
. You can compile an expression once and run it many times.- Returns:
- true if the execution was ok and the expression evaluates to true, false otherwise.
- Throws:
CTException
- in case of error- See Also:
-
CndxFree
public void CndxFree()Releases any resources allocated by CndxCompile.- See Also:
-
CndxGetExpression
Retrieves the conditional expression string- Returns:
- Conditional expression String.
- Throws:
CTException
- in case of error- See Also:
-
Compare
Compares two records.- Parameters:
record
- Record handle to compare with- Returns:
- true if both records are equal, or false if the records are different
- Throws:
CTException
- in case of error
-
IsRecordSetOn
public boolean IsRecordSetOn()Indicates if record set is active or not. A record set is active after a successfull call to RecordSetOn. A record set can be switched off by calling RecordSetOff.- Returns:
- true if record set if active, or false if it is not active.
- See Also:
-
SetFilter
Sets or clears record filter condition. If a filter is set, all record reads will evaluate the conditional expression against the record data. If the result is false the record is skipped. The filter condition remains in place until the table is closed or replaced by another conditional expression. Pass an empty String to switch off the current filter state.- Parameters:
cndexpr
- Conditional expression used to filter the records. Pass an empty String to switch off the filter state.- Throws:
CTException
- in case of error- See Also:
-
IsFiltered
public boolean IsFiltered()Indicates if a filter condition is active for this record object- Returns:
- true is there is a filter active for the current record, or false if it is not.
- See Also:
-
GetFilter
Retrieves the current filter expression text- Returns:
- Current filter expression string
- See Also:
-
BatchLoaded
public int BatchLoaded()Retrieves the number of batch records loaded into batch buffer for GET, RANGE or PHYSBATCH_MODE
operations. This is the number of records that are ready to be retrieved byNextBatch()
method.- Returns:
- Number of records ready for retrieval, or a negative number indicating an error.
- See Also:
-
BatchLocked
public int BatchLocked()Retrieves the number of records locked during a GET, RANGE or PHYSBATCH_MODE
operation. If LOCK_READ or LOCK_WRITE are specified in the batch mode, BatchLocked() return the total number of records locked. If LOCK_ONE is specified, or if no LOCK_READ or LOCK_WRITE modes are not specified, BatchLocked return zero.- Returns:
- Number of locked records. In case of an error, returns a negative Value.
- See Also:
-
BatchTotal
public int BatchTotal()Retrieves the total number of records selected by a batch retrieval operation.- Returns:
- Total number of records retrieved. If a batch operation is not active, returns 0, or in case of error, returns a negative Value.
- See Also:
-
BatchMode
public int BatchMode()Retrieves the currentBATCH_MODE
. The batch mode is set by callingSetBatch(int)
method.- Returns:
- Current batch mode or NONE if no batch operation is currently active.
- See Also:
-
IsBatchActive
public boolean IsBatchActive()Indicates if a batch operation is active or not. This is equivalent toBatchMode()
call returningBATCH_MODE
of NONE;- Returns:
- true if a batch operation is underway, otherwise return false.
- See Also:
-
EndBatch
A batch operation must be terminated by calling EndBatch method. Once a batch operation is started, by callingSetBatch(int)
, no other batch operation is allowed to start until the current batch operation is terminated. When performing batch retrieval operations, you may cancel the batch operation before retrieving all the records by calling EndBatch. If the batch operation is aBATCH_MODE
of RANGE, then you must also call RecordRangeOff to terminate the index range used for the batch operation.- Throws:
CTException
- in case of error- See Also:
-
InsertBatch
Inserts a new record into batch buffer maintained internally by c-treeDB. When the batch buffer fills up, the group of records stored in the batch buffer are inserted into the table. IfEndBatch()
is called and the batch buffer still contains records, a new insert record operation is performed for the remaining records before the batch operation is terminated. For transaction controlled files, the batch insertion operation is treated as one all or nothing operation. If no explicit transaction is started, each insertion of records with will start and end its own transaction. Even if an explicit transaction is started, each insertion operation is treated independently through safe points. Note: currently, all records insertion operations will not perform any conversion of records images, key values and records position for heterogeneous client/server implementations. The following steps must be taken to perform a batch insert record operation:a) call
SetBatch(int)
function, withBATCH_MODE
of INS, to insert a group of records;b) for each record to be inserted perform the following operations:
i) call
Clear()
to clear the record bufferii) for each field in the record call one of the SetFieldAs… function to set the field data
iii) call
InsertBatch()
to insert the record into the batch bufferc) call
EndBatch()
to indicate that no more records will beinserted.- Throws:
CTException
- in case of error- See Also:
-
NextBatch
If the mode of the batch operation is one of GET, RANGE or PHYS of theBATCH_MODE
, then it may be necessary to retrieve all records that match the batch criteria. The records are retrieved by calling NextBatch method. NextBatch method retrieves the record data from the batch buffer maintained by c-treeDB's record handle. After a successful call to NextBatch function the field data can be retrieved by calling the appropriate GetFieldAs… methods.- Throws:
CTException
- in case of error- See Also:
-
NextInBatch
If the mode of the batch operation is one of GET, RANGE or PHYS of theBATCH_MODE
, then it may be necessary to retrieve all records that match the batch criteria. The records are retrieved by calling NextInBatch method. NextInBatch method retrieve the record data from the batch buffer maintained by c-treeDB's record handle. After a successful call to NextInBatch function the field data can be retrieved by calling the appropriate GetFieldAs… methods. Notice that NextInBatch does not throw an exception when the end of the batch is reached.- Returns:
- true if the batch operation was successful false otherwise
- Throws:
CTException
- in case of error- See Also:
-
SetBatch
Attempts to initiate a specified operation on a group of records with keys matching a partial key Value, an index range expression, or the entire table by physical order.- Parameters:
mode
-BATCH_MODE
- Throws:
CTException
- in case of error- See Also:
-
SetBatch
Attempts to initiate a specified operation on a group of records with keys matching a partial key Value, an index range expression, or the entire table by physical order.- Parameters:
mode
-BATCH_MODE
targetLen
- Specify the number of significant bytes of the partial target key when the batch mode is GET or DEL.bufferLen
- Size of the buffer used internally by c-treeDB code to handle batch operations. A zero Value for this parameter is an indication that the default Value size should be used. The default buffer size is calculated as the size of the fixed portion of the record multiplied by 128.- Throws:
CTException
- in case of error- See Also:
-
GetRecordKeyPos
Retrieves the offset of the nth record of the current index.- Returns:
- Return record offset at a given offset
- Throws:
CTException
- in case of error- See Also:
-
GetRecordPosAtOffset
Retrieves the offset of the nth record of the current index.- Parameters:
Position
- Record position to be retrieved- Returns:
- Return record offset at a given offset
- Throws:
CTException
- in case of error- See Also:
-
JumpTo
Jumps to the "offset"th record past the current record using the current index.- Parameters:
offset
- Number of records to jump to- Returns:
- true if the jump was successfull, otherwise false.
- Throws:
CTException
- in case of error- See Also:
-
GetActiveResultSet
Retrieves a the active Result Set- Returns:
- Current active
CTResultSet
object if there is any, otherwise return Null
-
GetRecordLock
public int GetRecordLock()Retrieves the current record lock mode- Returns:
- Current record
LOCK_MODE
. If FREE is returned, it indicates that no locks are currently active. - See Also:
-
SetDefaultFullTextIndex
Set the new record default Full Text index number- Parameters:
indexno
- The new record Full Text index number- Throws:
CTException
- in case of error- See Also:
-
FullTextSearchOn
Set the full text search criteria- Parameters:
query
- The full text search query- Throws:
CTException
- in case of error- See Also:
-
IsFullTextSearchOn
public boolean IsFullTextSearchOn()Indicate if Full Text Search is active on the record- Returns:
- true if a full text search is active false otherwise
- See Also:
-
FullTextSearchOff
Turn off Full Text Search- Throws:
CTException
- in case of error- See Also:
-
GetFullTextSearchErrorDetails
Get detail about Full Text Search error- Returns:
- a
FTS_ERROR_DETAIL
object describing the error detail - Throws:
CTException
- in case of error- See Also:
-
FindTarget
Find a record using a target than the current default index key length- Parameters:
Value
- C-Tree Plus key target. The key target must be transformed withBuildTargetKey(int)
unless #define CTDB_FIND_TFRMKEY is turned on in the underlying native library. Please also note that the length of value must be major or equal of the current default key length which can be obtained callingCTIndex.GetKeyLength()
FindMode
-FIND_MODE
to be used in the search- Returns:
- true if the record is found
- Throws:
CTException
- in case of errors or if value is shorter
-
BuildTargetKey
Build a target key based on data in record buffer- Parameters:
FindMode
-FIND_MODE
to be used in the key generation- Returns:
- a byte array containing the target key for the current record buffer
- Throws:
CTException
- in case an error happens
-