18 {
19
21 try {
22
23 {
25 unique_ptr<coral::IQuery>
q(
m_session.nominalSchema().tableHandle(
"L1_BUNCH_GROUP_SET").newQuery());
26 q->setRowCacheSize( 5 );
27
28
29 coral::AttributeList bindList;
30 bindList.extend<int>("bgsId");
31 bindList[0].data<
int>() = (
int)
data.id();
32 q->setCondition(
"L1BGS_ID = :bgsId", bindList );
33
34
35 coral::AttributeList attList;
36 attList.extend<std::string>( "L1BGS_NAME" );
37 attList.extend<int>( "L1BGS_VERSION" );
38 attList.extend<std::string>( "L1BGS_COMMENT" );
40
41 coral::ICursor&
cursor =
q->execute();
42
46 throw std::runtime_error( "BunchGroupSetLoader >> BunchGroupSet not available" );
47 }
48
49 const coral::AttributeList&
row =
cursor.currentRow();
50 string name =
row[
"L1BGS_NAME"].data<std::string>();
51 int version =
row[
"L1BGS_VERSION"].data<
int>();
52 string comment =
row[
"L1BGS_COMMENT"].data<std::string>();
53
57 throw std::runtime_error( "BunchGroupSetLoader >> BunchGroupSet not available" );
58 }
59
60
62 data.setVersion( version );
63 data.setComment( comment );
64 }
65
66
67 {
68 unique_ptr<coral::IQuery>
q(
m_session.nominalSchema().tableHandle(
"L1_BGS_TO_BG").newQuery() );
69 q->setRowCacheSize( 5 );
70
71
72 coral::AttributeList bindList;
73 bindList.extend<int>("bgsId");
74 bindList[0].data<
int>() = (
int)
data.id();
75 q->setCondition(
"L1BGS2BG_BUNCH_GROUP_SET_ID = :bgsId ", bindList );
76
77
78 coral::AttributeList attList;
79 attList.extend<long>( "L1BGS2BG_BUNCH_GROUP_ID" );
80 attList.extend<long>( "L1BGS2BG_INTERNAL_NUMBER" );
82 attList.extend<string>( "L1BGS2BG_BUNCH_GROUP_NAME" );
83 }
85
86 q->addToOrderList(
"L1BGS2BG_INTERNAL_NUMBER" );
87
88 coral::ICursor&
cursor =
q->execute();
89
90 BunchGroupLoader& bgldr =
dynamic_cast<BunchGroupLoader&
>(
dynamic_cast<StorageMgr&
>(
m_storageMgr).bunchGroupLoader() );
93 const coral::AttributeList&
row =
cursor.currentRow();
94
96 bg.setInternalNumber( row[
"L1BGS2BG_INTERNAL_NUMBER"].
data<long>() );
99 }
100 if ( !bgldr.load( bg ) ) {
103 throw std::runtime_error( "BunchGroupSetLoader: Error loading BunchGroup" );
104 }
105
106 data.addBunchGroup(bg);
107 }
109 }
110
111 }
112 catch( const coral::Exception& e ) {
115 throw;
116 }
117
118 return true;
119}
char data[hepevt_bytes_allocation_ATLAS]
StorageMgr & m_storageMgr
reference to the storage manager
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)