6 #include "CoralBase/Attribute.h" 7 #include "CoralBase/AttributeList.h" 8 #include "CoralBase/TimeStamp.h" 14 #include "RelationalAccess/ISchema.h" 15 #include "RelationalAccess/ISessionProxy.h" 16 #include "RelationalAccess/ITable.h" 17 #include "RelationalAccess/ITransaction.h" 18 #include "RelationalAccess/TableDescription.h" 32 : m_connectionPool(), m_configMapDb(iConfig.getParameter<
std::
string>(
"configMapDatabase")) {
39 coral::TableDescription mapTable;
40 mapTable.setName(
"STRIP_CONFIG_TO_PAYLOAD_MAP");
41 mapTable.insertColumn(
"CONFIG_HASH", coral::AttributeSpecification::typeNameForType<std::string>());
42 mapTable.insertColumn(
"PAYLOAD_HASH", coral::AttributeSpecification::typeNameForType<std::string>());
43 mapTable.insertColumn(
"PAYLOAD_TYPE", coral::AttributeSpecification::typeNameForType<std::string>());
44 mapTable.insertColumn(
"CONFIG_STRING", coral::AttributeSpecification::typeNameForType<std::string>());
45 mapTable.insertColumn(
"INSERTION_TIME", coral::AttributeSpecification::typeNameForType<coral::TimeStamp>());
46 mapTable.setPrimaryKey(
"CONFIG_HASH");
47 mapTable.setNotNullConstraint(
"CONFIG_HASH");
48 mapTable.setNotNullConstraint(
"PAYLOAD_HASH");
49 mapTable.setNotNullConstraint(
"PAYLOAD_TYPE");
50 mapTable.setNotNullConstraint(
"CONFIG_STRING");
51 mapTable.setNotNullConstraint(
"INSERTION_TIME");
53 cmDbSession->transaction().start(
false);
54 cmDbSession->nominalSchema().createTable(mapTable);
55 cmDbSession->transaction().commit();
std::string m_configMapDb
T getParameter(std::string const &) const
cond::persistency::ConnectionPool m_connectionPool
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
void setParameters(const edm::ParameterSet &connectionPset)
SiStripPayloadMapTableCreator(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
std::shared_ptr< coral::ISessionProxy > createCoralSession(const std::string &connectionString, bool writeCapable=false)
~SiStripPayloadMapTableCreator() override=default