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 TypeMethodDescriptionboolean
checkIndex
(String indexName, Object[] key) Check the current record is equal to key using definition of index.void
clear()
void
close()
Close B-Tree table cursor.void
delete()
Delete curent record.void
delete
(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.long
getInteger
(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.long
getRowId()
Get current rowID.static long
getRowIdFromValues
(Map<String, Object> values) getValue
(int field) Get value as object.protected ISqlJetVdbeMem
getValueMem
(int field) boolean
goToRow
(long rowId) Go to record with given rowID.long
insert
(SqlJetConflictAction onConflict, Object... values) Write an new entry into the table.long
insert
(SqlJetConflictAction onConflict, Map<String, Object> values) Insert record by values by names of fields.long
insertWithRowId
(SqlJetConflictAction onConflict, long rowId, Object[] values) static boolean
isFieldNameRowId
(String fieldName) boolean
isIndexExists
(String indexName) boolean
isNull
(int field) Check to field has null value.boolean
Locate record which using index by key.long
newRowId()
void
update
(SqlJetConflictAction onConflict, long rowId, Object... values) Update an entry in the table by rowId.void
update
(SqlJetConflictAction onConflict, long rowId, Map<String, Object> values) void
update
(SqlJetConflictAction onConflict, Map<String, Object> values) void
updateCurrent
(SqlJetConflictAction onConflict, Object... values) Update the current entry in the table.long
updateCurrentWithRowId
(SqlJetConflictAction onConflict, long newRowId, Object... values) Update the rowId and values in current entry in the table.long
updateWithRowId
(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, unlock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ISqlJetBtreeTable
Close B-Tree table cursor.- Specified by:
close
in interfaceISqlJetBtreeTable
- Overrides:
close
in classSqlJetBtreeTable
- Throws:
SqlJetException
-
getDefinition
Description copied from interface:ISqlJetBtreeDataTable
Get table's schema definition.- Specified by:
getDefinition
in interfaceISqlJetBtreeDataTable
- Returns:
- the tableDef
-
getIndexDefinitions
Description copied from interface:ISqlJetBtreeDataTable
Get definitions of table's indexes.- Specified by:
getIndexDefinitions
in interfaceISqlJetBtreeDataTable
- Returns:
- the indexesDefs
-
goToRow
Description copied from interface:ISqlJetBtreeDataTable
Go to record with given rowID. Return boolean to indicate success.- Specified by:
goToRow
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
getRowId
Description copied from interface:ISqlJetBtreeDataTable
Get current rowID.- Specified by:
getRowId
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
insert
Description copied from interface:ISqlJetBtreeDataTable
Write an new entry into the table.- Specified by:
insert
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
insertWithRowId
public long insertWithRowId(SqlJetConflictAction onConflict, long rowId, Object[] values) throws SqlJetException - Specified by:
insertWithRowId
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
newRowId
- Specified by:
newRowId
in interfaceISqlJetBtreeTable
- Overrides:
newRowId
in classSqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, long rowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTable
Update an entry in the table by rowId.- Specified by:
update
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
updateCurrent
Description copied from interface:ISqlJetBtreeDataTable
Update the current entry in the table.- Specified by:
updateCurrent
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
updateWithRowId
public long updateWithRowId(SqlJetConflictAction onConflict, long rowId, long newRowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTable
Update the rowId and values an entry in the table by rowId.- Specified by:
updateWithRowId
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
updateCurrentWithRowId
public long updateCurrentWithRowId(SqlJetConflictAction onConflict, long newRowId, Object... values) throws SqlJetException Description copied from interface:ISqlJetBtreeDataTable
Update the rowId and values in current entry in the table.- Specified by:
updateCurrentWithRowId
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
delete
Description copied from interface:ISqlJetBtreeDataTable
Delete record by row's ID.- Specified by:
delete
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
delete
Description copied from interface:ISqlJetBtreeDataTable
Delete curent record.- Specified by:
delete
in interfaceISqlJetBtreeDataTable
- Specified by:
delete
in interfaceISqlJetBtreeTable
- Overrides:
delete
in classSqlJetBtreeTable
- Throws:
SqlJetException
-
getKeyForIndex
-
checkIndex
Description copied from interface:ISqlJetBtreeDataTable
Check the current record is equal to key using definition of index.- Specified by:
checkIndex
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
getPrimaryKeyIndex
Description copied from interface:ISqlJetBtreeDataTable
Get name of index which has been auto-created for primary key.- Specified by:
getPrimaryKeyIndex
in interfaceISqlJetBtreeDataTable
- Returns:
- the primaryKeyIndex
-
locate
Description copied from interface:ISqlJetBtreeDataTable
Locate 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:
locate
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
getIndexesTables
Description copied from interface:ISqlJetBtreeDataTable
Get indexes which are related with table.- Specified by:
getIndexesTables
in interfaceISqlJetBtreeDataTable
- Returns:
- the indexesTables
-
insert
public long insert(SqlJetConflictAction onConflict, Map<String, Object> values) throws SqlJetExceptionDescription copied from interface:ISqlJetBtreeDataTable
Insert record by values by names of fields.- Specified by:
insert
in interfaceISqlJetBtreeDataTable
- Returns:
- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, long rowId, Map<String, Object> values) throws SqlJetException- Specified by:
update
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
update
public void update(SqlJetConflictAction onConflict, Map<String, Object> values) throws SqlJetException- Specified by:
update
in interfaceISqlJetBtreeDataTable
- Throws:
SqlJetException
-
getInteger
Description copied from interface:ISqlJetBtreeTable
Get field's value as integer.- Specified by:
getInteger
in interfaceISqlJetBtreeTable
- Overrides:
getInteger
in classSqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getValue
Description copied from interface:ISqlJetBtreeTable
Get value as object.- Specified by:
getValue
in interfaceISqlJetBtreeTable
- Overrides:
getValue
in classSqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
isIndexExists
- Specified by:
isIndexExists
in interfaceISqlJetBtreeDataTable
- Returns:
-
isFieldNameRowId
-
getRowIdFromValues
- Throws:
SqlJetException
-
clear
- Specified by:
clear
in interfaceISqlJetBtreeTable
- Overrides:
clear
in classSqlJetBtreeTable
- Throws:
SqlJetException
-
getValueMem
- Overrides:
getValueMem
in classSqlJetBtreeTable
- Throws:
SqlJetException
-
getIndex
- Specified by:
getIndex
in interfaceISqlJetBtreeDataTable
- Returns:
-
isNull
Description copied from interface:ISqlJetBtreeTable
Check to field has null value.- Specified by:
isNull
in interfaceISqlJetBtreeTable
- Overrides:
isNull
in classSqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- true if field value is null
- Throws:
SqlJetException
-