7 #if defined(SOCI_HEADERS_BURIED)
8 #include <soci/core/soci.h>
9 #include <soci/backends/mysql/soci-mysql.h>
10 #else // SOCI_HEADERS_BURIED
11 #include <soci/soci.h>
12 #include <soci/mysql/soci-mysql.h>
13 #endif // SOCI_HEADERS_BURIED
15 #include <stdair/bom/AirlineStruct.hpp>
16 #include <stdair/service/Logger.hpp>
25 stdair::DBRequestStatement_T& ioSelectStatement,
26 stdair::AirlineStruct& ioAirline) {
44 }
catch (std::exception
const& lException) {
45 STDAIR_LOG_ERROR (
"Error: " << lException.what());
46 throw stdair::SQLDatabaseException (lException.what());
52 prepareSelectOnAirlineCodeStatement (stdair::DBSession_T& ioSociSession,
53 stdair::DBRequestStatement_T& ioSelectStatement,
54 const stdair::AirlineCode_T& iAirlineCode,
55 stdair::AirlineStruct& ioAirline) {
90 }
catch (std::exception
const& lException) {
91 STDAIR_LOG_ERROR (
"Error: " << lException.what());
92 throw stdair::SQLDatabaseException (lException.what());
98 stdair::AirlineStruct& ioAirline,
99 const bool iShouldDoReset) {
100 bool hasStillData =
false;
105 if (iShouldDoReset ==
true) {
110 hasStillData = ioStatement.fetch();
112 }
catch (std::exception
const& lException) {
113 STDAIR_LOG_ERROR (
"Error: " << lException.what());
114 throw stdair::SQLDatabaseException (lException.what());
122 const stdair::AirlineStruct& iAirline) {
127 ioSociSession.begin();
130 std::string lAirlineCode;
145 ioSociSession.commit();
150 }
catch (std::exception
const& lException) {
151 STDAIR_LOG_ERROR (
"Error: " << lException.what());
152 throw stdair::SQLDatabaseException (lException.what());
158 const stdair::AirlineCode_T& iAirlineCode,
159 stdair::AirlineStruct& ioAirline) {
160 bool oHasRetrievedAirline =
false;
165 stdair::DBRequestStatement_T lSelectStatement (ioSociSession);
166 DBManager::prepareSelectOnAirlineCodeStatement (ioSociSession,
168 iAirlineCode, ioAirline);
169 const bool shouldDoReset =
true;
172 if (hasStillData ==
true) {
173 oHasRetrievedAirline =
true;
177 const bool shouldNotDoReset =
false;
183 }
catch (std::exception
const& lException) {
184 STDAIR_LOG_ERROR (
"Error: " << lException.what());
185 throw stdair::SQLDatabaseException (lException.what());
188 return oHasRetrievedAirline;