Class SqlJetTableDataCursor
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetRowNumCursor
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetTableDataCursor
-
- All Implemented Interfaces:
ISqlJetCursor
- Direct Known Subclasses:
SqlJetIndexOrderCursor
public class SqlJetTableDataCursor extends SqlJetRowNumCursor
Implementation of cursor which allow access to all table's rows.
-
-
Field Summary
-
Fields inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
btreeTable, db
-
-
Constructor Summary
Constructors Constructor Description SqlJetTableDataCursor(ISqlJetBtreeDataTable table, SqlJetDb db)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Deletes the current record.byte[]
getBlobAsArray(java.lang.String fieldName)
Returns specified field's value as BLOB.java.io.InputStream
getBlobAsStream(java.lang.String fieldName)
Returns specified field's value as BLOB.boolean
getBoolean(java.lang.String fieldName)
Returns specified field's value as boolean.protected ISqlJetBtreeDataTable
getBtreeDataTable()
SqlJetValueType
getFieldType(java.lang.String fieldName)
Returns field type.double
getFloat(java.lang.String fieldName)
Returns specified field's value as float.long
getInteger(java.lang.String fieldName)
Returns specified field's value as integer.long
getRowId()
Gets row Id of the current record.java.lang.Object[]
getRowValues()
Returns all field values of current row.java.lang.String
getString(java.lang.String fieldName)
Returns specified field's value as String.java.lang.Object
getValue(java.lang.String fieldName)
Returns value of the field with the specified name in the current row.boolean
goTo(long rowId)
Goes to the record with the specified row Id.boolean
isNull(java.lang.String fieldName)
Tests field value for null.void
update(java.lang.Object... values)
Updates the current record.void
updateByFieldNames(java.util.Map<java.lang.String,java.lang.Object> values)
Updates the current record.void
updateByFieldNamesOr(SqlJetConflictAction onConflict, java.util.Map<java.lang.String,java.lang.Object> values)
Updates the current record.void
updateOr(SqlJetConflictAction onConflict, java.lang.Object... values)
Updates the current record.long
updateWithRowId(long rowId, java.lang.Object... values)
Updates rowId and values in the current record.long
updateWithRowIdOr(SqlJetConflictAction onConflict, long rowId, java.lang.Object... values)
Updates rowId and values in the current record.-
Methods inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetRowNumCursor
computeRows, eof, first, firstRowNum, getLimit, getRowCount, getRowIndex, goToRow, last, lastRowNum, next, nextRowNum, previous, previousRowNum, setLimit
-
Methods inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetCursor
close, getBlobAsArray, getBlobAsStream, getBoolean, getFieldsCount, getFieldType, getFloat, getInteger, getString, getValue, isNull, reverse
-
-
-
-
Constructor Detail
-
SqlJetTableDataCursor
public SqlJetTableDataCursor(ISqlJetBtreeDataTable table, SqlJetDb db) throws SqlJetException
- Throws:
SqlJetException
-
-
Method Detail
-
getBtreeDataTable
protected ISqlJetBtreeDataTable getBtreeDataTable()
-
getRowId
public long getRowId() throws SqlJetException
Description copied from interface:ISqlJetCursor
Gets row Id of the current record.- Returns:
- row Id of the current record.
- Throws:
SqlJetException
-
goTo
public boolean goTo(long rowId) throws SqlJetException
Description copied from interface:ISqlJetCursor
Goes to the record with the specified row Id.- Parameters:
rowId
- row Id- Returns:
- true if cursor was moved successfully.
- Throws:
SqlJetException
-
getFieldType
public SqlJetValueType getFieldType(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns field type.- Parameters:
fieldName
- name of the field- Returns:
- type of field
- Throws:
SqlJetException
-
isNull
public boolean isNull(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Tests field value for null.- Returns:
- true if field value is null
- Throws:
SqlJetException
-
getString
public java.lang.String getString(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as String.- Parameters:
fieldName
- name of the field- Returns:
- field's value as string
- Throws:
SqlJetException
-
getInteger
public long getInteger(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as integer.- Parameters:
fieldName
- name of the field- Throws:
SqlJetException
-
getFloat
public double getFloat(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as float.- Parameters:
fieldName
- name of the field- Throws:
SqlJetException
-
getBlobAsArray
public byte[] getBlobAsArray(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as BLOB.- Parameters:
fieldName
- name of the field- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getBlobAsStream
public java.io.InputStream getBlobAsStream(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as BLOB.- Parameters:
fieldName
- name of the field- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getValue
public java.lang.Object getValue(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns value of the field with the specified name in the current row.- Parameters:
fieldName
- name of the field- Throws:
SqlJetException
-
getBoolean
public boolean getBoolean(java.lang.String fieldName) throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns specified field's value as boolean.- Parameters:
fieldName
- name of the field- Returns:
- field value
- Throws:
SqlJetException
-
update
public void update(java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates the current record.- Parameters:
values
- New record values.- Throws:
SqlJetException
-
updateOr
public void updateOr(SqlJetConflictAction onConflict, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction
.- Parameters:
onConflict
-SqlJetConflictAction
.values
- New record values.- Throws:
SqlJetException
-
updateWithRowId
public long updateWithRowId(long rowId, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates rowId and values in the current record.values
- New record values.- Throws:
SqlJetException
-
updateWithRowIdOr
public long updateWithRowIdOr(SqlJetConflictAction onConflict, long rowId, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates rowId and values in the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction
.- Parameters:
onConflict
-SqlJetConflictAction
.values
- New record values.- Throws:
SqlJetException
-
updateByFieldNames
public void updateByFieldNames(java.util.Map<java.lang.String,java.lang.Object> values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates the current record.- Parameters:
values
- New record values mapped by field names.- Throws:
SqlJetException
-
updateByFieldNamesOr
public void updateByFieldNamesOr(SqlJetConflictAction onConflict, java.util.Map<java.lang.String,java.lang.Object> values) throws SqlJetException
Description copied from interface:ISqlJetCursor
Updates the current record. Implements ON CONFLICT clause. SeeSqlJetConflictAction
.- Parameters:
onConflict
-SqlJetConflictAction
.values
- New record values mapped by field names.- Throws:
SqlJetException
-
delete
public void delete() throws SqlJetException
Description copied from interface:ISqlJetCursor
Deletes the current record.- Specified by:
delete
in interfaceISqlJetCursor
- Overrides:
delete
in classSqlJetRowNumCursor
- Throws:
SqlJetException
-
getRowValues
public java.lang.Object[] getRowValues() throws SqlJetException
Description copied from interface:ISqlJetCursor
Returns all field values of current row.- Returns:
- field values array
- Throws:
SqlJetException
-
-