CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RelationalMapping.cc
Go to the documentation of this file.
4 #include "RelationalMapping.h"
5 #include "TableRegister.h"
6 #include "MappingElement.h"
7 #include "MappingRules.h"
8 #include "ClassUtils.h"
9 // externals
12 #include "CoralBase/AttributeSpecification.h"
13 
14 size_t
16  size_t sz=0;
17  bool hasDependencies = false;
18  _sizeInColumns(topLevelClassType, sz, hasDependencies );
19  return sz;
20 }
21 
22 std::pair<bool,size_t>
24  size_t sz=0;
25  bool hasDependencies = false;
26  _sizeInColumnsForCArray(topLevelClassType, sz, hasDependencies );
27  return std::make_pair(hasDependencies,sz);
28 }
29 
30 
31 void
33  size_t& sz,
34  bool& hasDependencies ){
35  // resolve possible typedef chains
36  edm::TypeWithDict typ = ClassUtils::resolvedType( topLevelClassType );
37  bool isOraPolyPointer = ora::ClassUtils::isTypeUniqueReference(typ);
38  bool isPrimitive = ora::ClassUtils::isTypePrimitive( typ );
39 
40  // primitive and string
41  if( isPrimitive || isOraPolyPointer || ora::ClassUtils::isTypeNamedReference( typ)) {
42  ++sz;
43  } else if (typ.isArray()){
44  size_t arraySize = 0;
45  _sizeInColumnsForCArray( typ,arraySize, hasDependencies );
46  if( arraySize < MappingRules::MaxColumnsForInlineCArray ) sz += arraySize;
47  else hasDependencies = true;
48  } else if (typ == typeid(ora::Reference) ||
49  typ.hasBase( edm::TypeWithDict( typeid(ora::Reference) ) )){
50  sz += 2;
51  } else {
52 
53  bool isContainer = ora::ClassUtils::isTypeNonAssociativeContainer(typ) ||
55  bool isOraPointer = ora::ClassUtils::isTypeOraPointer(typ);
56  if( !isContainer && !isOraPointer ){
57 
58  // loop over the data members
59  //-ap ignore for now: typ.UpdateMembers();
60  //std::vector<edm::TypeWithDict> carrays;
61  edm::TypeDataMembers members(typ);
62  for (auto const & member : members) {
63  edm::MemberWithDict objMember(member);
64 
65  // Skip the transient ones
66  if ( objMember.isTransient() ) continue;
67 
68  // Retrieve the field type
69  edm::TypeWithDict objMemberType = objMember.typeOf();
70 
71  _sizeInColumns(objMemberType,sz, hasDependencies );
72  }
73  } else {
74  hasDependencies = true;
75  }
76  }
77 }
78 
79 void
81  size_t& sz,
82  bool& hasDependencies){
83  // resolve possible typedef chains
84  edm::TypeWithDict typ = ClassUtils::resolvedType( topLevelClassType );
85  if( !typ.isArray()){
86  return;
87  }
88 
89  size_t arraySize = ClassUtils::arrayLength( typ );
90  edm::TypeWithDict arrayType = typ.toType();
91  size_t arrayElementSize = 0;
92  _sizeInColumns(arrayType, arrayElementSize, hasDependencies);
93  size_t totSize = arraySize*arrayElementSize;
94  sz += totSize;
95 }
96 
97 
99  m_tableRegister( tableRegister ){
100 }
101 
103 }
104 
106  bool blobStreaming ){
107  if( blobStreaming ){
108  return new BlobMapping( attributeType, m_tableRegister );
109  }
110  edm::TypeWithDict resType = ClassUtils::resolvedType( attributeType );
111  if ( ora::ClassUtils::isTypePrimitive(resType) ) {
112  return new PrimitiveMapping( attributeType, m_tableRegister );
113  }
114  else if ( resType.isArray() ){
115  return new CArrayMapping( attributeType, m_tableRegister );
116  }
117  else if ( ora::ClassUtils::isTypeContainer( resType ) ) {
118  return new ArrayMapping( attributeType, m_tableRegister );
119  }
120  else if ( resType.isPointer() || resType.isReference() ){
121  return new EmptyMapping();
122  }
123  else if ( ora::ClassUtils::isTypeOraPointer( resType )){
124  return new OraPtrMapping( attributeType, m_tableRegister );
125  }
126  else if ( ora::ClassUtils::isTypeUniqueReference( resType )){
127  return new UniqueReferenceMapping( attributeType, m_tableRegister );
128  }
129  else if ( resType == typeid(ora::Reference) ||
130  resType.hasBase( edm::TypeWithDict( typeid(ora::Reference) ) ) ){
131  return new OraReferenceMapping( attributeType, m_tableRegister );
132  }
133  else if ( resType == typeid(ora::NamedReference) ||
134  resType.hasBase( edm::TypeWithDict( typeid(ora::NamedReference) ) ) ){
135  return new NamedRefMapping( attributeType, m_tableRegister );
136  }
137  else { // embeddedobject
138  return new ObjectMapping( attributeType, m_tableRegister );
139  }
140  return 0; // make the compiler happy -- we should never come here !!
141 }
142 
143 namespace ora {
144  void processLeafElement( MappingElement& parentElement,
145  const std::string& elementType,
146  const std::string& typeName,
147  const std::string& attributeName,
148  const std::string& attributeNameForSchema,
149  const std::string& scopeNameForSchema,
150  TableRegister& tableRegister){
151  if(!tableRegister.checkTable( parentElement.tableName())){
152  throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
153  "processLeafElement");
154  }
155  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, typeName, parentElement.tableName() );
156  std::string inputCol = ora::MappingRules::columnNameForVariable( attributeNameForSchema, scopeNameForSchema );
157  std::string columnName(inputCol);
158  unsigned int i=0;
159  while(tableRegister.checkColumn(parentElement.tableName(),columnName)){
161  i++;
162  }
163  tableRegister.insertColumn(parentElement.tableName(),columnName);
164  std::vector<std::string> cols;
165  cols.push_back( columnName );
166  // add metadata column for blobs
167  if( elementType == ora::MappingElement::blobMappingElementType() ){
168  std::string metaDataColumnName = ora::MappingRules::columnNameForBlobMetadata( columnName );
169  tableRegister.insertColumn(parentElement.tableName(),metaDataColumnName );
170  cols.push_back( metaDataColumnName );
171  }
172  me.setColumnNames( cols );
173  }
174 }
175 
177  m_type(attributeType),m_tableRegister( tableRegister ){
178 }
179 
181 }
182 
184  const std::string& attributeName,
185  const std::string& attributeNameForSchema,
186  const std::string& scopeNameForSchema ){
188  const std::type_info* attrType = t.isEnum() ? &typeid(int) : &t.typeInfo();
189  //std::string tn = ClassUtils::demangledName(*attrType);
190  if(ClassUtils::isTypeString( t )) attrType = &typeid(std::string);
191  std::string typeName = coral::AttributeSpecification::typeNameForId(*attrType);
192 
193  processLeafElement(parentElement,
195  typeName,
196  attributeName,
197  attributeNameForSchema,
198  scopeNameForSchema,
199  m_tableRegister);
200 }
201 
202 ora::BlobMapping::BlobMapping( const edm::TypeWithDict& attributeType, TableRegister& tableRegister ):
203  m_type(attributeType),m_tableRegister( tableRegister ){
204 }
205 
207 }
209  const std::string& attributeName,
210  const std::string& attributeNameForSchema,
211  const std::string& scopeNameForSchema ){
212  std::string className = m_type.cppName();
213  processLeafElement(parentElement,
215  className,
216  attributeName,
217  attributeNameForSchema,
218  scopeNameForSchema,
219  m_tableRegister);
220 }
221 
223  m_type(attributeType),m_tableRegister( tableRegister ){
224 }
225 
227 }
228 
230  const std::string& attributeName,
231  const std::string& attributeNameForSchema,
232  const std::string& scopeNameForSchema ){
233  std::string className = m_type.cppName();
235  if(!m_tableRegister.checkTable( parentElement.tableName())){
236  throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
237  "OraReferenceMapping::process");
238  }
239  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, className, parentElement.tableName() );
240 
241  std::vector<std::string> cols;
242  for(unsigned int j=0;j<2;j++){
243  std::string inputCol = ora::MappingRules::columnNameForOID( attributeNameForSchema, scopeNameForSchema, j );
244  std::string columnName(inputCol);
245  unsigned int i=0;
246  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
248  i++;
249  }
250  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
251  cols.push_back( columnName );
252  }
253  me.setColumnNames( cols );
254 }
255 
257  m_type(attributeType),m_tableRegister( tableRegister ){
258 }
259 
261 }
262 
264  const std::string& attributeName,
265  const std::string& attributeNameForSchema,
266  const std::string& scopeNameForSchema ){
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 }
298 
299 ora::OraPtrMapping::OraPtrMapping( const edm::TypeWithDict& attributeType, TableRegister& tableRegister ):
300  m_type(attributeType), m_tableRegister( tableRegister ){
301 }
302 
304 }
305 
307  const std::string& attributeName,
308  const std::string& attributeNameForSchema,
309  const std::string& scopeNameForSchema ){
310 
311  std::string typeName = m_type.cppName();
312  ora::MappingElement& me = parentElement.appendSubElement( ora::MappingElement::OraPointerMappingElementType(), attributeName, typeName, parentElement.tableName() );
313  me.setColumnNames( parentElement.columnNames() );
314 
315  edm::TypeWithDict ptrType = m_type.templateArgumentAt(0);
316  std::string ptrTypeName = ptrType.name();
317 
318  RelationalMappingFactory factory( m_tableRegister );
319  std::auto_ptr<IRelationalMapping> processor( factory.newProcessor( ptrType ) );
320  processor->process( me, ptrTypeName, attributeNameForSchema, scopeNameForSchema );
321 }
322 
324  m_type( attributeType ),
325  m_tableRegister( tableRegister ){
326 }
327 
329 }
330 
332  const std::string& attributeName,
333  const std::string& attributeNameForSchema,
334  const std::string& scopeNameForSchema ){
335  std::string typeName = m_type.cppName();
336  ora::MappingElement& me = parentElement.appendSubElement( ora::MappingElement::namedReferenceMappingElementType(), attributeName, typeName, parentElement.tableName() );
337 
338  std::vector< std::string > cols;
339  std::string inputCol = ora::MappingRules::columnNameForNamedReference( attributeNameForSchema, scopeNameForSchema );
340  std::string columnName(inputCol);
341  unsigned int i=0;
342  while(m_tableRegister.checkColumn(parentElement.tableName(),columnName)){
344  i++;
345  }
346  m_tableRegister.insertColumn(parentElement.tableName(),columnName);
347  cols.push_back(columnName);
348 
349  me.setColumnNames( cols );
350 
351 }
352 
353 ora::ArrayMapping::ArrayMapping( const edm::TypeWithDict& attributeType, TableRegister& tableRegister ):
354  m_type(attributeType), m_tableRegister( tableRegister ){
355 }
356 
358 }
359 
361  const std::string& attributeName,
362  const std::string& attributeNameForSchema,
363  const std::string& scopeNameForSchema ){
364  std::string tableName = parentElement.tableName();
365  std::string initialTable(tableName);
366 
367  std::string arrayTable(initialTable);
368  unsigned int i=0;
369  while(m_tableRegister.checkTable(arrayTable)){
371  i++;
372  }
373  m_tableRegister.insertTable(arrayTable);
374 
375  std::string className = m_type.cppName();
376 
380  }
381  ora::MappingElement& me = parentElement.appendSubElement( elementType,attributeName,className,arrayTable );
382  const std::vector<std::string>& parentColumns = parentElement.columnNames();
383  if( parentColumns.empty()){
384  throwException( "No column name found in the parent mapping element.","ArrayMapping::process");
385  }
386 
387  std::vector<std::string> columns;
388  // always comes the oid first
389  columns.push_back( ora::MappingRules::columnNameForId() );
390  std::vector<std::string>::const_iterator iColumn = parentColumns.begin();
391  // then copy the columns except the id...
392  iColumn++;
393  for ( ;iColumn != parentColumns.end(); iColumn++ ) {
394  columns.push_back( ora::MappingRules::columnNameForId() + "_" + *iColumn );
395  }
396  // and finally add the position!
397  columns.push_back( ora::MappingRules::columnNameForPosition() );
398 
399  me.setColumnNames( columns );
400  m_tableRegister.insertColumns(arrayTable, columns );
401 
402  std::string arrayScopeNameForSchema = scopeNameForSchema;
403  if( !arrayScopeNameForSchema.empty() ) arrayScopeNameForSchema +="_";
404  arrayScopeNameForSchema += attributeNameForSchema;
405 
406 
407  bool singleItemContainer = ora::ClassUtils::isTypeNonAssociativeContainer(m_type);
408  bool associativeContainer = ora::ClassUtils::isTypeAssociativeContainer(m_type);
409 
410  edm::TypeWithDict contentType;
411  edm::TypeWithDict keyType;
412  std::string contentTypeName;
413 
414  if( singleItemContainer ){
415  contentType = ClassUtils::containerValueType(m_type);
416  contentTypeName = "value_type";
417  }
418  else if ( associativeContainer ) { // This is an associative container type
419  contentType = ClassUtils::containerDataType( m_type );
420  contentTypeName = "mapped_type";
421  keyType = ClassUtils::containerKeyType( m_type );
422  if( !keyType || !ClassUtils::resolvedType(keyType) ){
423  throwException( "Cannot not resolve the type of the key item of container \""+m_type.cppName()+"\".",
424  "ArrayMapping::process");
425  }
426  }
427  else {
428  // Not supported container
429  throwException( "Container type=\""+m_type.cppName()+"\".is not supported.",
430  "ArrayMapping::process");
431  }
432 
433  if( !contentType || !ClassUtils::resolvedType(contentType) ){
434  throwException( "Cannot not resolve the type of the content item of container \""+m_type.cppName()+"\".",
435  "ArrayMapping::process");
436  }
437  RelationalMappingFactory mappingFactory( m_tableRegister );
438  if ( keyType ) {
439  std::string keyTypeName = "key_type";
441  std::auto_ptr<IRelationalMapping> keyProcessor( mappingFactory.newProcessor( keyType ) );
442  keyProcessor->process( me, keyTypeName, keyTypeNameForSchema, arrayScopeNameForSchema );
443  }
444  std::string contentTypeNameForSchema = MappingRules::variableNameForContainerValue();
445  std::auto_ptr<IRelationalMapping> contentProcessor( mappingFactory.newProcessor( contentType ) );
446  contentProcessor->process( me, contentTypeName, contentTypeNameForSchema, arrayScopeNameForSchema );
447 }
448 
449 ora::CArrayMapping::CArrayMapping( const edm::TypeWithDict& attributeType, TableRegister& tableRegister ):
450  m_type(attributeType), m_tableRegister( tableRegister ){
451 }
452 
454 }
455 
457  const std::string& attributeName,
458  const std::string& attributeNameForSchema,
459  const std::string& scopeNameForSchema ){
460  edm::TypeWithDict arrayElementType = m_type.toType();
461  if( !arrayElementType || !ClassUtils::resolvedType( arrayElementType ) ){
462  throwException("Cannot resolve the type of the content of the array \""+m_type.cppName()+"\".",
463  "CArrayMapping::process");
464  }
465 
466  if(!m_tableRegister.checkTable(parentElement.tableName())){
467  throwException("Table \""+parentElement.tableName()+"\" has not been allocated.",
468  "CArrayMapping::process");
469  }
470  std::string className = m_type.cppName();
471  RelationalMappingFactory mappingFactory( m_tableRegister );
472 
473  std::string arrayScopeNameForSchema = scopeNameForSchema;
474  if( !arrayScopeNameForSchema.empty() ) arrayScopeNameForSchema +="_";
475  arrayScopeNameForSchema += attributeNameForSchema;
476 
477  std::pair<bool,size_t> arraySizeInColumns = RelationalMapping::sizeInColumnsForCArray( m_type );
478 
479  if( !arraySizeInColumns.first && arraySizeInColumns.second < MappingRules::MaxColumnsForInlineCArray ) {
480  size_t columnsInTable = m_tableRegister.numberOfColumns(parentElement.tableName()) + arraySizeInColumns.second;
481  if( columnsInTable < MappingRules::MaxColumnsPerTable ){
482  // Inline C-Array
484  ora::MappingElement& me = parentElement.appendSubElement( mappingElementType, attributeName, className, parentElement.tableName() );
485  me.setColumnNames( parentElement.columnNames() );
486  std::auto_ptr<IRelationalMapping> processor( mappingFactory.newProcessor( arrayElementType ) );
487  size_t arraySize = ClassUtils::arrayLength( m_type );
488  for(size_t i=0;i<arraySize;i++){
489  processor->process( me, MappingRules::variableNameForArrayIndex(attributeName,i),
490  MappingRules::variableNameForArrayColumn(i), arrayScopeNameForSchema );
491  }
492  return;
493  }
494  }
496  std::string tableName = parentElement.tableName();
497  std::string initialTable(tableName);
498 
499  std::string arrayTable(initialTable);
500  unsigned int i=0;
501  while(m_tableRegister.checkTable(arrayTable)){
503  i++;
504  }
505  m_tableRegister.insertTable(arrayTable);
507  attributeName, className, arrayTable );
508  const std::vector<std::string>& parentColumns = parentElement.columnNames();
509  if( parentColumns.empty()){
510  throwException( "No column name found in the parent mapping element.","CArrayMapping::process");
511  }
512  std::vector<std::string> columns;
513  // always comes the oid first
514  columns.push_back( ora::MappingRules::columnNameForId() );
515  std::vector<std::string>::const_iterator iColumn = parentColumns.begin();
516  // then copy the columns except the id...
517  iColumn++;
518  for ( ;iColumn != parentColumns.end(); ++iColumn ) {
519  columns.push_back( ora::MappingRules::columnNameForId() + "_" + *iColumn );
520  }
521  // and finally add the position!
522  columns.push_back( ora::MappingRules::columnNameForPosition() );
523  me.setColumnNames( columns );
524  m_tableRegister.insertColumns(arrayTable, columns );
525 
526  std::string contentTypeName = arrayElementType.name();
527  std::string variableNameForSchema = MappingRules::variableNameForArrayColumn( m_type );
528  std::auto_ptr<IRelationalMapping> processor( mappingFactory.newProcessor( arrayElementType ) );
529  processor->process( me, contentTypeName, variableNameForSchema, arrayScopeNameForSchema );
530 }
531 
532 ora::ObjectMapping::ObjectMapping( const edm::TypeWithDict& attributeType, TableRegister& tableRegister ):
533  m_type(attributeType), m_tableRegister( tableRegister ){
534 }
535 
537 }
538 
539 namespace ora {
540 
543  }
544 
545  bool isMappedToBlob( const edm::MemberWithDict& dataMember ){
547  }
548 
549  void processBaseClasses( MappingElement& mappingElement,
550  const edm::TypeWithDict& objType,
551  const std::string& scopeNameForSchema,
552  TableRegister& tableRegister ){
553  std::string className = objType.cppName();
554  edm::TypeBases bases(objType);
555  for (auto const & b : bases) {
558  if(!baseType){
559  throwException( "Class for base \""+base.name()+"\" is not in the dictionary.","ObjectMapping::process");
560  }
561 
562  // TO BE FIXED:: here there is still to fix the right scopeName to pass
563  processBaseClasses( mappingElement, baseType, scopeNameForSchema, tableRegister );
564  edm::TypeDataMembers members(baseType);
565  for (auto const & member : members) {
566  edm::MemberWithDict baseMember(member);
567  // Skip the transient and the static ones
568  if ( baseMember.isTransient() || baseMember.isStatic() || isLoosePersistencyOnWriting( baseMember ) ) continue;
569  // Retrieve the data member type
571  edm::TypeWithDict declaringType = ClassUtils::resolvedType( baseMember.declaringType());
572  std::string scope = declaringType.cppName();
573  // Retrieve the field name
574  std::string objectMemberName = ora::MappingRules::scopedVariableName( baseMember.name(), scope );
575  std::string objectMemberNameForSchema = ora::MappingRules::scopedVariableForSchemaObjects( baseMember.name(), scope );
576 
577  bool blobStreaming = isMappedToBlob( baseMember );
578 
579  RelationalMappingFactory mappingFactory( tableRegister );
580  std::auto_ptr<IRelationalMapping> processor( mappingFactory.newProcessor( type, blobStreaming ) );
581  processor->process( mappingElement, objectMemberName, objectMemberNameForSchema, scopeNameForSchema );
582  }
583  }
584  }
585 }
586 
588  const std::string& attributeName,
589  const std::string& attributeNameForSchema,
590  const std::string& scopeNameForSchema ){
591  std::string className = m_type.cppName();
593  ora::MappingElement& me = parentElement.appendSubElement( elementType, attributeName, className, parentElement.tableName() );
594  me.setColumnNames( parentElement.columnNames() );
595 
596  // resolve possible typedef chains
597  edm::TypeWithDict objectType = ClassUtils::resolvedType(m_type);
598  // process base class data members
599  processBaseClasses( me, m_type, scopeNameForSchema, m_tableRegister );
600  RelationalMappingFactory mappingFactory( m_tableRegister );
601  std::string scope = attributeName;
602  std::string objectScopeNameForSchema = scopeNameForSchema;
603  if( !objectScopeNameForSchema.empty() ) objectScopeNameForSchema +="_";
604  objectScopeNameForSchema += attributeNameForSchema;
605 
606  // loop over the data members
607  edm::TypeDataMembers members(objectType);
608  for (auto const & member : members) {
609  edm::MemberWithDict objectMember(member);
610  // Skip the transient and the static ones
611  if ( objectMember.isTransient() || objectMember.isStatic() || isLoosePersistencyOnWriting( objectMember )) continue;
612 
613  // Retrieve the field type
615  // Check for the existence of the dictionary information
616  if ( !type ){
617  throwException( "Type for data member \""+objectMember.name()+"\" of class \""+className+
618  "\" has not been found in the dictionary.",
619  "ObjectMapping::process");
620  }
621 
622  // check if the member is from a class in the inheritance tree
623  edm::TypeWithDict declaringType = ClassUtils::resolvedType( objectMember.declaringType());
624  if( declaringType != objectType ){
625  continue;
626  }
627  // Retrieve the field name
628  std::string objectMemberName = objectMember.name();
629  std::string objectNameForSchema = objectMember.name();
630 
631  bool blobStreaming = isMappedToBlob( objectMember );
632 
633  std::auto_ptr<IRelationalMapping> processor( mappingFactory.newProcessor( type, blobStreaming ) );
634  processor->process( me, objectMemberName, objectNameForSchema, objectScopeNameForSchema );
635  }
636 
637 }
638 
640 }
641 
643 }
644 
646  const std::string&,
647  const std::string&,
648  const std::string& ){
649 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
type
Definition: HCALResponse.h:21
bool isEnum() const
int i
Definition: DBlmapReader.cc:9
static std::string namedReferenceMappingElementType()
Returns the name of the named reference element type.
static std::string blobMappingElementType()
Returns the name of the blob mapping element type.
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:483
static std::string arrayMappingElementType()
Returns the name of the array mapping element type.
void processBaseClasses(MappingElement &mappingElement, const edm::TypeWithDict &objType, const std::string &scopeNameForSchema, TableRegister &tableRegister)
static std::string columnNameForRefId(const std::string &variableName, const std::string &scope)
static std::string variableNameForArrayIndex(const std::string &arrayVariable, unsigned int index)
void _sizeInColumns(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
static std::string scopedVariableName(const std::string &variableName, const std::string &scope)
variable name manipulation
static std::string variableNameForContainerKey()
static std::string primitiveMappingElementType()
Returns the name of the primitive mapping element type.
static std::string variableNameForArrayColumn(unsigned int arrayIndex)
bool isTypeNamedReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:336
static std::string variableNameForContainerValue()
static std::string persistencyPropertyNameInDictionary()
Definition: MappingRules.cc:48
bool isStatic() const
static const size_t MaxColumnsForInlineCArray
Definition: MappingRules.h:22
bool isTypeString(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:212
static std::string scopedVariableForSchemaObjects(const std::string &variableName, const std::string &scope)
bool insertColumn(const std::string &tableName, const std::string &columnName)
UniqueReferenceMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
RelationalMappingFactory(TableRegister &tableRegister)
static std::string OraReferenceMappingElementType()
Returns the name of the ORA reference mapping element type.
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
MappingElement & appendSubElement(const std::string &elementType, const std::string &variableName, const std::string &variableType, const std::string &tableName)
bool hasBase(std::string const &) const
bool isTypePrimitive(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:218
TypeWithDict toType() const
static std::string columnNameForVariable(const std::string &variableName, const std::string &scope, bool forData=true)
bool isTypeOraPointer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:320
TypeWithDict templateArgumentAt(size_t index) const
TypeWithDict declaringType() const
bool isArray() const
bool isTypeNonAssociativeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:298
static std::string mappingPropertyNameInDictionary()
class related parameters
Definition: MappingRules.cc:36
static std::string columnNameForPosition()
std::string name() const
std::string cppName() const
bool isTypePVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:352
IRelationalMapping * newProcessor(const edm::TypeWithDict &attributeType, bool blobStreaming=false)
bool isTypeUniqueReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:340
int j
Definition: DBlmapReader.cc:9
std::string name() const
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
CArrayMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
static std::string columnNameForOID(const std::string &variableName, const std::string &scope, unsigned int index)
PrimitiveMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
TypeWithDict typeOf() const
static std::string objectMappingElementType()
Returns the name of the object mapping element type.
std::type_info const & typeInfo() const
TypeWithDict typeOf() const
Definition: BaseWithDict.cc:26
static std::string columnNameForBlobMetadata(const std::string &dataColumnName)
void _sizeInColumnsForCArray(const edm::TypeWithDict &typ, size_t &sz, bool &hasDependencies)
static std::string newNameForArraySchemaObject(const std::string &initialName, unsigned int index, size_t maxLength)
static bool isMappedToBlob(const std::string &mappingProperty)
Definition: MappingRules.cc:43
static std::string columnNameForId()
static std::string uniqueReferenceMappingElementType()
Returns the name of the ORA polymorphic pointer mapping element type.
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
const std::vector< std::string > & columnNames() const
OraReferenceMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
bool isMappedToBlob(const edm::MemberWithDict &dataMember)
static bool isLooseOnWriting(const std::string &persistencyProperty)
Definition: MappingRules.cc:59
bool isReference() const
OraPtrMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
BlobMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
static std::string inlineCArrayMappingElementType()
Returns the name of the inline array 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 processLeafElement(MappingElement &parentElement, const std::string &elementType, const std::string &typeName, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema, TableRegister &tableRegister)
bool isTypeAssociativeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:283
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
size_t arrayLength(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:490
bool isTypeQueryableVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:364
double b
Definition: hdecay.h:120
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
edm::TypeWithDict containerKeyType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:426
edm::TypeWithDict containerDataType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:446
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
static const size_t MaxColumnsPerTable
Definition: MappingRules.h:21
bool isTransient() const
static std::string columnNameForNamedReference(const std::string &variableName, const std::string &scope)
static std::string OraPointerMappingElementType()
Returns the name of the ORA pointer mapping element type.
size_t sizeInColumns(const edm::TypeWithDict &topLevelClassType)
static std::string OraArrayMappingElementType()
Returns the name of the ORA array mapping element type.
ArrayMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
ObjectMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
edm::TypeWithDict containerValueType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:407
static const size_t MaxColumnNameLength
Definition: MappingRules.h:20
NamedRefMapping(const edm::TypeWithDict &attributeType, TableRegister &tableRegister)
const std::string & tableName() const
bool isLoosePersistencyOnWriting(const edm::MemberWithDict &dataMember)
std::string getDataMemberProperty(const std::string &propertyName, const edm::MemberWithDict &dataMember)
Definition: ClassUtils.cc:510
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
bool isPointer() const
bool isTypeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:222
static const size_t MaxTableNameLength
Definition: MappingRules.h:19
bool checkTable(const std::string &tableName)
std::string name() const
Definition: BaseWithDict.cc:21
static std::string newNameForSchemaObject(const std::string &initialName, unsigned int index, size_t maxLength, char indexTrailer=0)
functions for new schema object name generation
static std::string CArrayMappingElementType()
Returns the name of the array mapping element type.
std::pair< bool, size_t > sizeInColumnsForCArray(const edm::TypeWithDict &arrayType)
std::string className(const T &t)
Definition: ClassName.h:30
void process(MappingElement &parentElement, const std::string &attributeName, const std::string &attributeNameForSchema, const std::string &scopeNameForSchema)
void setColumnNames(const std::vector< std::string > &columns)