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::OraReferenceMapping Class Reference

#include <RelationalMapping.h>

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

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

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 220 of file RelationalMapping.cc.

220  :
221  m_type(attributeType),m_tableRegister( tableRegister ){
222 }
TableRegister & m_tableRegister
ora::OraReferenceMapping::~OraReferenceMapping ( )

Definition at line 224 of file RelationalMapping.cc.

224  {
225 }

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 227 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(), AlCaHLTBitMon_QueryRunRegistry::string, ora::MappingElement::tableName(), and ora::throwException().

Referenced by ConfigBuilder.ConfigBuilder::__init__(), ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::anyOf(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HARVESTING(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

230  {
231  std::string className = m_type.Name(Reflex::SCOPED);
233  if(!m_tableRegister.checkTable( parentElement.tableName())){
234  throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
235  "OraReferenceMapping::process");
236  }
237  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, className, parentElement.tableName() );
238 
239  std::vector<std::string> cols;
240  for(unsigned int j=0;j<2;j++){
241  std::string inputCol = ora::MappingRules::columnNameForOID( attributeNameForSchema, scopeNameForSchema, j );
242  std::string columnName(inputCol);
243  unsigned int i=0;
244  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
246  i++;
247  }
248  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
249  cols.push_back( columnName );
250  }
251  me.setColumnNames( cols );
252 }
int i
Definition: DBlmapReader.cc:9
bool insertColumn(const std::string &tableName, const std::string &columnName)
static std::string OraReferenceMappingElementType()
Returns the name of the ORA reference mapping element type.
MappingElement & appendSubElement(const std::string &elementType, const std::string &variableName, const std::string &variableType, const std::string &tableName)
int j
Definition: DBlmapReader.cc:9
static std::string columnNameForOID(const std::string &variableName, const std::string &scope, unsigned int index)
TableRegister & m_tableRegister
bool checkColumn(const std::string &tableName, const std::string &columnName)
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
static const size_t MaxColumnNameLength
Definition: MappingRules.h:20
bool checkTable(const std::string &tableName)
static std::string newNameForSchemaObject(const std::string &initialName, unsigned int index, size_t maxLength, char indexTrailer=0)
functions for new schema object name generation
std::string className(const T &t)
Definition: ClassName.h:30
void setColumnNames(const std::vector< std::string > &columns)

Member Data Documentation

TableRegister& ora::OraReferenceMapping::m_tableRegister
private

Definition at line 84 of file RelationalMapping.h.

Reflex::Type ora::OraReferenceMapping::m_type
private

Definition at line 83 of file RelationalMapping.h.