|
||||||||||
| 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.WSQLCursor<K,P,V>
K - The type of the key used to identify objects into the cursor.V - The type of the objects referenced by this cursorpublic abstract class WSQLCursor<K,P,V>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.cruxframework.crux.core.client.db.Cursor |
|---|
Cursor.CursorDirection |
| Field Summary | |
|---|---|
protected boolean |
autoIncrement
|
protected DatabaseCursorCallback<K,V> |
callback
|
protected K |
cursorKey
|
protected Cursor.CursorDirection |
direction
|
protected Array<String> |
indexColumnNames
|
protected Array<String> |
keyPath
|
protected WSQLKeyRange<K> |
keyRange
|
protected int |
length
|
protected String |
objectStoreName
|
protected int |
offset
|
protected SQLResultSet |
resultSet
|
protected WSQLTransaction |
transaction
|
| Fields inherited from class org.cruxframework.crux.core.client.db.DBObject |
|---|
db, logger |
| Constructor Summary | |
|---|---|
protected |
WSQLCursor(WSQLAbstractDatabase db,
WSQLKeyRange<K> range,
String objectStoreName,
boolean autoIncrement,
Cursor.CursorDirection direction,
WSQLTransaction transaction)
|
| Method Summary | |
|---|---|
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 |
addPrimaryKeyToQuery(P key,
StringBuilder sql,
com.google.gwt.core.client.JsArrayMixed args)
|
void |
advance(int count)
Advance the cursor current position by a number of positions. |
protected void |
appendGroupColumns(StringBuilder sql)
|
void |
continueCursor()
Make cursor to go to the next element. |
void |
continueCursor(K key)
Make cursor to go to the element referenced by the given key. |
protected abstract V |
decodeObject(String encodedObject)
|
void |
delete()
Delete the current value, pointed by the cursor, from the database. |
protected abstract void |
encodeObject(V object,
WSQLAbstractObjectStore.EncodeCallback callback)
|
protected void |
fireSuccess()
|
Cursor.CursorDirection |
getDirection()
Direction of iteration used by this cursor. |
protected SQLTransaction.SQLStatementErrorCallback |
getErrorHandler(Callback callback)
|
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 Array<String> |
getKeyPath()
|
com.google.gwt.core.client.JsArrayMixed |
getNativeArrayKey()
Return the cursor key, as a native javascript object. |
protected abstract P |
getPrimaryKey()
|
V |
getValue()
Return the value of record pointed by the cursor. |
boolean |
hasValue()
Return true if cursor points to a valid value. |
protected abstract void |
setObjectKey(V object,
P key)
|
protected int |
size()
|
void |
start(DatabaseCursorCallback<K,V> c)
|
void |
update(V value)
Update current record pointed by the cursor with the given value. |
| 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.Cursor |
|---|
getKey |
| Field Detail |
|---|
protected final Cursor.CursorDirection direction
protected final WSQLTransaction transaction
protected WSQLKeyRange<K> keyRange
protected String objectStoreName
protected int offset
protected int length
protected SQLResultSet resultSet
protected DatabaseCursorCallback<K,V> callback
protected Array<String> keyPath
protected Array<String> indexColumnNames
protected K cursorKey
protected final boolean autoIncrement
| Constructor Detail |
|---|
protected WSQLCursor(WSQLAbstractDatabase db,
WSQLKeyRange<K> range,
String objectStoreName,
boolean autoIncrement,
Cursor.CursorDirection direction,
WSQLTransaction transaction)
| Method Detail |
|---|
public void start(DatabaseCursorCallback<K,V> c)
public void advance(int count)
Cursor
advance in interface Cursor<K,V>count - number of items to advancepublic void continueCursor()
Cursor
continueCursor in interface Cursor<K,V>public void continueCursor(K key)
Cursor
continueCursor in interface Cursor<K,V>key - key of the element to be pointed by the cursor.public void delete()
Cursor
delete in interface Cursor<K,V>public void update(V value)
Cursor
update in interface Cursor<K,V>value - new value to updatepublic boolean hasValue()
Cursor
hasValue in interface Cursor<K,V>protected int size()
protected void getIndexesValuesForObject(com.google.gwt.core.client.JavaScriptObject object,
Array<String> columnNames,
com.google.gwt.core.client.JsArrayMixed output)
protected void appendGroupColumns(StringBuilder sql)
protected SQLTransaction.SQLStatementErrorCallback getErrorHandler(Callback callback)
public Cursor.CursorDirection getDirection()
Cursor
getDirection in interface Cursor<K,V>public V getValue()
Cursor
getValue in interface Cursor<K,V>public com.google.gwt.core.client.JsArrayMixed getNativeArrayKey()
Cursor
getNativeArrayKey in interface Cursor<K,V>protected void fireSuccess()
protected abstract void setObjectKey(V object,
P key)
protected abstract Array<String> getIndexedColumnNames()
protected abstract P getPrimaryKey()
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 void addPrimaryKeyToQuery(P key,
StringBuilder sql,
com.google.gwt.core.client.JsArrayMixed args)
protected abstract void encodeObject(V object,
WSQLAbstractObjectStore.EncodeCallback callback)
protected abstract V decodeObject(String encodedObject)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||