public interface OBasicTransaction
Modifier and Type | Field and Description |
---|---|
static ORecord |
DELETED_RECORD
Indicates the record deleted in a transaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangedDocument(ODocument document)
Adds the given document to a set of changed documents known to this transaction.
|
void |
addIndexEntry(OIndex index,
String indexName,
OTransactionIndexChanges.OPERATION operation,
Object key,
OIdentifiable value)
Adds the transactional index entry in this transaction.
|
void |
deleteRecord(ORecord record,
ODatabase.OPERATION_MODE mode)
Deletes the given record in this transaction.
|
default int |
getClientTransactionId() |
Object |
getCustomData(String name)
Obtains the custom value by its name stored in the context of this transaction.
|
int |
getId() |
OTransactionIndexChanges |
getIndexChanges(String indexName)
Obtains the index changes done in the context of this transaction.
|
OTransactionIndexChanges |
getIndexChangesInternal(String indexName)
Does the same thing as
getIndexChanges(String) , but handles remote storages in a
special way. |
ORecord |
getRecord(ORID rid)
Resolves a record with the given RID in the context of this transaction.
|
boolean |
isActive() |
ORecord |
saveRecord(ORecord record,
String clusterName,
ODatabase.OPERATION_MODE operationMode,
boolean forceCreate,
ORecordCallback<? extends Number> createdCallback,
ORecordCallback<Integer> updatedCallback)
Saves the given record in this transaction.
|
void |
setCustomData(String name,
Object value)
Sets the custom value by its name stored in the context of this transaction.
|
static final ORecord DELETED_RECORD
getRecord(ORID)
boolean isActive()
true
if this transaction is active, false
otherwise.ORecord saveRecord(ORecord record, String clusterName, ODatabase.OPERATION_MODE operationMode, boolean forceCreate, ORecordCallback<? extends Number> createdCallback, ORecordCallback<Integer> updatedCallback)
record
- the record to save.clusterName
- record's cluster name.operationMode
- the operation mode.forceCreate
- the force creation flag, true
to force the creation of the record,
false
to allow updates.createdCallback
- the callback to invoke when the record save operation triggered the
creation of the record.updatedCallback
- the callback to invoke when the record save operation triggered the
update of the record.void deleteRecord(ORecord record, ODatabase.OPERATION_MODE mode)
record
- the record to delete.mode
- the operation mode.ORecord getRecord(ORID rid)
rid
- the record RID.null
if no record is found, or DELETED_RECORD
if the record was deleted in this transaction.void addIndexEntry(OIndex index, String indexName, OTransactionIndexChanges.OPERATION operation, Object key, OIdentifiable value)
index
- the index.indexName
- the index name.operation
- the index operation to register.key
- the index key.value
- the index key value.void addChangedDocument(ODocument document)
document
- the document to add.OTransactionIndexChanges getIndexChanges(String indexName)
indexName
- the index name.null
if index is not found.OTransactionIndexChanges getIndexChangesInternal(String indexName)
getIndexChanges(String)
, but handles remote storages in a
special way.indexName
- the index name.null
if index is not found or storage is
remote.Object getCustomData(String name)
name
- the value name.null
if no value found.void setCustomData(String name, Object value)
name
- the value name.value
- the value to store.default int getClientTransactionId()
int getId()
Copyright © 2009–2020 OrientDB. All rights reserved.