|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.client.db.DBObject
org.cruxframework.crux.core.client.db.AbstractObjectStore<K,V>
org.cruxframework.crux.core.client.db.WSQLAbstractObjectStore<K,V>
public abstract class WSQLAbstractObjectStore<K,V>
| Nested Class Summary | |
|---|---|
static interface |
WSQLAbstractObjectStore.EncodeCallback
|
| Field Summary | |
|---|---|
protected WSQLAbstractDatabase |
db
|
protected Array<String> |
indexAndKeyColumnNames
|
protected Array<String> |
indexColumnNames
|
protected Array<String> |
keyPath
|
protected String |
name
|
protected WSQLTransaction |
transaction
|
| Fields inherited from class org.cruxframework.crux.core.client.db.DBObject |
|---|
logger |
| Constructor Summary | |
|---|---|
protected |
WSQLAbstractObjectStore(WSQLAbstractDatabase db,
String name,
WSQLTransaction transaction)
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.cruxframework.crux.core.client.db.AbstractObjectStore |
|---|
add, delete, delete, put |
| Methods inherited from class org.cruxframework.crux.core.client.db.DBObject |
|---|
reportError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.cruxframework.crux.core.client.db.ObjectStore |
|---|
getIndex, getIndexNames, getKeyRangeFactory, isAutoIncrement, openCursor |
| Field Detail |
|---|
protected final String name
protected final WSQLTransaction transaction
protected final WSQLAbstractDatabase db
protected Array<String> indexAndKeyColumnNames
protected Array<String> keyPath
protected Array<String> indexColumnNames
| Constructor Detail |
|---|
protected WSQLAbstractObjectStore(WSQLAbstractDatabase db,
String name,
WSQLTransaction transaction)
| Method Detail |
|---|
public String getObjectStoreName()
ObjectStore
public void add(V object,
DatabaseWriteCallback<K> callback)
ObjectStore
public void put(V object,
DatabaseWriteCallback<K> callback)
ObjectStore
public void get(K key,
DatabaseRetrieveCallback<V> callback)
ObjectStoreDatabaseRetrieveCallback.
public void delete(KeyRange<K> range,
DatabaseDeleteCallback callback)
ObjectStore
public void delete(K key,
DatabaseDeleteCallback callback)
ObjectStore
public void clear(DatabaseCallback callback)
ObjectStore
public void createTable(SQLTransaction tx,
DatabaseCallback callback)
public void count(DatabaseCountCallback callback)
ObjectStore
public void count(KeyRange<K> range,
DatabaseCountCallback callback)
ObjectStore
public void openCursor(DatabaseCursorCallback<K,V> callback)
ObjectStore
public void openCursor(KeyRange<K> keyRange,
DatabaseCursorCallback<K,V> callback)
ObjectStore
protected 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 Array<String> getIndexAndKeyColumnNames()
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 Array<String> getIndexedColumnNames()
protected abstract Array<String> getKeyPath()
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 K getKey(V object)
protected abstract void setObjectKey(V object,
K key)
protected abstract V decodeObject(String encodedObject)
protected abstract void encodeObject(V object,
WSQLAbstractObjectStore.EncodeCallback callback)
protected abstract String getCreateTableSQL()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||