@Deprecated public class ODatabaseDocumentTx extends Object implements ODatabaseDocumentInternal
OrientDB
instead.ODatabase.ATTRIBUTES, ODatabase.OPERATION_MODE, ODatabase.STATUS
Modifier and Type | Field and Description |
---|---|
protected static ConcurrentMap<String,OrientDBInternal> |
embedded
Deprecated.
|
protected ODatabaseDocumentInternal |
internal
Deprecated.
|
protected AtomicReference<Thread> |
owner
Deprecated.
|
protected static ConcurrentMap<String,OrientDBInternal> |
remote
Deprecated.
|
TYPE
Modifier | Constructor and Description |
---|---|
protected |
ODatabaseDocumentTx(ODatabaseDocumentInternal ref,
String baseUrl)
Deprecated.
|
|
ODatabaseDocumentTx(String url)
Deprecated.
|
protected |
ODatabaseDocumentTx(String url,
boolean ownerProtection)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ODatabase |
activateOnCurrentThread()
Deprecated.
Activate current database instance on current thread.
|
int |
addBlobCluster(String iClusterName,
Object... iParameters)
Deprecated.
Add a cluster for blob records.
|
int |
addCluster(String iClusterName,
int iRequestedId)
Deprecated.
Adds a new cluster.
|
int |
addCluster(String iClusterName,
Object... iParameters)
Deprecated.
Adds a new cluster.
|
void |
afterCreateOperations(OIdentifiable id)
Deprecated.
|
void |
afterDeleteOperations(OIdentifiable id)
Deprecated.
|
void |
afterReadOperations(OIdentifiable identifiable)
Deprecated.
|
void |
afterUpdateOperations(OIdentifiable id)
Deprecated.
|
int |
assignAndCheckCluster(ORecord record,
String iClusterName)
Deprecated.
|
List<String> |
backup(OutputStream out,
Map<String,Object> options,
Callable<Object> callable,
OCommandOutputListener iListener,
int compressionLevel,
int bufferSize)
Deprecated.
Executes a backup of the database.
|
OIdentifiable |
beforeCreateOperations(OIdentifiable id,
String iClusterName)
Deprecated.
|
void |
beforeDeleteOperations(OIdentifiable id,
String iClusterName)
Deprecated.
|
boolean |
beforeReadOperations(OIdentifiable identifiable)
Deprecated.
|
OIdentifiable |
beforeUpdateOperations(OIdentifiable id,
String iClusterName)
Deprecated.
|
ODatabase<ORecord> |
begin()
Deprecated.
Begins a new transaction.
|
ODatabase<ORecord> |
begin(OTransaction.TXTYPE iStatus)
Deprecated.
Begins a new transaction specifying the transaction type.
|
ODatabase<ORecord> |
begin(OTransaction iTx)
Deprecated.
Attaches a transaction as current.
|
ORecordIteratorClass<ODocument> |
browseClass(String iClassName)
Deprecated.
Browses all the records of the specified class and also all the subclasses.
|
ORecordIteratorClass<ODocument> |
browseClass(String iClassName,
boolean iPolymorphic)
Deprecated.
Browses all the records of the specified class and if iPolymorphic is true also all the
subclasses.
|
ORecordIteratorCluster<ODocument> |
browseCluster(String iClusterName)
Deprecated.
Browses all the records of the specified cluster.
|
<REC extends ORecord> |
browseCluster(String iClusterName,
Class<REC> iRecordClass)
Deprecated.
Browses all the records of the specified cluster of the passed record type.
|
<REC extends ORecord> |
browseCluster(String iClusterName,
Class<REC> iRecordClass,
long startClusterPosition,
long endClusterPosition)
Deprecated.
|
<REC extends ORecord> |
browseCluster(String iClusterName,
Class<REC> iRecordClass,
long startClusterPosition,
long endClusterPosition,
boolean loadTombstones)
Deprecated.
|
ORecordIteratorCluster<ODocument> |
browseCluster(String iClusterName,
long startClusterPosition,
long endClusterPosition,
boolean loadTombstones)
Deprecated.
|
ORecordHook.RESULT |
callbackHooks(ORecordHook.TYPE type,
OIdentifiable id)
Deprecated.
|
void |
callOnCloseListeners()
Deprecated.
|
void |
callOnDropListeners()
Deprecated.
|
void |
callOnOpenListeners()
Deprecated.
|
void |
checkForClusterPermissions(String name)
Deprecated.
|
void |
checkIfActive()
Deprecated.
|
protected void |
checkOpenness()
Deprecated.
|
<DB extends ODatabaseDocument> |
checkSecurity(ORule.ResourceGeneric iResourceGeneric,
int iOperation,
Object... iResourcesSpecific)
Deprecated.
Checks if the operation against multiple resources is allowed for the current user.
|
<DB extends ODatabaseDocument> |
checkSecurity(ORule.ResourceGeneric iResourceGeneric,
int iOperation,
Object iResourceSpecific)
Deprecated.
Checks if the operation on a resource is allowed for the current user.
|
<DB extends ODatabaseDocument> |
checkSecurity(ORule.ResourceGeneric resourceGeneric,
String resourceSpecific,
int iOperation)
Deprecated.
Checks if the operation on a resource is allowed for the current user.
|
<DB extends ODatabaseDocument> |
checkSecurity(String iResource,
int iOperation)
Deprecated.
Checks if the operation on a resource is allowed for the current user.
|
<DB extends ODatabaseDocument> |
checkSecurity(String iResourceGeneric,
int iOperation,
Object... iResourcesSpecific)
Deprecated.
Checks if the operation against multiple resources is allowed for the current user.
|
<DB extends ODatabaseDocument> |
checkSecurity(String iResourceGeneric,
int iOperation,
Object iResourceSpecific)
Deprecated.
Checks if the operation on a resource is allowed for the current user.
|
ODatabaseDocumentInternal |
cleanOutRecord(ORID rid,
int version)
Deprecated.
|
protected void |
clearOwner()
Deprecated.
|
void |
close()
Deprecated.
Closes an opened database, if the database is already closed does nothing, if a transaction is
active will be rollback.
|
static void |
closeAll()
Deprecated.
|
<RET extends OCommandRequest> |
command(OCommandRequest iCommand)
Deprecated.
Creates a command request to run a command against the database (you have to invoke
.execute(parameters) to actually execute it).
|
OResultSet |
command(String query,
Map args)
Deprecated.
Executes a generic (idempotent or non idempotent) command.
|
OResultSet |
command(String query,
Object... args)
Deprecated.
Executes a generic (idempotent or non idempotent) command.
|
ODatabase<ORecord> |
commit()
Deprecated.
Commits the current transaction.
|
ODatabase<ORecord> |
commit(boolean force)
Deprecated.
|
ODatabaseDocumentTx |
copy()
Deprecated.
|
long |
countClass(String iClassName)
Deprecated.
Counts the entities contained in the specified class and sub classes (polymorphic).
|
long |
countClass(String iClassName,
boolean iPolymorphic)
Deprecated.
Counts the entities contained in the specified class.
|
long |
countClusterElements(int iCurrentClusterId)
Deprecated.
Counts all the entities in the specified cluster id.
|
long |
countClusterElements(int[] iClusterIds)
Deprecated.
Counts all the entities in the specified cluster ids.
|
long |
countClusterElements(int[] iClusterIds,
boolean countTombstones)
Deprecated.
|
long |
countClusterElements(int iCurrentClusterId,
boolean countTombstones)
Deprecated.
|
long |
countClusterElements(String iClusterName)
Deprecated.
Counts all the entities in the specified cluster name.
|
long |
countView(String viewName)
Deprecated.
|
<DB extends ODatabase> |
create()
Deprecated.
Creates a new database.
|
<DB extends ODatabase> |
create(Map<OGlobalConfiguration,Object> iInitialSettings)
Deprecated.
Creates a new database passing initial settings.
|
<DB extends ODatabase> |
create(String incrementalBackupPath)
Deprecated.
|
boolean |
declareIntent(OIntent iIntent)
Deprecated.
Declares an intent to the database.
|
ODatabase<ORecord> |
delete(ORecord iObject)
Deprecated.
Deletes an entity from the database in synchronous mode.
|
ODatabase<ORecord> |
delete(ORID iRID)
Deprecated.
Deletes the entity with the received RID from the database.
|
ODatabase<ORecord> |
delete(ORID iRID,
int iVersion)
Deprecated.
Deletes the entity with the received RID from the database.
|
void |
drop()
Deprecated.
Drops a database.
|
boolean |
dropCluster(int iClusterId)
Deprecated.
Drops a cluster by its id.
|
boolean |
dropCluster(String iClusterName)
Deprecated.
Drops a cluster by its name.
|
OResultSet |
execute(String language,
String script,
Map<String,?> args)
Deprecated.
Execute a script of a specified query language The result set has to be closed after usage
Sample usage: |
OResultSet |
execute(String language,
String script,
Object... args)
Deprecated.
Execute a script in a specified query language.
|
void |
executeDeleteRecord(OIdentifiable record,
int iVersion,
boolean iRequired,
ODatabase.OPERATION_MODE iMode,
boolean prohibitTombstones)
Deprecated.
|
<RET extends ORecord> |
executeReadRecord(ORecordId rid,
ORecord iRecord,
int recordVersion,
String fetchPlan,
boolean ignoreCache,
boolean iUpdateCache,
boolean loadTombstones,
OStorage.LOCKING_STRATEGY lockingStrategy,
RecordReader recordReader)
Deprecated.
|
boolean |
exists()
Deprecated.
Checks if the database exists.
|
boolean |
existsCluster(String iClusterName)
Deprecated.
Returns true if the cluster exists, otherwise false.
|
void |
freeze()
Deprecated.
Flush all indexes and cached storage content to the disk.
|
void |
freeze(boolean throwException)
Deprecated.
Flush all indexes and cached storage content to the disk.
|
Object |
get(ODatabase.ATTRIBUTES iAttribute)
Deprecated.
Returns a database attribute value
|
OIntent |
getActiveIntent()
Deprecated.
Get the active intent in the current session.
|
Set<Integer> |
getBlobClusterIds()
Deprecated.
Retrieve the set of defined blob cluster.
|
int |
getClusterIdByName(String iClusterName)
Deprecated.
Returns the cluster id by name.
|
String |
getClusterName(ORecord record)
Deprecated.
|
String |
getClusterNameById(int iClusterId)
Deprecated.
Returns the cluster name by id.
|
Collection<String> |
getClusterNames()
Deprecated.
Returns all the names of the clusters.
|
long |
getClusterRecordSizeById(int iClusterId)
Deprecated.
Returns the total size of records contained in the cluster defined by its id.
|
long |
getClusterRecordSizeByName(String iClusterName)
Deprecated.
Returns the total size of records contained in the cluster defined by its name.
|
int |
getClusters()
Deprecated.
Returns the number of clusters.
|
Map<UUID,OBonsaiCollectionPointer> |
getCollectionsChanges()
Deprecated.
|
OContextConfiguration |
getConfiguration()
Deprecated.
Returns the database configuration settings.
|
ORecordConflictStrategy |
getConflictStrategy()
Deprecated.
Returns the current record conflict strategy.
|
ODatabaseInternal<?> |
getDatabaseOwner()
Deprecated.
Returns the database owner.
|
int |
getDefaultClusterId()
Deprecated.
Returns the default cluster id.
|
static ORecordSerializer |
getDefaultSerializer()
Deprecated.
|
ODictionary<ORecord> |
getDictionary()
Deprecated.
|
Map<ORecordHook,ORecordHook.HOOK_POSITION> |
getHooks()
Deprecated.
Retrieves all the registered hooks.
|
Iterable<ODatabaseListener> |
getListeners()
Deprecated.
Retrieves all the registered listeners.
|
OLocalRecordCache |
getLocalCache()
Deprecated.
Returns the level1 cache.
|
OMetadataInternal |
getMetadata()
Deprecated.
Return the OMetadata instance.
|
OBasicTransaction |
getMicroOrRegularTransaction()
Deprecated.
The active implicit micro-transaction or active/inactive regular transaction.
|
String |
getName()
Deprecated.
Returns the database name.
|
protected static OrientDBInternal |
getOrCreateEmbeddedFactory(String baseUrl,
OrientDBConfig config)
Deprecated.
|
protected static OrientDBInternal |
getOrCreateRemoteFactory(String baseUrl)
Deprecated.
|
Iterator<Map.Entry<String,Object>> |
getProperties()
Deprecated.
Returns an iterator of the property entries
|
Object |
getProperty(String iName)
Deprecated.
Gets the property value.
|
<RET extends ORecord> |
getRecord(OIdentifiable iIdentifiable)
Deprecated.
Returns the record for a OIdentifiable instance.
|
ORecordMetadata |
getRecordMetadata(ORID rid)
Deprecated.
|
byte |
getRecordType()
Deprecated.
Returns the default record type for this kind of database.
|
OSBTreeCollectionManager |
getSbTreeCollectionManager()
Deprecated.
Internal.
|
ORecordSerializer |
getSerializer()
Deprecated.
|
OBinarySerializerFactory |
getSerializerFactory()
Deprecated.
|
OSharedContext |
getSharedContext()
Deprecated.
|
long |
getSize()
Deprecated.
Returns the total size of database as used space.
|
ODatabase.STATUS |
getStatus()
Deprecated.
Returns the current status of database.
|
OStorage |
getStorage()
Deprecated.
|
OStorageInfo |
getStorageInfo()
Deprecated.
|
OCurrentStorageComponentsFactory |
getStorageVersions()
Deprecated.
Internal.
|
OTransaction |
getTransaction()
Deprecated.
Return active transaction.
|
String |
getType()
Deprecated.
|
<DB extends ODatabase> |
getUnderlying()
Deprecated.
Return the underlying database.
|
String |
getURL()
Deprecated.
Returns the database URL.
|
OSecurityUser |
getUser()
Deprecated.
Returns the current user logged into the database.
|
OView |
getViewFromCluster(int cluster)
Deprecated.
|
String |
incrementalBackup(String path)
Deprecated.
Performs incremental backup of database content to the selected folder.
|
void |
internalClose(boolean recycle)
Deprecated.
|
void |
internalCommit(OTransactionInternal transaction)
Deprecated.
Executed the commit on the storage hiding away storage concepts from the transaction
|
void |
internalLockRecord(OIdentifiable iRecord,
OStorage.LOCKING_STRATEGY lockingStrategy)
Deprecated.
|
void |
internalUnlockRecord(OIdentifiable iRecord)
Deprecated.
|
boolean |
isActiveOnCurrentThread()
Deprecated.
Returns true if the current database instance is active on current thread, otherwise false.
|
boolean |
isClosed()
Deprecated.
Checks if the database is closed.
|
boolean |
isClusterEdge(int cluster)
Deprecated.
|
boolean |
isClusterVertex(int cluster)
Deprecated.
|
boolean |
isClusterView(int cluster)
Deprecated.
|
boolean |
isMVCC()
Deprecated.
Returns if the Multi Version Concurrency Control is enabled or not.
|
boolean |
isPooled()
Deprecated.
|
boolean |
isPrefetchRecords()
Deprecated.
|
boolean |
isRemote()
Deprecated.
|
boolean |
isRetainRecords()
Deprecated.
Returns true if current configuration retains objects, otherwise false
|
boolean |
isUseLightweightEdges()
Deprecated.
|
boolean |
isValidationEnabled()
Deprecated.
Tells if validation of record is active.
|
OLiveQueryMonitor |
live(String query,
OLiveQueryResultListener listener,
Map<String,?> args)
Deprecated.
Subscribe a query as a live query for future create/update event with the referred conditions
|
OLiveQueryMonitor |
live(String query,
OLiveQueryResultListener listener,
Object... args)
Deprecated.
Subscribe a query as a live query for future create/update event with the referred conditions
|
<RET extends ORecord> |
load(ORecord iObject)
Deprecated.
Loads the entity and return it.
|
<RET extends ORecord> |
load(ORecord iObject,
String iFetchPlan)
Deprecated.
Loads a record using a fetch plan.
|
<RET extends ORecord> |
load(ORecord iObject,
String iFetchPlan,
boolean iIgnoreCache)
Deprecated.
Loads a record using a fetch plan.
|
<RET extends ORecord> |
load(ORID recordId)
Deprecated.
Loads the entity by the Record ID.
|
<RET extends ORecord> |
load(ORID iRecordId,
String iFetchPlan)
Deprecated.
Loads the entity by the Record ID using a fetch plan.
|
<RET extends ORecord> |
load(ORID iRecordId,
String iFetchPlan,
boolean iIgnoreCache)
Deprecated.
Loads the entity by the Record ID using a fetch plan and specifying if the cache must be
ignored.
|
<RET extends ORecord> |
loadIfVersionIsNotLatest(ORID rid,
int recordVersion,
String fetchPlan,
boolean ignoreCache)
Deprecated.
|
<RET extends ORecord> |
lock(ORID recordId)
Deprecated.
Pessimistic lock a record.
|
<RET extends ORecord> |
lock(ORID recordId,
long timeout,
TimeUnit timeoutUnit)
Deprecated.
Pessimistic lock a record.
|
OBlob |
newBlob()
Deprecated.
Create a new empty instance of a blob.
|
OBlob |
newBlob(byte[] bytes)
Deprecated.
Create a new instance of a blob containing the given bytes.
|
OEdge |
newEdge(OVertex from,
OVertex to,
OClass type)
Deprecated.
Creates a new Edge
|
OEdge |
newEdge(OVertex from,
OVertex to,
String type)
Deprecated.
Creates a new Edge
|
OElement |
newElement()
Deprecated.
|
OElement |
newElement(String className)
Deprecated.
|
OElement |
newEmbeddedElement()
Deprecated.
|
OElement |
newEmbeddedElement(String className)
Deprecated.
|
ODocument |
newInstance()
Deprecated.
Creates a new entity instance.
|
ODocument |
newInstance(String iClassName)
Deprecated.
Creates a new entity instance.
|
OEdge |
newLightweightEdge(String iClassName,
OVertex from,
OVertex to)
Deprecated.
|
OEdge |
newRegularEdge(String iClassName,
OVertex from,
OVertex to)
Deprecated.
|
OVertex |
newVertex(OClass type)
Deprecated.
Creates a new Vertex
|
OVertex |
newVertex(String iClassName)
Deprecated.
Creates a new Vertex
|
<DB extends ODatabase> |
open(OToken iToken)
Deprecated.
Opens a database using an authentication token received as an argument.
|
<DB extends ODatabase> |
open(String iUserName,
String iUserPassword)
Deprecated.
Opens a database using the user and password received as arguments.
|
<RET extends List<?>> |
query(OQuery<?> iCommand,
Object... iArgs)
Deprecated.
Execute a query against the database.
|
OResultSet |
query(String query,
Map args)
Deprecated.
Executes an SQL query (idempotent).
|
OResultSet |
query(String query,
Object... args)
Deprecated.
Executes an SQL query.
|
void |
rawBegin(OTransaction transaction)
Deprecated.
|
void |
recycle(ORecord record)
Deprecated.
|
<DB extends ODatabase<?>> |
registerHook(ORecordHook iHookImpl)
Deprecated.
Registers a hook to listen all events for Records.
|
<DB extends ODatabase<?>> |
registerHook(ORecordHook iHookImpl,
ORecordHook.HOOK_POSITION iPosition)
Deprecated.
|
void |
registerListener(ODatabaseListener iListener)
Deprecated.
Registers a listener to the database events.
|
void |
release()
Deprecated.
Allows to execute write-related commands on DB.
|
void |
reload()
Deprecated.
Reloads the database information like the cluster list.
|
<RET extends ORecord> |
reload(ORecord iObject,
String iFetchPlan,
boolean iIgnoreCache)
Deprecated.
Force the reloading of the entity.
|
<RET extends ORecord> |
reload(ORecord iObject,
String iFetchPlan,
boolean iIgnoreCache,
boolean force)
Deprecated.
Force the reloading of the entity.
|
void |
reloadUser()
Deprecated.
|
void |
replaceStorage(OStorage iNewStorage)
Deprecated.
Internal only: replace the storage with a new one.
|
void |
resetInitialization()
Deprecated.
|
void |
restore(InputStream in,
Map<String,Object> options,
Callable<Object> callable,
OCommandOutputListener iListener)
Deprecated.
Executes a restore of a database backup.
|
ODatabase<ORecord> |
rollback()
Deprecated.
Aborts the current running transaction.
|
ODatabase<ORecord> |
rollback(boolean force)
Deprecated.
|
<RET extends ORecord> |
save(ORecord iObject)
Deprecated.
Saves an entity in synchronous mode.
|
<RET extends ORecord> |
save(ORecord iObject,
ODatabase.OPERATION_MODE iMode,
boolean iForceCreate,
ORecordCallback<? extends Number> iRecordCreatedCallback,
ORecordCallback<Integer> iRecordUpdatedCallback)
Deprecated.
Saves an entity specifying the mode.
|
<RET extends ORecord> |
save(ORecord iObject,
String iClusterName)
Deprecated.
Saves an entity in the specified cluster in synchronous mode.
|
<RET extends ORecord> |
save(ORecord iObject,
String iClusterName,
ODatabase.OPERATION_MODE iMode,
boolean iForceCreate,
ORecordCallback<? extends Number> iRecordCreatedCallback,
ORecordCallback<Integer> iRecordUpdatedCallback)
Deprecated.
Saves an entity in the specified cluster specifying the mode.
|
ORecord |
saveAll(ORecord iRecord,
String iClusterName,
ODatabase.OPERATION_MODE iMode,
boolean iForceCreate,
ORecordCallback<? extends Number> iRecordCreatedCallback,
ORecordCallback<Integer> iRecordUpdatedCallback)
Deprecated.
|
<T> T |
sendSequenceAction(OSequenceAction action)
Deprecated.
|
<DB extends ODatabase> |
set(ODatabase.ATTRIBUTES iAttribute,
Object iValue)
Deprecated.
Sets a database attribute value
|
<DB extends ODatabase<?>> |
setConflictStrategy(ORecordConflictStrategy iResolver)
Deprecated.
Overrides record conflict strategy.
|
<DB extends ODatabase<?>> |
setConflictStrategy(String iStrategyName)
Deprecated.
Overrides record conflict strategy selecting the strategy by name.
|
<DB extends ODatabase> |
setCustom(String name,
Object iValue)
Deprecated.
|
ODatabaseInternal<?> |
setDatabaseOwner(ODatabaseInternal<?> iOwner)
Deprecated.
Internal.
|
static void |
setDefaultSerializer(ORecordSerializer defaultSerializer)
Deprecated.
|
void |
setDefaultTransactionMode(Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks)
Deprecated.
|
void |
setInternal(ODatabase.ATTRIBUTES attribute,
Object iValue)
Deprecated.
Internal method.
|
<DB extends ODatabase<?>> |
setMVCC(boolean iValue)
Deprecated.
Enables or disables the Multi-Version Concurrency Control.
|
void |
setPrefetchRecords(boolean prefetchRecords)
Deprecated.
|
Object |
setProperty(String iName,
Object iValue)
Deprecated.
Sets a property value
|
ODatabaseDocument |
setRetainRecords(boolean iValue)
Deprecated.
Specifies if retain handled objects in memory or not.
|
void |
setSerializer(ORecordSerializer serializer)
Deprecated.
|
<DB extends ODatabase> |
setStatus(ODatabase.STATUS iStatus)
Deprecated.
Set the current status of database.
|
protected void |
setupThreadOwner()
Deprecated.
|
void |
setUseLightweightEdges(boolean b)
Deprecated.
|
void |
setUser(OSecurityUser user)
Deprecated.
Set user for current database instance.
|
<DB extends ODatabaseDocument> |
setValidationEnabled(boolean iEnabled)
Deprecated.
Enables or disables the record validation.
|
void |
truncateCluster(String clusterName)
Deprecated.
Removes all data in the cluster with given name.
|
void |
unlock(ORID recordId)
Deprecated.
Pessimistic unlock
|
<DB extends ODatabase<?>> |
unregisterHook(ORecordHook iHookImpl)
Deprecated.
Unregisters a previously registered hook.
|
void |
unregisterListener(ODatabaseListener iListener)
Deprecated.
Unregisters a listener to the database events.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getActiveQueries, getActiveQuery, getHaStatus, indexQuery, isDistributed, queryOnNode, realClose, removeHaServer, reuse, swapTx, sync, syncCommit
createClassIfNotExist, createEdgeClass, createVertexClass, newEdge, newVertex
createClass, executeWithRetry, getClass
getActiveClusterMap, getActiveDataCenterMap, getEnterpriseEndpoint, getLocalNodeName, isSharded
protected static ConcurrentMap<String,OrientDBInternal> embedded
protected static ConcurrentMap<String,OrientDBInternal> remote
protected ODatabaseDocumentInternal internal
protected final AtomicReference<Thread> owner
@Deprecated public ODatabaseDocumentTx(String url)
protected ODatabaseDocumentTx(String url, boolean ownerProtection)
protected ODatabaseDocumentTx(ODatabaseDocumentInternal ref, String baseUrl)
public static void closeAll()
protected static OrientDBInternal getOrCreateRemoteFactory(String baseUrl)
protected static OrientDBInternal getOrCreateEmbeddedFactory(String baseUrl, OrientDBConfig config)
public static ORecordSerializer getDefaultSerializer()
public static void setDefaultSerializer(ORecordSerializer defaultSerializer)
public OCurrentStorageComponentsFactory getStorageVersions()
ODatabaseDocumentInternal
getStorageVersions
in interface ODatabaseDocumentInternal
public OSBTreeCollectionManager getSbTreeCollectionManager()
ODatabaseDocumentInternal
getSbTreeCollectionManager
in interface ODatabaseDocumentInternal
public OBinarySerializerFactory getSerializerFactory()
getSerializerFactory
in interface ODatabaseDocumentInternal
public ORecordSerializer getSerializer()
getSerializer
in interface ODatabaseDocumentInternal
public int assignAndCheckCluster(ORecord record, String iClusterName)
assignAndCheckCluster
in interface ODatabaseDocumentInternal
public <RET extends ORecord> RET loadIfVersionIsNotLatest(ORID rid, int recordVersion, String fetchPlan, boolean ignoreCache) throws ORecordNotFoundException
loadIfVersionIsNotLatest
in interface ODatabaseDocumentInternal
ORecordNotFoundException
public void reloadUser()
reloadUser
in interface ODatabaseDocumentInternal
public ORecordHook.RESULT callbackHooks(ORecordHook.TYPE type, OIdentifiable id)
callbackHooks
in interface ODatabaseDocumentInternal
public <RET extends ORecord> RET executeReadRecord(ORecordId rid, ORecord iRecord, int recordVersion, String fetchPlan, boolean ignoreCache, boolean iUpdateCache, boolean loadTombstones, OStorage.LOCKING_STRATEGY lockingStrategy, RecordReader recordReader)
executeReadRecord
in interface ODatabaseDocumentInternal
public void executeDeleteRecord(OIdentifiable record, int iVersion, boolean iRequired, ODatabase.OPERATION_MODE iMode, boolean prohibitTombstones)
executeDeleteRecord
in interface ODatabaseDocumentInternal
public void setDefaultTransactionMode(Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks)
setDefaultTransactionMode
in interface ODatabaseDocumentInternal
public OMetadataInternal getMetadata()
ODatabase
getMetadata
in interface ODatabase<ORecord>
getMetadata
in interface ODatabaseDocumentInternal
public <DB extends ODatabase<?>> DB registerHook(ORecordHook iHookImpl)
ODatabase
registerHook
in interface ODatabase<ORecord>
iHookImpl
- ORecordHook implementationpublic <DB extends ODatabase<?>> DB registerHook(ORecordHook iHookImpl, ORecordHook.HOOK_POSITION iPosition)
registerHook
in interface ODatabase<ORecord>
public Map<ORecordHook,ORecordHook.HOOK_POSITION> getHooks()
ODatabase
public <DB extends ODatabase<?>> DB unregisterHook(ORecordHook iHookImpl)
ODatabase
unregisterHook
in interface ODatabase<ORecord>
iHookImpl
- ORecordHook implementationpublic boolean isMVCC()
ODatabase
isMVCC
in interface ODatabase<ORecord>
deprecated since 2.2
public Iterable<ODatabaseListener> getListeners()
ODatabase
getListeners
in interface ODatabase<ORecord>
public <DB extends ODatabase<?>> DB setMVCC(boolean iValue)
ODatabase
setMVCC
in interface ODatabase<ORecord>
ODatabase.isMVCC()
public ORecordConflictStrategy getConflictStrategy()
ODatabase
getConflictStrategy
in interface ODatabase<ORecord>
public <DB extends ODatabase<?>> DB setConflictStrategy(String iStrategyName)
ODatabase
setConflictStrategy
in interface ODatabase<ORecord>
iStrategyName
- ORecordConflictStrategy strategy namepublic <DB extends ODatabase<?>> DB setConflictStrategy(ORecordConflictStrategy iResolver)
ODatabase
setConflictStrategy
in interface ODatabase<ORecord>
iResolver
- ORecordConflictStrategy implementationpublic String incrementalBackup(String path)
ODatabase
If it will be first backup of data full content of database will be copied into folder otherwise only changes after last backup in the same folder will be copied.
incrementalBackup
in interface ODatabase<ORecord>
path
- Path to backup folder.public ODatabaseDocumentTx copy()
copy
in interface ODatabaseDocumentInternal
public void checkIfActive()
checkIfActive
in interface ODatabaseDocumentInternal
protected void checkOpenness()
public void callOnOpenListeners()
callOnOpenListeners
in interface ODatabaseDocumentInternal
public void callOnCloseListeners()
callOnCloseListeners
in interface ODatabaseDocumentInternal
@Deprecated public OStorage getStorage()
ODatabaseInternal
getStorage
in interface ODatabaseInternal<ORecord>
OStorage
public OBasicTransaction getMicroOrRegularTransaction()
ODatabaseInternal
getMicroOrRegularTransaction
in interface ODatabaseInternal<ORecord>
public void setUser(OSecurityUser user)
ODatabaseInternal
setUser
in interface ODatabaseInternal<ORecord>
public void replaceStorage(OStorage iNewStorage)
ODatabaseInternal
replaceStorage
in interface ODatabaseInternal<ORecord>
iNewStorage
- The new storage to use. Usually it's a wrapped instance of the current
cluster.public void resetInitialization()
resetInitialization
in interface ODatabaseInternal<ORecord>
public ODatabaseInternal<?> getDatabaseOwner()
ODatabaseInternal
getDatabaseOwner
in interface ODatabaseInternal<ORecord>
public ODatabaseInternal<?> setDatabaseOwner(ODatabaseInternal<?> iOwner)
ODatabaseInternal
setDatabaseOwner
in interface ODatabaseInternal<ORecord>
public <DB extends ODatabase> DB getUnderlying()
ODatabaseInternal
getUnderlying
in interface ODatabaseInternal<ORecord>
public void setInternal(ODatabase.ATTRIBUTES attribute, Object iValue)
ODatabaseInternal
setInternal
in interface ODatabaseInternal<ORecord>
public <DB extends ODatabase> DB open(OToken iToken)
ODatabaseInternal
open
in interface ODatabaseInternal<ORecord>
iToken
- Authentication tokenpublic OSharedContext getSharedContext()
getSharedContext
in interface ODatabaseInternal<ORecord>
public ORecordIteratorClass<ODocument> browseClass(String iClassName)
ODatabaseDocument
browseClass
in interface ODatabaseDocument
iClassName
- Class name to iteratepublic ORecordIteratorClass<ODocument> browseClass(String iClassName, boolean iPolymorphic)
ODatabaseDocument
browseClass
in interface ODatabaseDocument
iClassName
- Class name to iterateiPolymorphic
- Consider also the instances of the subclasses or notpublic void freeze()
ODatabaseDocument
After this call users can perform only select queries. All write-related commands will
queued till ODatabaseDocument.release()
command will be called.
Given command waits till all on going modifications in indexes or DB will be finished.
IMPORTANT: This command is not reentrant.
freeze
in interface ODatabaseDocument
freeze
in interface ODatabase<ORecord>
ODatabase.release()
public void release()
ODatabaseDocument
ODatabaseDocument.freeze()
command.release
in interface ODatabaseDocument
release
in interface ODatabase<ORecord>
ODatabase.freeze()
public void freeze(boolean throwException)
ODatabaseDocument
After this call users can perform only select queries. All write-related commands will
queued till ODatabaseDocument.release()
command will be called or exception will be thrown on attempt to
modify DB data. Concrete behaviour depends on throwException
parameter.
IMPORTANT: This command is not reentrant.
freeze
in interface ODatabaseDocument
freeze
in interface ODatabase<ORecord>
throwException
- If true
OModificationOperationProhibitedException
exception will be thrown in case of write command will be performed.public OVertex newVertex(String iClassName)
ODatabaseDocument
newVertex
in interface ODatabaseDocument
iClassName
- the vertex type (class name)public OVertex newVertex(OClass type)
ODatabaseDocument
newVertex
in interface ODatabaseDocument
type
- the vertex typepublic OEdge newEdge(OVertex from, OVertex to, String type)
ODatabaseDocument
newEdge
in interface ODatabaseDocument
from
- the starting point vertexto
- the endpoint vertextype
- the edge typepublic OEdge newEdge(OVertex from, OVertex to, OClass type)
ODatabaseDocument
newEdge
in interface ODatabaseDocument
from
- the starting point vertexto
- the endpoint vertextype
- the edge typepublic OElement newElement()
newElement
in interface ODatabaseDocument
public OElement newElement(String className)
newElement
in interface ODatabaseDocument
public OElement newEmbeddedElement()
newEmbeddedElement
in interface ODatabaseDocument
public OElement newEmbeddedElement(String className)
newEmbeddedElement
in interface ODatabaseDocument
public boolean isUseLightweightEdges()
isUseLightweightEdges
in interface ODatabaseDocumentInternal
public void setUseLightweightEdges(boolean b)
setUseLightweightEdges
in interface ODatabaseDocumentInternal
public ODocument newInstance()
ODatabase
newInstance
in interface ODatabase<ORecord>
@Deprecated public ODictionary<ORecord> getDictionary()
getDictionary
in interface ODatabase<ORecord>
public OSecurityUser getUser()
ODatabase
public <RET extends ORecord> RET load(ORecord iObject)
ODatabase
public <RET extends ORecord> RET load(ORecord iObject, String iFetchPlan)
ODatabase
public <RET extends ORecord> RET load(ORecord iObject, String iFetchPlan, boolean iIgnoreCache)
ODatabase
public <RET extends ORecord> RET reload(ORecord iObject, String iFetchPlan, boolean iIgnoreCache)
ODatabase
public <RET extends ORecord> RET reload(ORecord iObject, String iFetchPlan, boolean iIgnoreCache, boolean force)
ODatabase
reload
in interface ODatabase<ORecord>
iObject
- The entity to load. If the entity was already loaded it will be reloaded and all
the changes will be lost.iFetchPlan
- Fetch plan usediIgnoreCache
- Ignore cache or use itforce
- Force to reload record even if storage has the same record as reloaded record, it
is useful if fetch plan is not null and alongside with root record linked records will be
reloaded.public <RET extends ORecord> RET load(ORID recordId)
ODatabase
public <RET extends ORecord> RET load(ORID iRecordId, String iFetchPlan)
ODatabase
public <RET extends ORecord> RET load(ORID iRecordId, String iFetchPlan, boolean iIgnoreCache)
ODatabase
public <RET extends ORecord> RET save(ORecord iObject)
ODatabase
public <RET extends ORecord> RET save(ORecord iObject, ODatabase.OPERATION_MODE iMode, boolean iForceCreate, ORecordCallback<? extends Number> iRecordCreatedCallback, ORecordCallback<Integer> iRecordUpdatedCallback)
ODatabase
public <RET extends ORecord> RET save(ORecord iObject, String iClusterName)
ODatabase
public <RET extends ORecord> RET save(ORecord iObject, String iClusterName, ODatabase.OPERATION_MODE iMode, boolean iForceCreate, ORecordCallback<? extends Number> iRecordCreatedCallback, ORecordCallback<Integer> iRecordUpdatedCallback)
ODatabase
save
in interface ODatabase<ORecord>
iObject
- The entity to saveiClusterName
- Name of the cluster where to saveiMode
- Mode of save: synchronous (default) or asynchronousiForceCreate
- Flag that indicates that record should be created. If record with current
rid already exists, exception is thrownpublic ODatabase<ORecord> delete(ORecord iObject)
ODatabase
public ODatabase<ORecord> delete(ORID iRID)
ODatabase
public ODatabase<ORecord> delete(ORID iRID, int iVersion)
ODatabase
public ODatabaseDocumentInternal cleanOutRecord(ORID rid, int version)
cleanOutRecord
in interface ODatabaseDocumentInternal
public OTransaction getTransaction()
ODatabase
getTransaction
in interface ODatabase<ORecord>
public ODatabase<ORecord> begin()
ODatabase
ODatabase.commit()
or ODatabase.rollback()
.public ODatabase<ORecord> begin(OTransaction.TXTYPE iStatus)
ODatabase
ODatabase.commit()
or ODatabase.rollback()
.public ODatabase<ORecord> begin(OTransaction iTx) throws OTransactionException
ODatabase
begin
in interface ODatabase<ORecord>
OTransactionException
public void rawBegin(OTransaction transaction)
rawBegin
in interface ODatabaseDocumentInternal
public ODatabase<ORecord> commit() throws OTransactionException
ODatabase
commit
in interface ODatabase<ORecord>
OTransactionException
public ODatabase<ORecord> commit(boolean force) throws OTransactionException
commit
in interface ODatabase<ORecord>
OTransactionException
public ODatabase<ORecord> rollback() throws OTransactionException
ODatabase
rollback
in interface ODatabase<ORecord>
OTransactionException
public ODatabase<ORecord> rollback(boolean force) throws OTransactionException
rollback
in interface ODatabase<ORecord>
OTransactionException
public <RET extends List<?>> RET query(OQuery<?> iCommand, Object... iArgs)
ODatabase
public <RET extends OCommandRequest> RET command(OCommandRequest iCommand)
ODatabase
public ORecordIteratorCluster<ODocument> browseCluster(String iClusterName)
ODatabaseDocument
browseCluster
in interface ODatabaseDocument
iClusterName
- Cluster name to iteratepublic ORecordIteratorCluster<ODocument> browseCluster(String iClusterName, long startClusterPosition, long endClusterPosition, boolean loadTombstones)
browseCluster
in interface ODatabaseDocument
public <REC extends ORecord> ORecordIteratorCluster<REC> browseCluster(String iClusterName, Class<REC> iRecordClass)
ODatabaseDocument
browseCluster
in interface ODatabaseDocument
iClusterName
- Cluster name to iterateiRecordClass
- The record class expectedpublic <REC extends ORecord> ORecordIteratorCluster<REC> browseCluster(String iClusterName, Class<REC> iRecordClass, long startClusterPosition, long endClusterPosition)
browseCluster
in interface ODatabaseDocument
public <REC extends ORecord> ORecordIteratorCluster<REC> browseCluster(String iClusterName, Class<REC> iRecordClass, long startClusterPosition, long endClusterPosition, boolean loadTombstones)
browseCluster
in interface ODatabaseDocument
public <RET extends ORecord> RET getRecord(OIdentifiable iIdentifiable)
ODatabaseDocument
getRecord
in interface ODatabaseDocument
public byte getRecordType()
ODatabaseDocument
getRecordType
in interface ODatabaseDocument
public boolean isRetainRecords()
ODatabaseDocument
isRetainRecords
in interface ODatabaseDocument
ODatabaseDocument.setRetainRecords(boolean)
public ODatabaseDocument setRetainRecords(boolean iValue)
ODatabaseDocument
setRetainRecords
in interface ODatabaseDocument
iValue
- True to enable, false to disable it.ODatabaseDocument.isRetainRecords()
public <DB extends ODatabaseDocument> DB checkSecurity(ORule.ResourceGeneric resourceGeneric, String resourceSpecific, int iOperation)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
resourceGeneric
- Generic Resource where to execute the operationiOperation
- Operation to execute against the resourcepublic <DB extends ODatabaseDocument> DB checkSecurity(ORule.ResourceGeneric iResourceGeneric, int iOperation, Object iResourceSpecific)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
iResourceGeneric
- Resource where to execute the operation, i.e.: database.clustersiOperation
- Operation to execute against the resourceiResourceSpecific
- Target resource, i.e.: "employee" to specify the cluster name.public <DB extends ODatabaseDocument> DB checkSecurity(ORule.ResourceGeneric iResourceGeneric, int iOperation, Object... iResourcesSpecific)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
iResourceGeneric
- Resource where to execute the operation, i.e.: database.clustersiOperation
- Operation to execute against the resourceiResourcesSpecific
- Target resources as an array of Objects, i.e.: ["employee", 2] to
specify cluster name and id.public boolean isValidationEnabled()
ODatabaseDocument
isValidationEnabled
in interface ODatabaseDocument
public <DB extends ODatabaseDocument> DB setValidationEnabled(boolean iEnabled)
ODatabaseDocument
Since 2.2 this setting is persistent.
setValidationEnabled
in interface ODatabaseDocument
iEnabled
- True to enable, false to disablepublic <DB extends ODatabaseDocument> DB checkSecurity(String iResource, int iOperation)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
iResource
- Resource where to execute the operationiOperation
- Operation to execute against the resourcepublic <DB extends ODatabaseDocument> DB checkSecurity(String iResourceGeneric, int iOperation, Object iResourceSpecific)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
iResourceGeneric
- Resource where to execute the operation, i.e.: database.clustersiOperation
- Operation to execute against the resourceiResourceSpecific
- Target resource, i.e.: "employee" to specify the cluster name.public <DB extends ODatabaseDocument> DB checkSecurity(String iResourceGeneric, int iOperation, Object... iResourcesSpecific)
ODatabaseDocument
checkSecurity
in interface ODatabaseDocument
iResourceGeneric
- Resource where to execute the operation, i.e.: database.clustersiOperation
- Operation to execute against the resourceiResourcesSpecific
- Target resources as an array of Objects, i.e.: ["employee", 2] to
specify cluster name and id.public boolean isPooled()
isPooled
in interface ODatabaseDocument
true
if database is obtained from the pool and false
otherwise.public <DB extends ODatabase> DB open(String iUserName, String iUserPassword)
ODatabase
protected void setupThreadOwner()
protected void clearOwner()
public <DB extends ODatabase> DB create()
ODatabase
@Deprecated public <DB extends ODatabase> DB create(String incrementalBackupPath)
ODatabase
public <DB extends ODatabase> DB create(Map<OGlobalConfiguration,Object> iInitialSettings)
ODatabase
public ODatabase activateOnCurrentThread()
ODatabase
activateOnCurrentThread
in interface ODatabase<ORecord>
public boolean isActiveOnCurrentThread()
ODatabase
isActiveOnCurrentThread
in interface ODatabase<ORecord>
public void reload()
ODatabase
public void drop()
ODatabase
public OContextConfiguration getConfiguration()
ODatabase
getConfiguration
in interface ODatabase<ORecord>
public boolean declareIntent(OIntent iIntent)
ODatabase
declareIntent
in interface ODatabase<ORecord>
iIntent
- The intentpublic OIntent getActiveIntent()
ODatabase
getActiveIntent
in interface ODatabase<ORecord>
public boolean exists()
ODatabase
public void close()
ODatabase
public ODatabase.STATUS getStatus()
ODatabase
public <DB extends ODatabase> DB setStatus(ODatabase.STATUS iStatus)
ODatabase
public long getSize()
ODatabase
public String getName()
ODatabase
public String getURL()
ODatabase
public OLocalRecordCache getLocalCache()
ODatabase
getLocalCache
in interface ODatabase<ORecord>
public int getDefaultClusterId()
ODatabase
getDefaultClusterId
in interface ODatabase<ORecord>
public int getClusters()
ODatabase
getClusters
in interface ODatabase<ORecord>
public boolean existsCluster(String iClusterName)
ODatabase
existsCluster
in interface ODatabase<ORecord>
iClusterName
- Cluster namepublic Collection<String> getClusterNames()
ODatabase
getClusterNames
in interface ODatabase<ORecord>
public int getClusterIdByName(String iClusterName)
ODatabase
getClusterIdByName
in interface ODatabase<ORecord>
iClusterName
- Cluster namepublic String getClusterNameById(int iClusterId)
ODatabase
getClusterNameById
in interface ODatabase<ORecord>
iClusterId
- Cluster idpublic long getClusterRecordSizeByName(String iClusterName)
ODatabase
getClusterRecordSizeByName
in interface ODatabase<ORecord>
iClusterName
- Cluster namepublic long getClusterRecordSizeById(int iClusterId)
ODatabase
getClusterRecordSizeById
in interface ODatabase<ORecord>
iClusterId
- Cluster idpublic boolean isClosed()
ODatabase
public void truncateCluster(String clusterName)
ODatabase
truncateCluster
in interface ODatabase<ORecord>
clusterName
- Name of cluster to be truncated.public long countClusterElements(int iCurrentClusterId)
ODatabase
countClusterElements
in interface ODatabase<ORecord>
iCurrentClusterId
- Cluster idpublic long countClusterElements(int iCurrentClusterId, boolean countTombstones)
countClusterElements
in interface ODatabase<ORecord>
public long countClusterElements(int[] iClusterIds)
ODatabase
countClusterElements
in interface ODatabase<ORecord>
iClusterIds
- Array of cluster ids Cluster idpublic long countClusterElements(int[] iClusterIds, boolean countTombstones)
countClusterElements
in interface ODatabase<ORecord>
public long countClusterElements(String iClusterName)
ODatabase
countClusterElements
in interface ODatabase<ORecord>
iClusterName
- Cluster namepublic int addCluster(String iClusterName, Object... iParameters)
ODatabase
addCluster
in interface ODatabase<ORecord>
iClusterName
- Cluster nameiParameters
- Additional parameters to pass to the factoriespublic int addBlobCluster(String iClusterName, Object... iParameters)
ODatabaseDocument
addBlobCluster
in interface ODatabaseDocument
addBlobCluster
in interface ODatabase<ORecord>
iClusterName
- Cluster nameiParameters
- Additional parameters to pass to the factoriespublic Set<Integer> getBlobClusterIds()
ODatabase
getBlobClusterIds
in interface ODatabase<ORecord>
public int addCluster(String iClusterName, int iRequestedId)
ODatabase
addCluster
in interface ODatabase<ORecord>
iClusterName
- Cluster nameiRequestedId
- requested id of the clusterpublic boolean dropCluster(String iClusterName)
ODatabase
dropCluster
in interface ODatabase<ORecord>
iClusterName
- the name of the clusterpublic boolean dropCluster(int iClusterId)
ODatabase
dropCluster
in interface ODatabase<ORecord>
iClusterId
- id of cluster to deletepublic Object setProperty(String iName, Object iValue)
ODatabase
setProperty
in interface ODatabase<ORecord>
iName
- Property nameiValue
- new value to setpublic Object getProperty(String iName)
ODatabase
getProperty
in interface ODatabase<ORecord>
iName
- Property namepublic Iterator<Map.Entry<String,Object>> getProperties()
ODatabase
getProperties
in interface ODatabase<ORecord>
public Object get(ODatabase.ATTRIBUTES iAttribute)
ODatabase
public <DB extends ODatabase> DB set(ODatabase.ATTRIBUTES iAttribute, Object iValue)
ODatabase
public void registerListener(ODatabaseListener iListener)
ODatabase
registerListener
in interface ODatabase<ORecord>
iListener
- the listener to registerpublic void unregisterListener(ODatabaseListener iListener)
ODatabase
unregisterListener
in interface ODatabase<ORecord>
iListener
- the listener to unregisterpublic ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata
in interface ODatabase<ORecord>
public ODocument newInstance(String iClassName)
ODatabaseDocument
newInstance
in interface ODatabaseDocument
public OBlob newBlob(byte[] bytes)
ODatabaseDocument
newBlob
in interface ODatabaseDocument
bytes
- content of the OBlobpublic OBlob newBlob()
ODatabaseDocument
newBlob
in interface ODatabaseDocument
public OEdge newLightweightEdge(String iClassName, OVertex from, OVertex to)
newLightweightEdge
in interface ODatabaseDocumentInternal
public OEdge newRegularEdge(String iClassName, OVertex from, OVertex to)
newRegularEdge
in interface ODatabaseDocumentInternal
public long countClass(String iClassName)
ODatabaseDocument
countClass
in interface ODatabaseDocument
iClassName
- Class namepublic long countClass(String iClassName, boolean iPolymorphic)
ODatabaseDocument
countClass
in interface ODatabaseDocument
iClassName
- Class nameiPolymorphic
- True if consider also the sub classes, otherwise falsepublic long countView(String viewName)
countView
in interface ODatabaseDocument
public List<String> backup(OutputStream out, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOException
OBackupable
backup
in interface OBackupable
out
- OutputStream used to write the backup content. Use a FileOutputStream to make the
backup persistent on diskoptions
- Backup options as Mapcallable
- Callback to execute when the database is lockediListener
- Listener called for backup messagescompressionLevel
- ZIP Compression level between 1 (the minimum) and 9 (maximum). The
bigger is the compression, the smaller will be the final backup content, but will consume
more CPU and time to executebufferSize
- Buffer size in bytes, the bigger is the buffer, the more efficient will be
the compressionIOException
ODatabaseExport
public void restore(InputStream in, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener) throws IOException
OBackupable
restore
in interface OBackupable
in
- InputStream used to read the backup content. Use a FileInputStream to read a backup
on a diskoptions
- Backup options as Mapcallable
- Callback to execute when the database is lockediListener
- Listener called for backup messagesIOException
ODatabaseImport
public void setSerializer(ORecordSerializer serializer)
setSerializer
in interface ODatabaseDocumentInternal
public OResultSet query(String query, Object... args)
ODatabase
OResultSet rs = db.query("SELECT FROM V where name = ?", "John"); while(rs.hasNext()){ OResult item = rs.next(); ... }
rs.close();
public OResultSet query(String query, Map args) throws OCommandSQLParsingException, OCommandExecutionException
ODatabase
Map<String, Object> params = new HashMapMap<>(); params.put("name", "John"); OResultSet rs = db.query("SELECT
FROM V where name = :name", params); while(rs.hasNext()){ OResult item = rs.next(); ... } rs.close();
query
in interface ODatabase<ORecord>
query
- the query stringargs
- query parameters (named)OCommandSQLParsingException
OCommandExecutionException
public OResultSet command(String query, Object... args) throws OCommandSQLParsingException, OCommandExecutionException
ODatabase
OResultSet rs = db.command("INSERT INTO Person SET name = ?", "John"); ... rs.close();
command
in interface ODatabase<ORecord>
args
- query argumentsOCommandSQLParsingException
OCommandExecutionException
public OResultSet command(String query, Map args) throws OCommandSQLParsingException, OCommandExecutionException
ODatabase
Map<String, Object> params = new HashMapMap<>(); params.put("name", "John"); OResultSet rs = db.query("INSERT
INTO Person SET name = :name", params); ... rs.close();
command
in interface ODatabase<ORecord>
OCommandSQLParsingException
OCommandExecutionException
public <DB extends ODatabase> DB setCustom(String name, Object iValue)
setCustom
in interface ODatabaseDocumentInternal
public void callOnDropListeners()
callOnDropListeners
in interface ODatabaseDocumentInternal
public boolean isPrefetchRecords()
isPrefetchRecords
in interface ODatabaseDocumentInternal
public void setPrefetchRecords(boolean prefetchRecords)
setPrefetchRecords
in interface ODatabaseDocumentInternal
public void checkForClusterPermissions(String name)
checkForClusterPermissions
in interface ODatabaseDocumentInternal
public OResultSet execute(String language, String script, Object... args) throws OCommandExecutionException, OCommandScriptException
ODatabase
OResultSet rs = db.execute("sql", script, "Surname1", "Surname2", "Surname3"); ... rs.close();
String script = "INSERT INTO Person SET name = 'foo', surname = ?;"+ "INSERT INTO Person SET name = 'bar', surname =
?;"+ "INSERT INTO Person SET name = 'baz', surname = ?;";
execute
in interface ODatabase<ORecord>
OCommandExecutionException
OCommandScriptException
public OResultSet execute(String language, String script, Map<String,?> args) throws OCommandExecutionException, OCommandScriptException
ODatabase
String script = "INSERT INTO Person SET name = 'foo', surname = :surname1;"+ "INSERT INTO Person SET name = 'bar', surname =
:surname2;"+ "INSERT INTO Person SET name = 'baz', surname = :surname3;";
OResultSet rs = db.execute("sql", script, params); ... rs.close();
Map<String, Object> params = new HashMapMap<>(); params.put("surname1", "Jones"); params.put("surname2",
"May"); params.put("surname3", "Ali");
execute
in interface ODatabase<ORecord>
OCommandExecutionException
OCommandScriptException
public OLiveQueryMonitor live(String query, OLiveQueryResultListener listener, Object... args)
ODatabase
public OLiveQueryMonitor live(String query, OLiveQueryResultListener listener, Map<String,?> args)
ODatabase
public void recycle(ORecord record)
recycle
in interface ODatabaseDocumentInternal
public void internalCommit(OTransactionInternal transaction)
ODatabaseDocumentInternal
internalCommit
in interface ODatabaseDocumentInternal
public boolean isClusterVertex(int cluster)
isClusterVertex
in interface ODatabaseDocumentInternal
public boolean isClusterEdge(int cluster)
isClusterEdge
in interface ODatabaseDocumentInternal
public boolean isClusterView(int cluster)
isClusterView
in interface ODatabaseDocumentInternal
public OIdentifiable beforeCreateOperations(OIdentifiable id, String iClusterName)
beforeCreateOperations
in interface ODatabaseDocumentInternal
public OIdentifiable beforeUpdateOperations(OIdentifiable id, String iClusterName)
beforeUpdateOperations
in interface ODatabaseDocumentInternal
public void beforeDeleteOperations(OIdentifiable id, String iClusterName)
beforeDeleteOperations
in interface ODatabaseDocumentInternal
public void afterCreateOperations(OIdentifiable id)
afterCreateOperations
in interface ODatabaseDocumentInternal
public void afterDeleteOperations(OIdentifiable id)
afterDeleteOperations
in interface ODatabaseDocumentInternal
public void afterUpdateOperations(OIdentifiable id)
afterUpdateOperations
in interface ODatabaseDocumentInternal
public void afterReadOperations(OIdentifiable identifiable)
afterReadOperations
in interface ODatabaseDocumentInternal
public boolean beforeReadOperations(OIdentifiable identifiable)
beforeReadOperations
in interface ODatabaseDocumentInternal
public void internalClose(boolean recycle)
internalClose
in interface ODatabaseDocumentInternal
public ORecord saveAll(ORecord iRecord, String iClusterName, ODatabase.OPERATION_MODE iMode, boolean iForceCreate, ORecordCallback<? extends Number> iRecordCreatedCallback, ORecordCallback<Integer> iRecordUpdatedCallback)
saveAll
in interface ODatabaseDocumentInternal
public String getClusterName(ORecord record)
getClusterName
in interface ODatabaseDocumentInternal
public OView getViewFromCluster(int cluster)
getViewFromCluster
in interface ODatabaseDocumentInternal
public void internalLockRecord(OIdentifiable iRecord, OStorage.LOCKING_STRATEGY lockingStrategy)
internalLockRecord
in interface ODatabaseDocumentInternal
public void internalUnlockRecord(OIdentifiable iRecord)
internalUnlockRecord
in interface ODatabaseDocumentInternal
public <RET extends ORecord> RET lock(ORID recordId) throws OLockException
ODatabase
In case of lock inside the transaction the lock will be release by the commit operation, In case of lock outside a transaction unlock need to be call manually.
lock
in interface ODatabase<ORecord>
recordId
- the id of the record that need to be lockedOLockException
- In case of deadlock detectedpublic <RET extends ORecord> RET lock(ORID recordId, long timeout, TimeUnit timeoutUnit) throws OLockException
ODatabase
lock
in interface ODatabase<ORecord>
recordId
- the id of the record that need to be lockedtimeout
- for the record lockingtimeoutUnit
- relative for the timeoutOLockException
- In case of deadlock detectedpublic void unlock(ORID recordId) throws OLockException
ODatabase
unlock
in interface ODatabase<ORecord>
recordId
- the id of the record to unlockOLockException
- if the record is not locked.public <T> T sendSequenceAction(OSequenceAction action) throws ExecutionException, InterruptedException
sendSequenceAction
in interface ODatabaseDocumentInternal
ExecutionException
InterruptedException
public Map<UUID,OBonsaiCollectionPointer> getCollectionsChanges()
getCollectionsChanges
in interface ODatabaseDocumentInternal
public boolean isRemote()
isRemote
in interface ODatabaseDocumentInternal
public OStorageInfo getStorageInfo()
getStorageInfo
in interface ODatabaseInternal<ORecord>
Copyright © 2009–2020 OrientDB. All rights reserved.