7 #include <CoralBase/Attribute.h>
8 #include <CoralBase/AttributeList.h>
10 #include "RelationalAccess/SchemaException.h"
11 #include "RelationalAccess/ITransaction.h"
12 #include "RelationalAccess/ITable.h"
13 #include "RelationalAccess/ICursor.h"
14 #include "RelationalAccess/IQuery.h"
15 #include "RelationalAccess/ISchema.h"
16 #include "RelationalAccess/ITableDescription.h"
29 msg() <<
"PrioritySetLoader started loading data via MasterID = " << psTarget.
lvl1MasterTableId() << std::endl;
34 coral::IQuery* Query =
m_session.nominalSchema().newQuery();
37 Query->addToTableList (
"L1_TRIGGER_ITEM",
"TI" );
38 Query->addToTableList (
"L1_TM_TO_TI",
"TMTI");
39 Query->addToTableList (
"L1_MASTER_TABLE",
"MT" );
43 bindList.extend<
int>(
"mtId");
45 std::string theCondition =
"";
46 theCondition += std::string(
" MT.L1MT_ID = :mtId" );
47 theCondition += std::string(
" AND MT.L1MT_TRIGGER_MENU_ID = TMTI.L1TM2TI_TRIGGER_MENU_ID" );
48 theCondition += std::string(
" AND TMTI.L1TM2TI_TRIGGER_ITEM_ID = TI.L1TI_ID" );
49 Query->setCondition( theCondition, bindList );
53 attList.extend<
long>(
"TI.L1TI_CTP_ID" );
54 attList.extend<std::string>(
"TI.L1TI_PRIORITY" );
55 Query->defineOutput(attList);
56 Query->addToOutputList(
"TI.L1TI_CTP_ID" );
57 Query->addToOutputList(
"TI.L1TI_PRIORITY" );
60 std::string theOrder =
"";
61 theOrder +=
" TI.L1TI_CTP_ID";
63 Query->addToOrderList( theOrder );
66 coral::ICursor& Cursor = Query->execute();
68 while (Cursor.next()) {
71 row.toOutputStream(
msg() ) << std::endl;
72 long ctp_id =
row[
"TI.L1TI_CTP_ID"].data<
long>();
73 prio.at(ctp_id) =
row[
"TI.L1TI_PRIORITY"].data<std::string>();
79 }
catch (
const coral::SchemaException&
e) {
80 msg() <<
"PrioritySetLoader >> SchemaException: "
81 <<
e.what() << std::endl;
85 msg() <<
"PrioritySetLoader >> Standard C++ exception: " <<
e.what() << std::endl;
89 msg() <<
"PrioritySetLoader >> unknown C++ exception" << std::endl;