#include <RelationalMapping.h>
Public Member Functions | |
NamedRefMapping (const Reflex::Type &attributeType, TableRegister &tableRegister) | |
void | process (MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema) |
~NamedRefMapping () | |
Private Attributes | |
TableRegister & | m_tableRegister |
Reflex::Type | m_type |
Definition at line 116 of file RelationalMapping.h.
ora::NamedRefMapping::NamedRefMapping | ( | const Reflex::Type & | attributeType, |
TableRegister & | tableRegister | ||
) |
Definition at line 313 of file RelationalMapping.cc.
: m_type( attributeType ), m_tableRegister( tableRegister ){ }
ora::NamedRefMapping::~NamedRefMapping | ( | ) |
Definition at line 318 of file RelationalMapping.cc.
{ }
void ora::NamedRefMapping::process | ( | MappingElement & | parentElement, |
const std::string & | attributeName, | ||
const std::string & | attributeNameForSchema, | ||
const std::string & | scopeNameForSchema | ||
) | [virtual] |
Implements ora::IRelationalMapping.
Definition at line 321 of file RelationalMapping.cc.
References ora::MappingElement::appendSubElement(), ora::MappingRules::columnNameForNamedReference(), i, ora::MappingRules::MaxColumnNameLength, ora::MappingElement::namedReferenceMappingElementType(), ora::MappingRules::newNameForSchemaObject(), ora::MappingElement::setColumnNames(), and ora::MappingElement::tableName().
{ std::string typeName = m_type.Name(Reflex::SCOPED); ora::MappingElement& me = parentElement.appendSubElement( ora::MappingElement::namedReferenceMappingElementType(), attributeName, typeName, parentElement.tableName() ); std::vector< std::string > cols; std::string inputCol = ora::MappingRules::columnNameForNamedReference( attributeNameForSchema, scopeNameForSchema ); 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 ); }
Definition at line 126 of file RelationalMapping.h.
Reflex::Type ora::NamedRefMapping::m_type [private] |
Definition at line 125 of file RelationalMapping.h.