CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::NamedRefMapping Class Reference

#include <RelationalMapping.h>

Inheritance diagram for ora::NamedRefMapping:
ora::IRelationalMapping

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 ()
 
- Public Member Functions inherited from ora::IRelationalMapping
virtual ~IRelationalMapping ()
 

Private Attributes

TableRegisterm_tableRegister
 
Reflex::Type m_type
 

Detailed Description

Definition at line 116 of file RelationalMapping.h.

Constructor & Destructor Documentation

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

Definition at line 313 of file RelationalMapping.cc.

313  :
314  m_type( attributeType ),
315  m_tableRegister( tableRegister ){
316 }
TableRegister & m_tableRegister
ora::NamedRefMapping::~NamedRefMapping ( )

Definition at line 318 of file RelationalMapping.cc.

318  {
319 }

Member Function Documentation

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().

Referenced by python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

324  {
325  std::string typeName = m_type.Name(Reflex::SCOPED);
326  ora::MappingElement& me = parentElement.appendSubElement( ora::MappingElement::namedReferenceMappingElementType(), attributeName, typeName, parentElement.tableName() );
327 
328  std::vector< std::string > cols;
329  std::string inputCol = ora::MappingRules::columnNameForNamedReference( attributeNameForSchema, scopeNameForSchema );
330  std::string columnName(inputCol);
331  unsigned int i=0;
332  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
334  i++;
335  }
336  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
337  cols.push_back(columnName);
338 
339  me.setColumnNames( cols );
340 
341 }
int i
Definition: DBlmapReader.cc:9
static std::string namedReferenceMappingElementType()
Returns the name of the named reference element type.
bool insertColumn(const std::string &tableName, const std::string &columnName)
MappingElement & appendSubElement(const std::string &elementType, const std::string &variableName, const std::string &variableType, const std::string &tableName)
bool checkColumn(const std::string &tableName, const std::string &columnName)
static std::string columnNameForNamedReference(const std::string &variableName, const std::string &scope)
TableRegister & m_tableRegister
static const size_t MaxColumnNameLength
Definition: MappingRules.h:20
static std::string newNameForSchemaObject(const std::string &initialName, unsigned int index, size_t maxLength, char indexTrailer=0)
functions for new schema object name generation
void setColumnNames(const std::vector< std::string > &columns)

Member Data Documentation

TableRegister& ora::NamedRefMapping::m_tableRegister
private

Definition at line 126 of file RelationalMapping.h.

Reflex::Type ora::NamedRefMapping::m_type
private

Definition at line 125 of file RelationalMapping.h.