11 #include "RelationalAccess/ITransaction.h"
12 #include "RelationalAccess/ISessionProxy.h"
13 #include "RelationalAccess/ISchema.h"
14 #include "RelationalAccess/ITable.h"
15 #include "RelationalAccess/TableDescription.h"
16 #include "CoralBase/Attribute.h"
17 #include "CoralBase/AttributeList.h"
18 #include "CoralBase/TimeStamp.h"
33 : m_connectionPool(), m_configMapDb(iConfig.getParameter<
std::
string>(
"configMapDatabase")) {
42 coral::TableDescription mapTable;
43 mapTable.setName(
"STRIP_CONFIG_TO_PAYLOAD_MAP");
44 mapTable.insertColumn(
"CONFIG_HASH", coral::AttributeSpecification::typeNameForType<std::string>());
45 mapTable.insertColumn(
"PAYLOAD_HASH", coral::AttributeSpecification::typeNameForType<std::string>());
46 mapTable.insertColumn(
"PAYLOAD_TYPE", coral::AttributeSpecification::typeNameForType<std::string>());
47 mapTable.insertColumn(
"CONFIG_STRING", coral::AttributeSpecification::typeNameForType<std::string>());
48 mapTable.insertColumn(
"INSERTION_TIME", coral::AttributeSpecification::typeNameForType<coral::TimeStamp>());
49 mapTable.setPrimaryKey(
"CONFIG_HASH");
50 mapTable.setNotNullConstraint(
"CONFIG_HASH");
51 mapTable.setNotNullConstraint(
"PAYLOAD_HASH");
52 mapTable.setNotNullConstraint(
"PAYLOAD_TYPE");
53 mapTable.setNotNullConstraint(
"CONFIG_STRING");
54 mapTable.setNotNullConstraint(
"INSERTION_TIME");
56 cmDbSession->transaction().start(
false);
57 cmDbSession->nominalSchema().createTable(mapTable);
58 cmDbSession->transaction().commit();