#include <mappingStrategy.h>
Public Member Functions | |
virtual void | init ()=0 |
Validates the associated persistent object. | |
virtual void | postInit ()=0 |
Second phase of the initialization routine. | |
virtual void | loadOne (Connection &conn, DatabaseObject *obj, const KeyValues &keyVals, bool wait, bool lock)=0 |
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)=0 |
Loads all attributes from the associated types' simple view. | |
virtual void | updateOne (Connection &conn, DatabaseObject &obj)=0 |
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)=0 |
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)=0 |
Deletes an OidObject identified by @ KeyValues from the associated table or deletes the associated ADT type instance. | |
virtual void | insertOne (Connection &conn, DatabaseObject &obj)=0 |
Inserts values of attributes declared in the associated type to associated table or creates a new associated ADT type instance. | |
virtual DbType & | getDbType () const =0 |
Returns the associated DbType instance. | |
virtual const Type & | getType () const =0 |
Returns the associated Type instance. |
These methods implement the attribute-level part of the O/R mapping algorithm. Each DbType contains an instance of one of these strategies depending on what mapping type it uses. The strategy instances are aware of the Type and DbType they are associated to.
virtual void iopc::MappingStrategy::init | ( | ) | [pure 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.
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::postInit | ( | ) | [pure virtual] |
Second phase of the initialization routine.
Executed after all strategies and DbType-s have finished the first phase (DbPtr::init(), MappingStrategy::init())
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::loadOne | ( | Connection & | conn, | |
DatabaseObject * | obj, | |||
const KeyValues & | keyVals, | |||
bool | wait, | |||
bool | lock | |||
) | [pure 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. |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual OidObject* iopc::MappingStrategy::viewLoadAll | ( | Connection & | conn, | |
const OidType & | oid, | |||
bool | wait, | |||
bool | lock | |||
) | [pure 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. |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::updateOne | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | [pure 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 |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::deleteOne | ( | Connection & | conn, | |
const OidType & | oid | |||
) | [pure 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 |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::deleteOne | ( | Connection & | conn, | |
const KeyValues & | keyVals | |||
) | [pure 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 |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.
virtual void iopc::MappingStrategy::insertOne | ( | Connection & | conn, | |
DatabaseObject & | obj | |||
) | [pure 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. |
Implemented in iopc::ObjectMappingStrategy, and iopc::ORMappingStrategy.