RDBQuery is an implementation of IRDBQuery interface.
More...
#include <RDBQuery.h>
RDBQuery is an implementation of IRDBQuery interface.
Definition at line 29 of file RDBQuery.h.
◆ RDBQuery() [1/2]
◆ ~RDBQuery()
◆ RDBQuery() [2/2]
◆ addToOutput()
void RDBQuery::addToOutput |
( |
const std::string & |
field | ) |
|
|
overridevirtual |
◆ data() [1/2]
template<typename T >
const T & IRDBQuery::data |
( |
const std::string & |
field | ) |
|
|
inherited |
◆ data() [2/2]
template<typename T >
const T & IRDBQuery::data |
( |
unsigned int |
fieldInd | ) |
|
|
inherited |
◆ execute()
void RDBQuery::execute |
( |
| ) |
|
|
overridevirtual |
Implements IRDBQuery.
Definition at line 49 of file RDBQuery.cxx.
52 m_accessSvc->msg() << MSG::WARNING <<
"RDBQuery cannot be executed more than once! Query: "
68 m_accessSvc->msg() << MSG::ERROR <<
"Cannot connect to the database: "
70 throw std::runtime_error(
"Cannot connect to the database " +
m_connName);
77 for (
char&
ch : upperName) {
78 ch = std::toupper (
static_cast<unsigned int>(
ch));
95 for(
int i=0;
i<dataTableDesc.numberOfColumns(); ++
i) {
96 m_query->addToOutputList(upperName+
"_DATA."+dataTableDesc.columnDescription(
i).name());
100 m_queryCount->addToOutputList(
"COUNT("+upperName+
"_DATA_ID)",
"SUMREC");
103 m_query->addToTableList(upperName +
"_DATA");
104 m_query->addToTableList(upperName +
"_DATA2TAG");
110 m_query->addToOrderList(upperName +
"_DATA." + upperName +
"_DATA_ID");
118 bindsData.extend<std::string>(
"tagID");
120 std::string queryStructCondition = upperName +
"_DATA2TAG." + upperName +
"_TAG_ID =:tagID";
121 m_queryCount->setCondition(queryStructCondition , bindsData);
123 queryStructCondition +=
" AND " + upperName +
"_DATA." + upperName +
"_DATA_ID=" + upperName +
"_DATA2TAG." + upperName +
"_DATA_ID";
124 m_query->setCondition(queryStructCondition , bindsData);
126 bindsData[0].data<std::string>() =
m_tagId;
129 m_query->setMemoryCacheSize(1);
133 while(cursorCount.next()) {
135 m_size = cursorCount.currentRow()[
"SUMREC"].data<
long>();
142 catch(coral::SchemaException&
se) {
143 m_accessSvc->msg() << MSG::WARNING <<
"QUERY: Schema Exception : " + std::string(
se.what()) <<
endmsg;
146 m_accessSvc->msg() << MSG::WARNING <<
"QUERY: Exception : " + std::string(
e.what()) <<
endmsg;
◆ finalize()
void RDBQuery::finalize |
( |
| ) |
|
|
overridevirtual |
◆ isNull() [1/2]
bool IRDBQuery::isNull |
( |
const std::string & |
field | ) |
|
|
inlineinherited |
◆ isNull() [2/2]
bool IRDBQuery::isNull |
( |
unsigned int |
fieldInd | ) |
|
|
inlineinherited |
◆ next()
◆ setOrder()
void RDBQuery::setOrder |
( |
const std::string & |
field | ) |
|
|
overridevirtual |
◆ size()
◆ m_accessSvc
◆ m_attrList
const coral::AttributeList* IRDBQuery::m_attrList {nullptr} |
|
protectedinherited |
◆ m_connName
std::string RDBQuery::m_connName |
|
private |
◆ m_cursor
coral::ICursor* RDBQuery::m_cursor |
|
private |
◆ m_dblock
◆ m_executed
bool RDBQuery::m_executed |
|
private |
◆ m_fields
std::vector<std::string> RDBQuery::m_fields |
|
private |
◆ m_nodeName
std::string RDBQuery::m_nodeName |
|
private |
◆ m_orderField
std::string RDBQuery::m_orderField |
|
private |
◆ m_query
coral::IQuery* RDBQuery::m_query |
|
private |
◆ m_queryCount
coral::IQuery* RDBQuery::m_queryCount |
|
private |
◆ m_size
◆ m_tagId
std::string RDBQuery::m_tagId |
|
private |
The documentation for this class was generated from the following files: