CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::OraReferenceMapping Class Reference

#include <RelationalMapping.h>

Inheritance diagram for ora::OraReferenceMapping:
ora::IRelationalMapping

List of all members.

Public Member Functions

 OraReferenceMapping (const Reflex::Type &attributeType, TableRegister &tableRegister)
void process (MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
 ~OraReferenceMapping ()

Private Attributes

TableRegisterm_tableRegister
Reflex::Type m_type

Detailed Description

Definition at line 74 of file RelationalMapping.h.


Constructor & Destructor Documentation

ora::OraReferenceMapping::OraReferenceMapping ( const Reflex::Type &  attributeType,
TableRegister tableRegister 
)

Definition at line 212 of file RelationalMapping.cc.

                                                                                                          :
  m_type(attributeType),m_tableRegister( tableRegister ){
}
ora::OraReferenceMapping::~OraReferenceMapping ( )

Definition at line 216 of file RelationalMapping.cc.

                                            {
}

Member Function Documentation

void ora::OraReferenceMapping::process ( MappingElement parentElement,
const std::string &  attributeName,
const std::string &  attributeNameForSchema,
const std::string &  scopeNameForSchema 
) [virtual]

Implements ora::IRelationalMapping.

Definition at line 219 of file RelationalMapping.cc.

References ora::MappingElement::appendSubElement(), className(), ora::MappingRules::columnNameForOID(), i, j, ora::MappingRules::MaxColumnNameLength, ora::MappingRules::newNameForSchemaObject(), ora::MappingElement::OraReferenceMappingElementType(), ora::MappingElement::setColumnNames(), ora::MappingElement::tableName(), and ora::throwException().

                                                                             {
  std::string className = m_type.Name(Reflex::SCOPED);
  std::string elementType = ora::MappingElement::OraReferenceMappingElementType();
  if(!m_tableRegister.checkTable( parentElement.tableName())){
    throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
                   "OraReferenceMapping::process");
  }
  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, className, parentElement.tableName() );

  std::vector<std::string> cols;
  for(unsigned int j=0;j<2;j++){
    std::string inputCol = ora::MappingRules::columnNameForOID( attributeNameForSchema, scopeNameForSchema, j );
    std::string columnName(inputCol);
    unsigned int i=0;
    while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
      columnName = ora::MappingRules::newNameForSchemaObject( inputCol, i, ora::MappingRules::MaxColumnNameLength );
      i++;
    }
    m_tableRegister.insertColumn(parentElement.tableName(),columnName);
    cols.push_back( columnName );
  }
  me.setColumnNames( cols );
}

Member Data Documentation

Definition at line 84 of file RelationalMapping.h.

Reflex::Type ora::OraReferenceMapping::m_type [private]

Definition at line 83 of file RelationalMapping.h.