#include <persIdentification.h>
Public Types | |
enum | IDType |
Type of the encapsulated identity. | |
Public Member Functions | |
DatabaseObject * | load (Connection &conn, bool wait, bool lock) const |
Loads object from a database. | |
DatabaseObject * | load (Cursor &cur) const |
Loads object data from a cursor. | |
void | remove (Connection &conn) const |
Deletes object from a database. | |
void | update (Connection &conn, DatabaseObject &obj) const |
Updates persistent copy. | |
void | insert (Connection &conn, DatabaseObject &obj) const |
Inserts object into a DB. | |
void | initIdentity (Connection &conn, DatabaseObject &obj) |
Creates an identity for a transient object. | |
bool | versionMatches (Connection &conn, OidObject &obj) const |
Compares serialId timestamp of an object with a timestamp stored in the oid-classname catalogue in database. | |
const KeyValues & | getKeyValues () const |
Returns KeyValues for the current object. | |
const OidType | getOid () const |
Returns KeyValues for the current object. | |
const Type & | getType () const |
Returns a type for which the current PersIdentification was created. | |
const DbType & | getDbType () const |
Returns a DbType instance associated with type for which the current PersIdentification was created. | |
bool | isValid () const |
Determines whether the current instance represents any object identity or not. | |
IDType | getIDType () const |
Returns the type of the encapsulated identity. |
O/R mapping services are provided using DbType.
DatabaseObject * iopc::PersIdentification::load | ( | Connection & | conn, | |
bool | wait, | |||
bool | lock | |||
) | const |
Loads object from a database.
conn | Connection to be used for DB operation. | |
wait | Specifies whether the operation should wait for database locks to be unlocked. | |
lock | Specifies whether the persistent copy should be locked in DB exlusively when loaded. |
DatabaseObject * iopc::PersIdentification::load | ( | Cursor & | cur | ) | const |
Loads object data from a cursor.
cur | Cursof from which to load the data |
void iopc::PersIdentification::remove | ( | Connection & | conn | ) | const |
void iopc::PersIdentification::update | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | const |
Updates persistent copy.
conn | Connection used for the DB operation. | |
obj | Local copy that is used to update the persistent copy in the database. |
void iopc::PersIdentification::insert | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | const |
Inserts object into a DB.
conn | Connection used for the DB operation. | |
obj | Persistent objects that is inserted into the database |
void iopc::PersIdentification::initIdentity | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) |
Creates an identity for a transient object.
For OID object it selects a new OID from the OID sequence. For a non-OID persistent object it extracts KeyValues from the obj instance attributes.
conn | Connection used for a new OID retrieval | |
obj | The transient object for which an identity is created |
bool iopc::PersIdentification::versionMatches | ( | Connection & | conn, | |
OidObject & | obj | |||
) | const |
Compares serialId timestamp of an object with a timestamp stored in the oid-classname catalogue in database.
conn | Connection used to retrieve the obj database timestamp | |
obj | Obj with the serialId timestamp to compare |
const KeyValues& iopc::PersIdentification::getKeyValues | ( | ) | const [inline] |
Returns KeyValues for the current object.
May be empty if PersIdentification represents an OID object identity or is not yet initialized
const OidType iopc::PersIdentification::getOid | ( | ) | const [inline] |
Returns KeyValues for the current object.
Undefined if PersIdentification represents a non-OID object identity or is not yet initialized
const Type& iopc::PersIdentification::getType | ( | ) | const [inline] |
Returns a type for which the current PersIdentification was created.
const DbType& iopc::PersIdentification::getDbType | ( | ) | const [inline] |
Returns a DbType instance associated with type for which the current PersIdentification was created.