15 {
16
17 TRG_MSG_INFO(
"Start loading data with ID = " << rdTarget.id());
18
19 try {
21
22 unique_ptr<coral::IQuery>
q(
m_session.nominalSchema().tableHandle(
"L1_RANDOM").newQuery());
23 q->setRowCacheSize( 5 );
24
25 coral::AttributeList bindList;
26 bindList.extend<long>("rdId");
27 bindList[0].data<long>() = rdTarget.id();
28
29 q->setCondition(
"L1R_ID = :rdId", bindList );
30
31
32 coral::AttributeList attList;
34 attList.extend<std::string>( "L1R_NAME" );
35 attList.extend<int>( "L1R_VERSION" );
36 attList.extend<long>( "L1R_RATE1" );
37 attList.extend<long>( "L1R_RATE2" );
38 } else {
39 attList.extend<string>( "L1R_CUT0" );
40 attList.extend<string>( "L1R_CUT1" );
41 attList.extend<string>( "L1R_CUT2" );
42 attList.extend<string>( "L1R_CUT3" );
43 }
45
46 coral::ICursor&
cursor =
q->execute();
47
51 throw std::runtime_error( "RandomLoader >> Random not available" );
52 }
53
54 const coral::AttributeList&
row =
cursor.currentRow();
56 std::string
name =
row[
"L1R_NAME"].data<std::string>();
58 long rate1 =
row[
"L1R_RATE1"].data<
long>();
59 long rate2 =
row[
"L1R_RATE2"].data<
long>();
60
61 rdTarget.setName( name );
62 rdTarget.setVersion( version );
63 rdTarget.setRate1( rate1 );
64 rdTarget.setRate2( rate2 );
65 } else {
66 string cut0 =
row[
"L1R_CUT0"].data<
string>();
67 string cut1 =
row[
"L1R_CUT1"].data<
string>();
68 string cut2 =
row[
"L1R_CUT2"].data<
string>();
69 string cut3 =
row[
"L1R_CUT3"].data<
string>();
70
71 rdTarget.setCut(0,
static_cast<uint32_t>(std::stoul(cut0)));
72 rdTarget.setCut(1,
static_cast<uint32_t>(std::stoul(cut1)));
73 rdTarget.setCut(2,
static_cast<uint32_t>(std::stoul(cut2)));
74 rdTarget.setCut(3,
static_cast<uint32_t>(std::stoul(cut3)));
75 }
76
78 TRG_MSG_ERROR(
"More than one Random exists " << rdTarget.id());
80 throw std::runtime_error( "RandomLoader >> Random not available" );
81 }
82
84 return true;
85 }
86 catch( const coral::Exception& e ) {
89 throw;
90 }
91}
void commitSession()
commit session if not already done
void startSession()
start session if not already active
row
Appending html table to final .html summary file.
void fillQuery(coral::IQuery *q, coral::AttributeList &attList)