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

#include <RelationalMapping.h>

Inheritance diagram for ora::UniqueReferenceMapping:
ora::IRelationalMapping

Public Member Functions

void process (MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
 
 UniqueReferenceMapping (const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
 
 ~UniqueReferenceMapping ()
 
- Public Member Functions inherited from ora::IRelationalMapping
virtual ~IRelationalMapping ()
 

Private Attributes

TableRegisterm_tableRegister
 
edm::TypeWithDict m_type
 

Detailed Description

Definition at line 88 of file RelationalMapping.h.

Constructor & Destructor Documentation

ora::UniqueReferenceMapping::UniqueReferenceMapping ( const edm::TypeWithDict attributeType,
TableRegister tableRegister 
)

Definition at line 256 of file RelationalMapping.cc.

256  :
257  m_type(attributeType),m_tableRegister( tableRegister ){
258 }
ora::UniqueReferenceMapping::~UniqueReferenceMapping ( )

Definition at line 260 of file RelationalMapping.cc.

260  {
261 }

Member Function Documentation

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

Implements ora::IRelationalMapping.

Definition at line 263 of file RelationalMapping.cc.

References ora::MappingElement::appendSubElement(), ora::MappingRules::columnNameForRefId(), ora::MappingRules::columnNameForRefMetadata(), i, ora::MappingRules::MaxColumnNameLength, ora::MappingRules::newNameForSchemaObject(), ora::MappingElement::setColumnNames(), AlCaHLTBitMon_QueryRunRegistry::string, ora::MappingElement::tableName(), ora::throwException(), and ora::MappingElement::uniqueReferenceMappingElementType().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), 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_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), 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().

266  {
267 
268  std::string typeName = m_type.cppName();
269  if(!m_tableRegister.checkTable( parentElement.tableName())){
270  throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
271  "UniqueReferenceMapping::process");
272  }
273  ora::MappingElement& me = parentElement.appendSubElement( ora::MappingElement::uniqueReferenceMappingElementType(), attributeName, typeName, parentElement.tableName() );
274 
275  std::vector< std::string > cols;
276  std::string inputCol = ora::MappingRules::columnNameForRefMetadata( attributeNameForSchema, scopeNameForSchema );
277  std::string columnName(inputCol);
278  unsigned int i=0;
279  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
281  i++;
282  }
283  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
284  cols.push_back(columnName);
285 
286  std::string idCol = ora::MappingRules::columnNameForRefId( attributeNameForSchema, scopeNameForSchema);
287  columnName = idCol;
288  i=0;
289  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
291  i++;
292  }
293  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
294  cols.push_back(columnName);
295 
296  me.setColumnNames( cols );
297 }
int i
Definition: DBlmapReader.cc:9
static std::string columnNameForRefId(const std::string &variableName, const std::string &scope)
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)
std::string cppName() const
static std::string uniqueReferenceMappingElementType()
Returns the name of the ORA polymorphic pointer mapping element type.
static std::string columnNameForRefMetadata(const std::string &variableName, const std::string &scope)
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
void setColumnNames(const std::vector< std::string > &columns)

Member Data Documentation

TableRegister& ora::UniqueReferenceMapping::m_tableRegister
private

Definition at line 98 of file RelationalMapping.h.

edm::TypeWithDict ora::UniqueReferenceMapping::m_type
private

Definition at line 97 of file RelationalMapping.h.