Class SqlJetBtreeDataTable
java.lang.Object
org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeDataTable
- All Implemented Interfaces:
ISqlJetBtreeDataTable,ISqlJetBtreeTable
- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
SqlJetBtreeTable.State -
Field Summary
Fields inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
btree, index, rootPage, write -
Constructor Summary
ConstructorsConstructorDescriptionSqlJetBtreeDataTable(ISqlJetBtree btree, String tableName, boolean write) Open data table by name. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIndex(String indexName, Object[] key) Check the current record is equal to key using definition of index.voidclear()voidclose()Close B-Tree table cursor.voiddelete()Delete curent record.voiddelete(long rowId) Delete record by row's ID.Get table's schema definition.Get definitions of table's indexes.Get indexes which are related with table.longgetInteger(int field) Get field's value as integer.Object[]getKeyForIndex(Object[] fields, ISqlJetIndexDef indexDef) Get name of index which has been auto-created for primary key.longgetRowId()Get current rowID.static longgetRowIdFromValues(Map<String, Object> values) getValue(int field) Get value as object.protected ISqlJetVdbeMemgetValueMem(int field) booleangoToRow(long rowId) Go to record with given rowID.longinsert(SqlJetConflictAction onConflict, Object... values) Write an new entry into the table.longinsert(SqlJetConflictAction onConflict, Map<String, Object> values) Insert record by values by names of fields.longinsertWithRowId(SqlJetConflictAction onConflict, long rowId, Object[] values) static booleanisFieldNameRowId(String fieldName) booleanisIndexExists(String indexName) booleanisNull(int field) Check to field has null value.booleanLocate record which using index by key.longnewRowId()voidupdate(SqlJetConflictAction onConflict, long rowId, Object... values) Update an entry in the table by rowId.voidupdate(SqlJetConflictAction onConflict, long rowId, Map<String, Object> values) voidupdate(SqlJetConflictAction onConflict, Map<String, Object> values) voidupdateCurrent(SqlJetConflictAction onConflict, Object... values) Update the current entry in the table.longupdateCurrentWithRowId(SqlJetConflictAction onConflict, long newRowId, Object... values) Update the rowId and values in current entry in the table.longupdateWithRowId(SqlJetConflictAction onConflict, long rowId, long newRowId, Object... values) Update the rowId and values an entry in the table by rowId.Methods inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
adjustKeyInfo, checkField, clearRecordCache, eof, first, getBlob, getCursor, getEncoding, getFieldsCount, getFieldType, getFloat, getKeyInfo, getKeySize, getRecord, getString, getValues, getValueUncached, hasMoved, insert, last, lock, lockTable, moveTo, newRowId, next, popState, previous, pushState, unlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tmatesoft.sqljet.core.internal.table.ISqlJetBtreeTable
eof, first, getBlob, getEncoding, getFieldsCount, getFieldType, getFloat, getKeySize, getRecord, getString, getValues, hasMoved, insert, last, lock, lockTable, moveTo, newRowId, next, popState, previous, pushState, unlock
-
Constructor Details
-
SqlJetBtreeDataTable
public SqlJetBtreeDataTable(ISqlJetBtree btree, String tableName, boolean write) throws SqlJetException Open data table by name.- Throws:
SqlJetException
-
-
Method Details
-
close
Description copied from interface:ISqlJetBtreeTableClose B-Tree table cursor.- Specified by:
closein interfaceISqlJetBtreeTable- Overrides:
closein classSqlJetBtreeTable- Throws:
SqlJetException
-
getDefinition
Description copied from interface:ISqlJetBtreeDataTableGet table's schema definition.- Specified by:
getDefinitionin interfaceISqlJetBtreeDataTable- Returns:
- the tableDef
-
getIndexDefinitions
Description copied from interface:ISqlJetBtreeDataTableGet definitions of table's indexes.- Specified by:
getIndexDefinitionsin interfaceISqlJetBtreeDataTable- Returns:
- the indexesDefs
-
goToRow
Description copied from interface:ISqlJetBtreeDataTableGo to record with given rowID. Return boolean to indicate success.- Specified by:
goToRowin interfaceISqlJetBtreeDataTable- Parameters:
rowId-- Returns:
- Throws:
SqlJetException
-
getRowId
Description copied from interface:ISqlJetBtreeDataTableGet current rowID.- Specified by:
getRowIdin interfaceISqlJetBtreeDataTable- Returns:
- Throws:
SqlJetException
-
insert
Description copied from interface:ISqlJetBtreeDataTableWrite an new entry into the table.- Specified by:
insertin interfaceISqlJetBtreeDataTable- Parameters:
values-- Throws:
SqlJetException
-
insertWithRowId
public long insertWithRowId(SqlJetConflictAction onConflict, long rowId, Object[] values) throws SqlJetException - Specified by:
insertWithRowIdin interfaceISqlJetBtreeDataTable- Parameters:
rowId-values-- Returns:
- Throws:
SqlJetException
-
newRowId
- Specified by:
newRowIdin interfaceISqlJetBtreeTable- Overrides:
newRowIdin classSqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, long rowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTableUpdate an entry in the table by rowId.- Specified by:
updatein interfaceISqlJetBtreeDataTable- Parameters:
rowId-values-- Throws:
SqlJetException
-
updateCurrent
Description copied from interface:ISqlJetBtreeDataTableUpdate the current entry in the table.- Specified by:
updateCurrentin interfaceISqlJetBtreeDataTable- Parameters:
values-- Throws:
SqlJetException
-
updateWithRowId
public long updateWithRowId(SqlJetConflictAction onConflict, long rowId, long newRowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTableUpdate the rowId and values an entry in the table by rowId.- Specified by:
updateWithRowIdin interfaceISqlJetBtreeDataTable- Parameters:
rowId-values-- Throws:
SqlJetException
-
updateCurrentWithRowId
public long updateCurrentWithRowId(SqlJetConflictAction onConflict, long newRowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTableUpdate the rowId and values in current entry in the table.- Specified by:
updateCurrentWithRowIdin interfaceISqlJetBtreeDataTable- Parameters:
values-- Throws:
SqlJetException
-
delete
Description copied from interface:ISqlJetBtreeDataTableDelete record by row's ID.- Specified by:
deletein interfaceISqlJetBtreeDataTable- Parameters:
rowId-- Throws:
SqlJetException
-
delete
Description copied from interface:ISqlJetBtreeDataTableDelete curent record.- Specified by:
deletein interfaceISqlJetBtreeDataTable- Specified by:
deletein interfaceISqlJetBtreeTable- Overrides:
deletein classSqlJetBtreeTable- Throws:
SqlJetException
-
getKeyForIndex
-
checkIndex
Description copied from interface:ISqlJetBtreeDataTableCheck the current record is equal to key using definition of index.- Specified by:
checkIndexin interfaceISqlJetBtreeDataTable- Parameters:
indexName-key-- Returns:
- Throws:
SqlJetException
-
getPrimaryKeyIndex
Description copied from interface:ISqlJetBtreeDataTableGet name of index which has been auto-created for primary key.- Specified by:
getPrimaryKeyIndexin interfaceISqlJetBtreeDataTable- Returns:
- the primaryKeyIndex
-
locate
Description copied from interface:ISqlJetBtreeDataTableLocate record which using index by key. Key is values for fields which are defined in index. If record is found then returns true. If next is true then locate record by next entry in index for key.- Specified by:
locatein interfaceISqlJetBtreeDataTable- Parameters:
indexName-next-key-- Returns:
- Throws:
SqlJetException
-
getIndexesTables
Description copied from interface:ISqlJetBtreeDataTableGet indexes which are related with table.- Specified by:
getIndexesTablesin interfaceISqlJetBtreeDataTable- Returns:
- the indexesTables
-
insert
public long insert(SqlJetConflictAction onConflict, Map<String, Object> values) throws SqlJetExceptionDescription copied from interface:ISqlJetBtreeDataTableInsert record by values by names of fields.- Specified by:
insertin interfaceISqlJetBtreeDataTable- Parameters:
values-- Returns:
- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, long rowId, Map<String, Object> values) throws SqlJetException- Specified by:
updatein interfaceISqlJetBtreeDataTable- Parameters:
rowId-values-- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, Map<String, Object> values) throws SqlJetException- Specified by:
updatein interfaceISqlJetBtreeDataTable- Parameters:
values-- Throws:
SqlJetException
-
getInteger
Description copied from interface:ISqlJetBtreeTableGet field's value as integer.- Specified by:
getIntegerin interfaceISqlJetBtreeTable- Overrides:
getIntegerin classSqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getValue
Description copied from interface:ISqlJetBtreeTableGet value as object.- Specified by:
getValuein interfaceISqlJetBtreeTable- Overrides:
getValuein classSqlJetBtreeTable- Parameters:
field-- Returns:
- Throws:
SqlJetException
-
isIndexExists
- Specified by:
isIndexExistsin interfaceISqlJetBtreeDataTable- Parameters:
indexName-- Returns:
-
isFieldNameRowId
-
getRowIdFromValues
- Throws:
SqlJetException
-
clear
- Specified by:
clearin interfaceISqlJetBtreeTable- Overrides:
clearin classSqlJetBtreeTable- Throws:
SqlJetException
-
getValueMem
- Overrides:
getValueMemin classSqlJetBtreeTable- Throws:
SqlJetException
-
getIndex
- Specified by:
getIndexin interfaceISqlJetBtreeDataTable- Parameters:
indexName-- Returns:
-
isNull
Description copied from interface:ISqlJetBtreeTableCheck to field has null value.- Specified by:
isNullin interfaceISqlJetBtreeTable- Overrides:
isNullin classSqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- true if field value is null
- Throws:
SqlJetException
-