iopc::PersIdentification Class Reference
[iopclib]

Encapsulates persistent object identity and provides access to O/R mapping services. More...

#include <persIdentification.h>

List of all members.

Public Types

enum  IDType
 Type of the encapsulated identity.

Public Member Functions

DatabaseObjectload (Connection &conn, bool wait, bool lock) const
 Loads object from a database.
DatabaseObjectload (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 KeyValuesgetKeyValues () const
 Returns KeyValues for the current object.
const OidType getOid () const
 Returns KeyValues for the current object.
const TypegetType () const
 Returns a type for which the current PersIdentification was created.
const DbTypegetDbType () 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.


Detailed Description

Encapsulates persistent object identity and provides access to O/R mapping services.

O/R mapping services are provided using DbType.


Member Function Documentation

DatabaseObject * iopc::PersIdentification::load ( Connection conn,
bool  wait,
bool  lock 
) const

Loads object from a database.

Parameters:
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.
Returns:
Loaded object.

DatabaseObject * iopc::PersIdentification::load ( Cursor cur  )  const

Loads object data from a cursor.

Parameters:
cur Cursof from which to load the data
Returns:
Laoded object

void iopc::PersIdentification::remove ( Connection conn  )  const

Deletes object from a database.

Parameters:
conn Connection used for the DB operation.

void iopc::PersIdentification::update ( Connection conn,
DatabaseObject obj 
) const

Updates persistent copy.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:
TypeDesc<OidObject> if the identity has not been initialized with any type yet

const DbType& iopc::PersIdentification::getDbType (  )  const [inline]

Returns a DbType instance associated with type for which the current PersIdentification was created.

Returns:
OidObject DbType if the identity has not been initialized with any type yet


The documentation for this class was generated from the following files:

Generated on Tue Apr 14 16:46:51 2009 for IOPC 2 by  doxygen 1.5.6