iopc::MappingStatementsFeature Class Reference
[iopclib]

This feature declares methods shared by both O/R (vertical, horizontal, filtered) and ADT mapping types. More...

#include <mappingStatementsFeature.h>

Inheritance diagram for iopc::MappingStatementsFeature:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const std::string & getNameInst ()
 Returns name of the database feature.
virtual std::string getSelectTypeStatement (const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0
 Returns a statement that selects a qualified Type name from the OID - Classname catalogue by an OID value.
virtual std::string getSelectSerialIdStatement (const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0
 Returns a statement that selects a timestamp (serialId) from the OID - Classname catalogue by an OID value.
virtual std::string getNextOidStatement (const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0
 Returns a statement that allocates and retrieves a new OID value.
virtual std::string getNextSerialIdStatement (const MetadataHolder &attributes=MetadataHolder::emptyMeta, bool useCache=true)=0
 Returns a statement that allocates and retrieves a new timestamp (SerialId) value.
virtual std::vector< std::string > dbCreateScriptStart (const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that are generated to the beginning of a DB CREATE script.
virtual std::vector< std::string > dbCreateScriptEnd (const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that are generated to the end of a DB CREATE script.
virtual std::vector< std::string > dbDropScriptStart (const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that are generated to the beginning of a DB DROP script.
virtual std::vector< std::string > dbDropScriptEnd (const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that are generated to the end of a DB DROP script.
virtual std::vector< std::string > getCreateClassTableScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that create required structures to store instances of specified type to a database.
virtual std::vector< std::string > getCreateUpDownViewsScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that create a simple view for the specified type.
virtual std::vector< std::string > getCreateDownUpViewsScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that create a plymorphic view for the specified type.
virtual std::vector< std::string > getDropClassTableScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that drop the structure created by getCreateClassTableScript.
virtual std::vector< std::string > getDropUpDownViewsScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that drop the structures created by getCreateUpDownViewsScript.
virtual std::vector< std::string > getDropDownUpViewsScript (const DbType &dbType, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0
 Returns a list of statements that drop the structures created by getCreateDownUpViewsScript.
virtual std::string getQueryStatement (const DbType &dbType, const MetadataHolder &attributes)=0
 Returns a statement that is used to execute a query.


Detailed Description

This feature declares methods shared by both O/R (vertical, horizontal, filtered) and ADT mapping types.

Member Function Documentation

virtual const std::string& iopc::MappingStatementsFeature::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::MappingStatementsFeature::getSelectTypeStatement ( const MetadataHolder attributes = MetadataHolder::emptyMeta,
bool  useCache = true 
) [pure virtual]

Returns a statement that selects a qualified Type name from the OID - Classname catalogue by an OID value.

OidObject metadata [db.table] and [db.column] should be used

virtual std::string iopc::MappingStatementsFeature::getSelectSerialIdStatement ( const MetadataHolder attributes = MetadataHolder::emptyMeta,
bool  useCache = true 
) [pure virtual]

Returns a statement that selects a timestamp (serialId) from the OID - Classname catalogue by an OID value.

OidObject metadata [db.table] and [db.column] should be used

virtual std::vector<std::string> iopc::MappingStatementsFeature::getCreateClassTableScript ( const DbType dbType,
const MetadataHolder attributes = MetadataHolder::emptyMeta 
) [pure virtual]

Returns a list of statements that create required structures to store instances of specified type to a database.

Following metadata should be taken into account: Type-level metadata:

  • [db.table] - Table name
  • [db.type] - If ADT (object) mapping is used, denotes name of the ADT type to create.
Attribute-level metadata
  • [db.column] - Column name
  • [db.type.notNull] - Column is rendered as NOT NULL
  • [db.primaryKey] - Column is part of the primary key
  • [db.index] - Name of a index to create
  • [db.index.unique] - Name of a unique index to create

virtual std::vector<std::string> iopc::MappingStatementsFeature::getCreateUpDownViewsScript ( const DbType dbType,
const MetadataHolder attributes = MetadataHolder::emptyMeta 
) [pure virtual]

Returns a list of statements that create a simple view for the specified type.

Simple view is a view that selects persistent objects only of the type they are associated to.

Following metadata should be taken into account: Type-level metadata:

  • [db.table] - Table name
  • [db.type] - If ADT (object) mapping is used, denotes name of the ADT type to use.
  • [db.view.sv] - Name of the Simple view
Attribute-level metadata
  • [db.column] - Column name
  • [db.viewColumn] - View column name

virtual std::vector<std::string> iopc::MappingStatementsFeature::getCreateDownUpViewsScript ( const DbType dbType,
const MetadataHolder attributes = MetadataHolder::emptyMeta 
) [pure virtual]

Returns a list of statements that create a plymorphic view for the specified type.

Polymorphic view is a view that selects persistent objects of the type they are associated to and of its descendants.

Following metadata should be taken into account: Type-level metadata:

  • [db.table] - Table name
  • [db.type] - If ADT (object) mapping is used, denotes name of the ADT type to use.
  • [db.view.pv] - Name of the Polymorphic view
Attribute-level metadata
  • [db.column] - Column name
  • [db.viewColumn] - View column name

virtual std::string iopc::MappingStatementsFeature::getQueryStatement ( const DbType dbType,
const MetadataHolder attributes 
) [pure virtual]

Returns a statement that is used to execute a query.

Following metadata should be taken into account: Query metadata (from the attributes parameter):

  • [db.query.from] - From part of the generated select statement
  • [db.query.useViewCols];bool - Determines whether the query select use [db.viewColumn] insetad of [db.column]
  • [db.transient];bool - If the type is transient the query must select all columns from DbType::getAllPersistentAttributes() The order of the columns selected must correspond to the order of attributes in the AllPersistentAttributes list. If not transient, the selected columns must be obtained from DbType::getKeyAttributes(). In this case the column order must be kept too.
  • [db.query.colPrefix] - Prefix rendered before each selected column name.
  • [db.query.from] - The FROM part of the query. If missing, the query should select from [db.table] or [db.view.pv] depending on whether OID object is used (db.view.pv), or [db.query.useViewCols] is true (db.view.pv). [db.table] should be used for non-OID objects.
  • [db.query.where] - The WHERE part of the query.
  • [db.query.orderBy] - The ORDER BY part of the query.
Type-level metadata:
  • [db.table] - Table name
  • [db.type] - If ADT (object) mapping is used, denotes name of the ADT type to use.
  • [db.view.pv] - Name of the Polymorphic view
Attribute-level metadata
  • [db.column] - Column name
  • [db.viewColumn] - View column name


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

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