#include <d_Object.h>
Inheritance diagram for d_Object:

Public Types | |
| enum | statuses { stStatic, stLoad, stNew, stCreated, stReserved, stUpdated, stDeleted, stCheckpointed } |
| enum | txmode { TRANSACTIONAL, NO_TRANSACTIONAL } |
Public Methods | |
| d_Object () | |
| virtual | ~d_Object () |
| void * | operator new (size_t iSize) |
| void * | operator new (size_t iSize, d_Database *iDb, const char *iClassName, int iTxMode=TRANSACTIONAL) |
| void * | operator new (size_t iSize, oStorage *iStorage, const char *iClassName, int iTxMode=TRANSACTIONAL) |
| void * | operator new (size_t iSize, oObjectId &iOid, int iTxMode) |
| void | operator delete (void *iAddress) |
| void | delete_object () |
| void | mark_modified () |
| virtual void | d_activate () |
| virtual void | d_deactivate () |
| void | store () |
| void | setStreamProtocol (const char *iProtName) |
| virtual void | toStream (oObjectStream &ioBuffer) |
| virtual void | fromStream (oObjectStream &iBuffer) |
| oStorage * | getStorage () const |
| oClass * | getClass () const |
| bool | is_reserved () |
| bool | isInCache () |
| oObjectId & | get_oid () |
| void | setOid (oObjectId &iOid) |
| void | pin () |
| void | unpin () |
| virtual bool | d_beforeNew () |
| virtual bool | d_onUpdate () |
| virtual bool | d_beforeUpdate () |
| void | makeTransactional () |
| void | makeNoTransactional () |
| oContext * | getContext () const |
Static Public Methods | |
| void | free (d_Object *iObject, bool removeAlsoInContext=true) |
| d_Object * | newObject (const size_t iSize) |
| bool | assignContext (d_Object *iObject, int iTxMode, bool iMandatory) |
Public Attributes | |
| int | status |
| oObjectStream * | origin |
| oClass * | metaClass |
Friends | |
| class _ODLL | d_Transaction |
Every user objects that want to be persistent had to inherit this class.
It's an abstract class therefore cannot be instantiated.
You had to use the d_Ref template class for referencing persistent objects rather than C++ pointers [see d_Ref].
LOCATION: d_Object.h
USAGE: class <user-class-name> : public d_Object { ... }
Where:
<user-class-name>: is the name of user class
EXAMPLES: class Invoice : public d_Object * Persistent class { d_ULong number; d_Ref<Customer> customer; d_Set< d_Ref<Product> > products; };
ODMG: Compliant
|
|
|
|
|
|
|
|
Default constructor. ODMG : Compliant |
|
|
Destructor. ODMG : Compliant |
|
||||||||||||||||
|
|
|
|
Object activation trigger. It's the trigger called asynchronously by Orient ODBMS when the object is requested by a context. It can be defined as a special "cache constructor". It's useful for reset transient members before the use. If the user class, inherited by d_Object, doesn't define a own d_activate virtual method, by default is called the d_Object::d_activate() that doesn't execute any operation. SEE ALSO: d_deactivate() ODMG : Compliant Reimplemented in oSysClass, and oSysDatabase. |
|
|
Trigger called before to store a new persistent object. It's the trigger called asynchronously by Orient ODBMS on context commit before that new object is stored in database. Inherited class must return a boolean value: true for success, false for error. If error is returned, a d_Error_TriggerBeforeNew exception is thrown. It's useful when it needs to validate objects attributes. If the user class, inherited by d_Object, doesn't define a own d_beforerNew virtual method, by default is called the d_Object::d_beforeNew() that doesn't execute any operation. ODMG : Extension |
|
|
Trigger called before to store an updated persistent object. It's the trigger called asynchronously by Orient ODBMS on context commit before that updated object is stored in database. Inherited class must return a boolean value: true for success, false for error. If error is returned, a d_Error_TriggerBeforeUpdate exception is thrown. If the user class, inherited by d_Object, doesn't define a own d_beforeUpdate virtual method, by default is called the d_Object::d_beforeUpdate() that doesn't execute any operation. SEE ALSO: d_onUpdate() ODMG : Extension |
|
|
Object deactivation trigger. It's the trigger called asynchronously by Orient ODBMS when the object is freed in memory. It can be defined as a special "cache destructor". It's useful when an object had to free some memory (transient members) before to die. If the user class, inherited by d_Object, doesn't define a own d_deactivate virtual method, by default is called the d_Object::d_deactivate() that doesn't execute any operation. SEE ALSO: d_activate() ODMG : Compliant Reimplemented in d_Collection< T >, oSysClass, oSysDatabase, oSysLog, oSysProperty, oSysSegment, oSysTxLog, oSysTxObject, d_Collection< d_Association< K, V > >, d_Collection< d_Association< d_String, d_String > >, d_Collection< d_Association< d_String, d_Ref< oSysProperty > > >, and d_Collection< d_Association< d_String, d_Ref< oSysClass > > >. |
|
|
Trigger called after when a persistent object is update. It's the trigger called asynchronously by Orient ODBMS immediately after the mark_modified() method is called on the object. Inherited class must return a boolean value: true for success, false for error. If error is returned, a d_Error_TriggerOnUpdate exception is thrown. If the user class, inherited by d_Object, doesn't define a own d_onUpdate virtual method, by default is called the d_Object::d_onUpdate () that doesn't execute any operation. SEE ALSO: d_beforeUpdate() ODMG : Extension |
|
|
Remove the object permanently in database and memory. This method is needed by collections deletion ODMG : Extension |
|
||||||||||||
|
|
|
|
|
|
|
Get the oid associated with the object. ODMG : Extension |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make the object no transactional. SEE ALSO: makeTransactional() ODMG : Extension |
|
|
Make the object transactional. SEE ALSO: makeNoTransactional() ODMG : Extension |
|
|
Mark the object as modified. When context commits the object will be updated on storage. Enterprise Edition: This operation requires an exclusive lock to the server. ODMG : Compliant |
|
|
|
|
|
Remove the object permanently in database and memory. ODMG : Compliant |
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
Create a persistent object. Allocates a persistent object of class into database. The database must be opened as read_write [see d_Database], a transaction must be opened and the class must be defined as persistent class. ODMG : Compliant+ (with optional Extension) |
|
|
Create a transient object. It allocates memory for transient (not persistent) object. This is the redefinition of C++ new operator. ODMG : Compliant |
|
|
Pin the object. Use this method to mark the most used objects. The Orient Object Manager doesn't remove this object when the context is committed. Using this feature avoid loads of the same object from different contexts. SEE ALSO: unpin() ODMG : Extension |
|
|
|
|
|
|
|
|
STORE A NON-TRANSACTIONAL OBJECT |
|
|
|
|
|
Unpin the object. Unpin the object marked with d_Object::pin() method. Objects are unpinned by default. SEE ALSO: pin() ODMG : Extension |
|
|
|
|
|
|
|
|
|
|
|
|
1.3-rc1