public abstract class WSQLAbstractObjectStore<K,V> extends AbstractObjectStore<K,V>
| Modifier and Type | Class and Description |
|---|---|
static interface |
WSQLAbstractObjectStore.EncodeCallback |
| Modifier and Type | Field and Description |
|---|---|
protected WSQLAbstractDatabase |
db |
protected Array<String> |
indexAndKeyColumnNames |
protected Array<String> |
indexColumnNames |
protected Array<String> |
keyPath |
protected String |
name |
protected WSQLTransaction |
transaction |
| Modifier | Constructor and Description |
|---|---|
protected |
WSQLAbstractObjectStore(WSQLAbstractDatabase db,
String name,
WSQLTransaction transaction) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(V object,
DatabaseWriteCallback<K> callback)
Insert the given object into the store.
|
protected abstract void |
addKeyRangeToQuery(KeyRange<K> range,
StringBuilder sql,
com.google.gwt.core.client.JsArrayMixed args) |
protected abstract void |
addKeyToQuery(K key,
StringBuilder sql,
com.google.gwt.core.client.JsArrayMixed args) |
void |
clear(DatabaseCallback callback)
Clear this object store
|
void |
count(DatabaseCountCallback callback)
Return the number of items stored into this object store.
|
void |
count(KeyRange<K> range,
DatabaseCountCallback callback)
Return the number of items stored into this object store in the given range.
|
void |
createTable(SQLTransaction tx,
DatabaseCallback callback) |
protected abstract V |
decodeObject(String encodedObject) |
void |
delete(K key,
DatabaseDeleteCallback callback)
Remove the object associated with the given key from the store.
|
void |
delete(KeyRange<K> range,
DatabaseDeleteCallback callback)
Remove all the objects in the given range from the store.
|
protected abstract void |
encodeObject(V object,
WSQLAbstractObjectStore.EncodeCallback callback) |
void |
get(K key,
DatabaseRetrieveCallback<V> callback)
Retrieve the object associated with the given key from the store.
|
protected abstract String |
getCreateTableSQL() |
protected SQLTransaction.SQLStatementErrorCallback |
getErrorHandler(Callback callback) |
protected Array<String> |
getIndexAndKeyColumnNames() |
protected abstract Array<String> |
getIndexedColumnNames() |
protected void |
getIndexesValuesForObject(com.google.gwt.core.client.JavaScriptObject object,
Array<String> columnNames,
com.google.gwt.core.client.JsArrayMixed output) |
protected abstract K |
getKey(V object) |
protected abstract Array<String> |
getKeyPath() |
String |
getObjectStoreName()
Retrive the name associated with the storage.
|
protected void |
insertObject(SQLTransaction tx,
DatabaseWriteCallback<K> callback,
K key,
com.google.gwt.json.client.JSONObject encoded) |
protected void |
insertObject(V object,
SQLTransaction tx,
DatabaseWriteCallback<K> callback,
K key) |
void |
openCursor(DatabaseCursorCallback<K,V> callback)
Open a cursor to iterate over the object store.
|
void |
openCursor(KeyRange<K> keyRange,
DatabaseCursorCallback<K,V> callback)
Open a cursor to iterate over the object store.
|
void |
put(V object,
DatabaseWriteCallback<K> callback)
Update the given object into the storage.
|
protected void |
reportError(String message) |
protected void |
runDatabaseSQL(DatabaseCallback callback,
SQLTransaction tx,
com.google.gwt.core.client.JsArrayMixed args,
String sqlStatement) |
protected void |
runDeleteSQL(DatabaseDeleteCallback callback,
SQLTransaction tx,
com.google.gwt.core.client.JsArrayMixed args,
String sqlStatement) |
protected void |
runInsertQL(DatabaseWriteCallback<K> callback,
SQLTransaction tx,
com.google.gwt.core.client.JsArrayMixed args,
String sqlStatement,
K key) |
protected void |
runSelectSQL(DatabaseRetrieveCallback<V> callback,
SQLTransaction tx,
com.google.gwt.core.client.JsArrayMixed args,
String sqlStatement,
K key) |
protected void |
runUpdateSQL(DatabaseWriteCallback<K> callback,
SQLTransaction tx,
com.google.gwt.core.client.JsArrayMixed args,
String sqlStatement,
K key,
com.google.gwt.json.client.JSONObject encodedObject) |
protected abstract void |
setObjectKey(V object,
K key) |
protected void |
updateObject(V object,
SQLTransaction tx,
DatabaseWriteCallback<K> callback,
K key) |
add, delete, delete, putreportErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndex, getIndexNames, getKeyRangeFactory, isAutoIncrement, openCursorprotected final String name
protected final WSQLTransaction transaction
protected final WSQLAbstractDatabase db
protected WSQLAbstractObjectStore(WSQLAbstractDatabase db, String name, WSQLTransaction transaction)
public String getObjectStoreName()
ObjectStorepublic void add(V object, DatabaseWriteCallback<K> callback)
ObjectStorepublic void put(V object, DatabaseWriteCallback<K> callback)
ObjectStorepublic void get(K key, DatabaseRetrieveCallback<V> callback)
ObjectStoreDatabaseRetrieveCallback.public void delete(KeyRange<K> range, DatabaseDeleteCallback callback)
ObjectStorepublic void delete(K key, DatabaseDeleteCallback callback)
ObjectStorepublic void clear(DatabaseCallback callback)
ObjectStorepublic void createTable(SQLTransaction tx, DatabaseCallback callback)
public void count(DatabaseCountCallback callback)
ObjectStorepublic void count(KeyRange<K> range, DatabaseCountCallback callback)
ObjectStorepublic void openCursor(DatabaseCursorCallback<K,V> callback)
ObjectStorepublic void openCursor(KeyRange<K> keyRange, DatabaseCursorCallback<K,V> callback)
ObjectStoreprotected void insertObject(V object, SQLTransaction tx, DatabaseWriteCallback<K> callback, K key)
protected void insertObject(SQLTransaction tx, DatabaseWriteCallback<K> callback, K key, com.google.gwt.json.client.JSONObject encoded)
protected void updateObject(V object, SQLTransaction tx, DatabaseWriteCallback<K> callback, K key)
protected void getIndexesValuesForObject(com.google.gwt.core.client.JavaScriptObject object,
Array<String> columnNames,
com.google.gwt.core.client.JsArrayMixed output)
protected void runUpdateSQL(DatabaseWriteCallback<K> callback, SQLTransaction tx, com.google.gwt.core.client.JsArrayMixed args, String sqlStatement, K key, com.google.gwt.json.client.JSONObject encodedObject)
protected void runInsertQL(DatabaseWriteCallback<K> callback, SQLTransaction tx, com.google.gwt.core.client.JsArrayMixed args, String sqlStatement, K key)
protected void runDeleteSQL(DatabaseDeleteCallback callback, SQLTransaction tx, com.google.gwt.core.client.JsArrayMixed args, String sqlStatement)
protected void runSelectSQL(DatabaseRetrieveCallback<V> callback, SQLTransaction tx, com.google.gwt.core.client.JsArrayMixed args, String sqlStatement, K key)
protected void runDatabaseSQL(DatabaseCallback callback, SQLTransaction tx, com.google.gwt.core.client.JsArrayMixed args, String sqlStatement)
protected SQLTransaction.SQLStatementErrorCallback getErrorHandler(Callback callback)
protected void reportError(String message)
protected abstract void addKeyRangeToQuery(KeyRange<K> range, StringBuilder sql, com.google.gwt.core.client.JsArrayMixed args)
protected abstract void addKeyToQuery(K key, StringBuilder sql, com.google.gwt.core.client.JsArrayMixed args)
protected abstract void encodeObject(V object, WSQLAbstractObjectStore.EncodeCallback callback)
protected abstract String getCreateTableSQL()
Copyright © 2015. All rights reserved.