org.cruxframework.crux.core.client.db
Class WSQLTransaction

java.lang.Object
  extended by org.cruxframework.crux.core.client.db.DBObject
      extended by org.cruxframework.crux.core.client.db.Transaction
          extended by org.cruxframework.crux.core.client.db.WSQLTransaction
All Implemented Interfaces:
SQLDatabase.SQLCallback, SQLDatabase.SQLTransactionCallback, SQLDatabase.SQLTransactionErrorCallback

public class WSQLTransaction
extends Transaction
implements SQLDatabase.SQLTransactionCallback, SQLDatabase.SQLTransactionErrorCallback, SQLDatabase.SQLCallback

A transaction on Crux Database, To create transactions, use one of Database's getTransaction() method.

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
static class WSQLTransaction.RequestOperation
           
 
Nested classes/interfaces inherited from class org.cruxframework.crux.core.client.db.Transaction
Transaction.Mode, Transaction.TransactionCallback
 
Field Summary
protected  WSQLAbstractDatabase db
           
 
Fields inherited from class org.cruxframework.crux.core.client.db.Transaction
transactionCallback
 
Fields inherited from class org.cruxframework.crux.core.client.db.DBObject
logger
 
Constructor Summary
protected WSQLTransaction(WSQLAbstractDatabase db, String[] storeNames, Transaction.Mode mode)
           
 
Method Summary
 void abort()
          Abort current transaction and rollback operations.
 void abort(boolean fireEvent)
          Abort current transaction and rollback operations.
 void addRequest(WSQLTransaction.RequestOperation operation, Transaction.Mode[] supportedMode)
           
 FileStore getFileStore()
          Retrieve a specialized object store for files handling.
<K,V> ObjectStore<K,V>
getObjectStore(String storeName)
          Retrieve an ObjectStore manipulated by the current transaction.
 void onError(SQLError error)
           
 void onError(String errorMessage)
           
 void onSuccess()
           
 void onTransaction(SQLTransaction tx)
           
 
Methods inherited from class org.cruxframework.crux.core.client.db.Transaction
containsObjectStore, getMode, getStoreNames, setTransactionCallback
 
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
 

Field Detail

db

protected final WSQLAbstractDatabase db
Constructor Detail

WSQLTransaction

protected WSQLTransaction(WSQLAbstractDatabase db,
                          String[] storeNames,
                          Transaction.Mode mode)
Method Detail

onTransaction

public void onTransaction(SQLTransaction tx)
Specified by:
onTransaction in interface SQLDatabase.SQLTransactionCallback

onError

public void onError(SQLError error)
Specified by:
onError in interface SQLDatabase.SQLTransactionErrorCallback

onError

public void onError(String errorMessage)

onSuccess

public void onSuccess()
Specified by:
onSuccess in interface SQLDatabase.SQLCallback

getObjectStore

public <K,V> ObjectStore<K,V> getObjectStore(String storeName)
Retrieve an ObjectStore manipulated by the current transaction.

Specified by:
getObjectStore in class Transaction
Type Parameters:
K -
V -
Parameters:
storeName -
Returns:

abort

public void abort()
Abort current transaction and rollback operations.

Specified by:
abort in class Transaction

abort

public void abort(boolean fireEvent)
Abort current transaction and rollback operations.

Parameters:
fireEvent -

getFileStore

public FileStore getFileStore()
Retrieve a specialized object store for files handling.

Specified by:
getFileStore in class Transaction
Returns:

addRequest

public void addRequest(WSQLTransaction.RequestOperation operation,
                       Transaction.Mode[] supportedMode)


Copyright © 2014. All rights reserved.