#include <objectMappingStrategy.h>
Public Member Functions | |
virtual void | init () |
Validates the associated persistent object. | |
virtual void | postInit () |
Second phase of the initialization routine. | |
virtual void | loadOne (Connection &conn, DatabaseObject *obj, const KeyValues &keyVals, bool wait, bool lock) |
Loads attributes declared in the associated type from its associated mapping table or type. | |
virtual OidObject * | viewLoadAll (Connection &conn, const OidType &oid, bool wait, bool lock) |
Loads all attributes from the associated types' simple view. | |
virtual void | updateOne (Connection &conn, DatabaseObject &obj) |
Updates columns from attributes declared in the associated type in its associated mapping table or ADT type instance. | |
virtual void | deleteOne (Connection &conn, const OidType &oid) |
Deletes an OidObject identified by OID from the associated table ord deletes the associated ADT type instance. | |
virtual void | deleteOne (Connection &conn, const KeyValues &keyVals) |
Deletes an OidObject identified by @ KeyValues from the associated table or deletes the associated ADT type instance. | |
virtual void | insertOne (Connection &conn, DatabaseObject &obj) |
Inserts values of attributes declared in the associated type to associated table or creates a new associated ADT type instance. | |
virtual DbType & | getDbType () const |
Returns the associated DbType instance. | |
virtual const Type & | getType () const |
Returns the associated Type instance. | |
bool | isRoot () const |
Determines whether the associated type is root of the ADT type hierarchy. | |
const RootTypesList & | getRootTypes () const |
Returns a list of types that represent roots of the ADT hierarchy the associated type is part of. | |
const ObjectMappingStrategy & | getFirstRoot () const |
Returns first root from the getRootTypes() list. | |
const PersistentAttributesList & | getMappedAttributes () const |
Returns a list of all persistent attributes from the associated type and its ADT-mapped ancestors. | |
const PersistentAttributesList & | getPersistentAttributes () const |
const Attribute & | getOidColumn () const |
Returns reference to the OID attribute. | |
ObjectMappingStrategy & | getFirstParentOMStrategy () const |
Returns ObjectMappingStrategy of the first parrent of the associated type. |
void ObjectMappingStrategy::init | ( | ) | [virtual] |
Validates the associated persistent object.
Checks all mapping-related metadata and pre-generates lists of mapped attributes or other data it needs during the mapping algorithm execution.
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::postInit | ( | ) | [virtual] |
Second phase of the initialization routine.
Executed after all strategies and DbType-s have finished the first phase (DbPtr::init(), MappingStrategy::init())
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::loadOne | ( | Connection & | conn, | |
DatabaseObject * | obj, | |||
const KeyValues & | keyVals, | |||
bool | wait, | |||
bool | lock | |||
) | [virtual] |
Loads attributes declared in the associated type from its associated mapping table or type.
conn | Connection from which to load the attributes | |
obj | Object whose attributes will be loaded from conn | |
keyVals | Identifies the object whose attributes to load | |
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. |
Implements iopc::MappingStrategy.
OidObject * ObjectMappingStrategy::viewLoadAll | ( | Connection & | conn, | |
const OidType & | oid, | |||
bool | wait, | |||
bool | lock | |||
) | [virtual] |
Loads all attributes from the associated types' simple view.
conn | Connection from which to load the attributes | |
oid | OID of the object to be laoded | |
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. |
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::updateOne | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | [virtual] |
Updates columns from attributes declared in the associated type in its associated mapping table or ADT type instance.
conn | Connection used to update the values | |
obj | Obj containing attributes that update the database values |
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::deleteOne | ( | Connection & | conn, | |
const OidType & | oid | |||
) | [virtual] |
Deletes an OidObject identified by OID from the associated table ord deletes the associated ADT type instance.
conn | Connection used to delete the object | |
oid | OID of the object to delete |
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::deleteOne | ( | Connection & | conn, | |
const KeyValues & | keyVals | |||
) | [virtual] |
Deletes an OidObject identified by @ KeyValues from the associated table or deletes the associated ADT type instance.
conn | Connection used to delete the object | |
keyVals | KeyValues of the object to delete |
Implements iopc::MappingStrategy.
void ObjectMappingStrategy::insertOne | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | [virtual] |
Inserts values of attributes declared in the associated type to associated table or creates a new associated ADT type instance.
conn | Connection used to perform the operation | |
obj | Object containing the values to insert. |
Implements iopc::MappingStrategy.
const PersistentAttributesList& iopc::ObjectMappingStrategy::getPersistentAttributes | ( | ) | const [inline] |
@ brief Same as DbType::getPersistentAttributes(), but it doesn't contain the oid column, even for the OidObject
ObjectMappingStrategy& iopc::ObjectMappingStrategy::getFirstParentOMStrategy | ( | ) | const [inline] |
Returns ObjectMappingStrategy of the first parrent of the associated type.
If the parent does not use ADT (object) mapping, the behavioru of this method is undefined