#include <objectStatementsFeature.h>
Public Member Functions | |
virtual const std::string & | getNameInst () |
Returns name of the database feature. | |
virtual std::string | getSelectFromClassViewStatement (ObjectMappingStrategy ¤tStrategy, const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0 |
Returns a statement that selects from a Simple view associated with the type the currentStrategy represents. | |
virtual std::string | getSelectFromClassTableStatement (ObjectMappingStrategy ¤tStrategy, const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0 |
Returns a statement that selects from a database table or ADT type associated with the type the currentStrategy represents. | |
virtual std::string | getInsertStatement (ObjectMappingStrategy ¤tStrategy, const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0 |
Returns a statement that inserts data to a database table using ADT associated with the type the currentStrategy represents. | |
virtual std::string | getUpdateStatement (ObjectMappingStrategy ¤tStrategy, const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0 |
Returns a statement that updates data in a database table associated with the type the currentStrategy represents. | |
virtual std::string | getDeleteStatement (ObjectMappingStrategy ¤tStrategy, const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0 |
Returns a statement that deletes data from a database table associated with the type the currentStrategy represents. | |
virtual bool | validate (ObjectMappingStrategy ¤tStrategy, std::string &msg)=0 |
Performs a driver-side validation of the persistent object model and metadata. |
DbType::getKeyAttributes() for object-mapped classes contain always only a single OID attribute.
virtual const std::string& iopc::ObjectStatementsFeature::getNameInst | ( | ) | [inline, virtual] |
Returns name of the database feature.
Database features must have unique names across the library
Implements iopc::DbFeature.
virtual std::string iopc::ObjectStatementsFeature::getSelectFromClassViewStatement | ( | ObjectMappingStrategy & | currentStrategy, | |
const MetadataHolder & | attributes = MetadataHolder::emptyMeta , |
|||
bool | useCache = true | |||
) | [pure virtual] |
Returns a statement that selects from a Simple view associated with the type the currentStrategy represents.
Selected columns are specified by DbType::getAllPersistentAttributes() (currentStrategy.getDbType().getAllPersistentAttributes()) The order of the columns selected must correspond to the order of attributes in the list. WHERE part of the select statement must generated from the DbType::getKeyAttributes() list or just by filtering by OID.
virtual std::string iopc::ObjectStatementsFeature::getSelectFromClassTableStatement | ( | ObjectMappingStrategy & | currentStrategy, | |
const MetadataHolder & | attributes = MetadataHolder::emptyMeta , |
|||
bool | useCache = true | |||
) | [pure virtual] |
Returns a statement that selects from a database table or ADT type associated with the type the currentStrategy represents.
Selected columns are specified by ObjectMappingStrategy::getMappedAttributes() (currentStrategy.getMappedAttributes()) The order of the columns selected must correspond to the order of attributes in the list. WHERE part of the select statement must generated from the DbType::getKeyAttributes() list or just by filtering by OID.
virtual std::string iopc::ObjectStatementsFeature::getInsertStatement | ( | ObjectMappingStrategy & | currentStrategy, | |
const MetadataHolder & | attributes = MetadataHolder::emptyMeta , |
|||
bool | useCache = true | |||
) | [pure virtual] |
Returns a statement that inserts data to a database table using ADT associated with the type the currentStrategy represents.
The insert must define input parameters that will correspond with attributes stored in the ObjectMappingStrategy::getMappedAttributes() list.
virtual std::string iopc::ObjectStatementsFeature::getUpdateStatement | ( | ObjectMappingStrategy & | currentStrategy, | |
const MetadataHolder & | attributes = MetadataHolder::emptyMeta , |
|||
bool | useCache = true | |||
) | [pure virtual] |
Returns a statement that updates data in a database table associated with the type the currentStrategy represents.
The update must define input parameters that will correspond with attributes stored in the ObjectMappingStrategy::getMappedAttributes() list. Followed by parameters that define which rows to update defined by DbType::getKeyAttributes() list or just by an OID column.
virtual std::string iopc::ObjectStatementsFeature::getDeleteStatement | ( | ObjectMappingStrategy & | currentStrategy, | |
const MetadataHolder & | attributes = MetadataHolder::emptyMeta , |
|||
bool | useCache = true | |||
) | [pure virtual] |
Returns a statement that deletes data from a database table associated with the type the currentStrategy represents.
The statement must define input parameters that restrict the delete operation. (OID or DbType::getKeyAttributes())
virtual bool iopc::ObjectStatementsFeature::validate | ( | ObjectMappingStrategy & | currentStrategy, | |
std::string & | msg | |||
) | [pure virtual] |
Performs a driver-side validation of the persistent object model and metadata.
[in] | currentStrategy | A mapping strategy object representing a type being mapped. |
[out] | msg | Error messages generated by the database driver. |