new GraphDB(driver)
Parameters:
| Name | Type | Description |
|---|---|---|
driver |
olympe.dc.DBView |
- Deprecated:
-
- this class has been replaced by the database driver
olympe.dc.DBView.
- this class has been replaced by the database driver
Methods
-
getCurrentDefaultProperties(tag [, ownOnly])
-
Gets all current instance default properties values.
Parameters:
Name Type Argument Default Description tagstring Instance tag
ownOnlyboolean <optional>
false If true, returns only own properties (ie. not inherited)
- Deprecated:
-
- use
olympe.dc.DBView#getDefaultPropertiesinstead
- use
Returns:
A map of all the default properties values indexed by properties names
- Type
- Object
-
getCurrentDefaultProperty(tag, name [, ownOnly])
-
Get an instance default property current value.
Parameters:
Name Type Argument Default Description tagstring Instance tag
namestring Property name
ownOnlyboolean <optional>
false If true, returns only own property (ie. not inherited)
- Deprecated:
-
- use
olympe.dc.DBView#getDefaultPropertyinstead
- use
Returns:
- Type
- * | undefined
-
getCurrentExtend(tag)
-
Gets the current instance parent model, that is the parent at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#extensioninstead
- use
Returns:
Current parent model tag if any, undefined otherwise
- Type
- string | undefined
-
getCurrentIncomingRelated(tag)
-
Gets currently incoming relations, that is left-related relations types at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#getIncomingRelationsinstead
- use
Returns:
An array of incoming relation tags
- Type
- Array.<string>
-
getCurrentModel(tag)
-
Gets the current instance model, that is the model at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#modelinstead
- use
Returns:
Current model tag for the specified instance if any, undefined otherwise
- Type
- string | undefined
-
getCurrentOutgoingRelated(tag)
-
Gets currently outgoing relations, that is right-related relations types at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#getOutgoingRelationsinstead
- use
Returns:
An array of incoming relation tags
- Type
- Array.<string>
-
getCurrentProperties(tag [, ownOnly])
-
Gets all current instance properties values, that is values at the time of the method call
Parameters:
Name Type Argument Default Description tagstring Instance tag
ownOnlyboolean <optional>
false If true, returns only own properties (ie. not inherited and defaults)
- Deprecated:
-
- use
olympe.dc.DBView#getPropertiesinstead
- use
Returns:
A map of all properties values indexed by properties names
- Type
- Object
-
getCurrentProperty(tag, name)
-
Gets an instance property current value, that is the value at the moment of the method call
Parameters:
Name Type Description tagstring Instance tag
namestring Property name
- Deprecated:
-
- use
olympe.dc.DBView#getPropertyinstead
- use
Returns:
Current property value or undefined if not found
- Type
- * | undefined
-
getCurrentRelated(tag, type, direction)
-
Gets currently related instances, that is related instances at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
typestring Relation type tag
directionolympe.dc.RelationDirection Relation direction
- Deprecated:
-
- use
olympe.dc.DBView#getRelatedinstead
- use
Returns:
A map of related instances tags to related instances tag
- Type
- Object.<string>
-
getCurrentRelatedCount(tag, type, direction)
-
Gets the amount of related instances at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
typestring Relation type tag
directionolympe.dc.RelationDirection Relation direction
Returns:
- Type
- number
-
getCurrentSource(tag)
-
Gets the current instance source, that is the source master of the instance at the time of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#sourceinstead
- use
Returns:
Current source id for the specified instance
- Type
- string | undefined
-
getCurrentVersion(tag)
-
Gets the current instance version, that is the version at the moment of the method call
Parameters:
Name Type Description tagstring Instance tag
- Deprecated:
-
- use
olympe.dc.DBView#versioninstead
- use
Returns:
Current instance version
- Type
- number | undefined
-
getUniqueCurrentRelated(tag, type, direction)
-
Gets the unique instance that is related at the time of the method call. This function differs from getCurrentRelated in the following way:
- it returns a tag directly, and not a map of tags
- it returns undefined if no related instance is found
- it throws an error if more than one relation is found
Parameters:
Name Type Description tagstring Instance tag
typestring Relation type tag
directionolympe.dc.RelationDirection Relation direction
- Deprecated:
-
- use
olympe.dc.DBView#getUniqueRelatedinstead
- use
Returns:
The related instance tag
- Type
- string | undefined
-
instanceCurrentlyExists(tag)
-
Checks whether an existing instance exists in the DB under the given tag at the time the call is made
Parameters:
Name Type Description tagstring - Deprecated:
-
- use
olympe.dc.DBView#existinstead
- use
Returns:
- Type
- boolean
-
offAnyProperty(tag, id)
-
Unregisters an anyProperty callback from the specified instance
Parameters:
Name Type Description tagstring idstring - Deprecated:
-
- use
olympe.dc.DBView#offAnyPropertyinstead
- use
-
offAnyRelation(tag, id [, noEvent])
-
Unregisters a callback on all relations of an instance. For each existing relation at the time of hte method call and unless otherwise specified, a REMOVED event will be immediately fired upon unregistration.
Parameters:
Name Type Argument Default Description tagstring Instance tag
idstring Callback identifier
noEventboolean <optional>
false If true, no REMOVED event will be fired upon unregistration
- Deprecated:
-
- use
olympe.dc.DBView#onAnyRelationinstead
- use
-
offInstance(tag, id [, noEvent])
-
Unregisters a callback on an instance. Unless otherwise specified, calling this method will immediately trigger a REMOVED event.
Parameters:
Name Type Argument Default Description tagstring Instance tag
idstring Callback identifier
noEventboolean <optional>
false If true, no REMOVED event will be fired upon unregistration
- Deprecated:
-
- use
olympe.dc.DBView#offInstanceinstead
- use
-
offProperty(tag, name, id)
-
Unregisters a property update callback from an instance.
Parameters:
Name Type Description tagstring Instance tag.
namestring Property name.
idstring Callback identifier.
- Deprecated:
-
- use
olympe.dc.DBView#offPropertyinstead
- use
-
offRelation(tag, type, direction, id [, noEvent])
-
Unregisters a callback on an instance relation. For each existing relation at the time of the method call and unless otherwise specified, a REMOVED event will be immediately fired upon unregistration.
Parameters:
Name Type Argument Default Description tagstring Instance tag
typestring Relation type tag
directionolympe.dc.RelationDirection Relation direction
idstring Callback identifier
noEventboolean <optional>
false If true, no REMOVED event will be fired upon unregistration
- Deprecated:
-
- use
olympe.dc.DBView#offRelationinstead
- use
-
onAnyProperty(tag, callback [, id])
-
Registers a callback to be invoked any time a property of the specified instance gets a value.
Parameters:
Name Type Argument Description tagstring callbackolympe.dc.DBView.AnyPropertyCallback idstring <optional>
- Deprecated:
-
- use
olympe.dc.DBView#onAnyPropertyinstead
- use
Returns:
- Type
- string
-
onAnyRelation(tag, callback [, id])
-
Register a callback on an instance which is called every time the instance get a new relation. For each existing relation at the time of the method call, an ADDED event will be immediately fired. If two callbacks are registered with the same identifier, the last registered one will simply overwrite the first one.
Parameters:
Name Type Argument Description tagstring Instance tag
callbackolympe.dc.DBView.RelationCallback Function to run when any relation is created or removed on the specified instance
idstring <optional>
Callback identifier
- Deprecated:
-
- use
olympe.dc.DBView#onAnyRelationinstead
- use
Returns:
Registered callback identifier
- Type
- string
-
onInstance(tag, callback [, id])
-
Register a callback on an instance. If the instance already exists at the time of the method call, an ADDED event will be immediately fired
Parameters:
Name Type Argument Description tagstring Instance tag
callbackolympe.dc.DBView.InstanceCallback Callback function
idstring <optional>
Callback identifier
- Deprecated:
-
- use
olympe.dc.DBView#onInstanceinstead
- use
Returns:
Registered callback identifier
- Type
- string
-
onProperty(tag, name, callback [, id])
-
Registers a callback to be invoked when the specified property of the specified instance is updated.
Parameters:
Name Type Argument Description tagstring Instance tag.
namestring Property name.
callbackolympe.dc.DBView.PropertyCallback Callback function.
idstring <optional>
Callback identifier.
- Deprecated:
-
- use
olympe.dc.DBView#onPropertyinstead
- use
Returns:
Registered callback identifier.
- Type
- string
-
onRelation(tag, type, direction, callback [, id])
-
Register a callback on an instance relation. For each existing relation at the time of the method call, an ADDED event will be immediately fired. Also, if two callbacks are registered with the same identifier, the last registered one will simply overwrite the first one.
Parameters:
Name Type Argument Description tagstring Instance tag
typestring Relation type tag
directionolympe.dc.RelationDirection Relation direction
callbackolympe.dc.DBView.InstanceCallback Callback function
idstring <optional>
Callback identifier
- Deprecated:
-
- use
olympe.dc.DBView#onRelationinstead
- use
Returns:
Registered callback identifier
- Type
- string
Olympe SDK