Class building the Business Object Model (BOM) from data retrieved from the database. More...
#include <opentrep/command/DBManager.hpp>
Static Public Member Functions | |
static NbOfDBEntries_T | buildSQLDB (const PORFilePath_T &, const SQLiteDBFilePath_T &) |
static void | updatePlaceInDB (soci::session &, const Place &) |
static bool | retrievePlace (soci::session &, const LocationKey &, Place &) |
static bool | retrieveClosestPlaces (soci::session &, const double &iLatitude, const double &iLongitude, PlaceOrderedList_T &) |
static void | prepareSelectAllStatement (soci::session &, soci::statement &, Place &) |
static void | prepareSelectFromCodeStatement (soci::session &, soci::statement &, Place &) |
static void | prepareSelectFromCoordStatement (soci::session &, soci::statement &, const double &iLatitude, const double &iLongitude) |
static bool | iterateOnStatement (soci::statement &, Place &) |
Class building the Business Object Model (BOM) from data retrieved from the database.
Definition at line 28 of file DBManager.hpp.
|
static |
Build the SQL database from the file with the ORI-maintained list of POR (points of reference).
const | PORFilePath_T& File-path of the file of POR (points of reference). |
const | SQLiteDBFilePath_T& File-path of the SQLite3 database. |
Definition at line 516 of file DBManager.cpp.
References OPENTREP::FacPlace::create(), OPENTREP::Place::getKey(), OPENTREP::FacPlace::instance(), iterateOnStatement(), OPENTREP_LOG_DEBUG, OPENTREP_LOG_ERROR, and prepareSelectAllStatement().
Referenced by OPENTREP::OPENTREP_Service::buildSQLDB().
|
static |
Update the Xapian document ID field of the database row corresponding to the given Place object.
soci::session& | SOCI session handler. |
const | Place& The place to be updated. |
Definition at line 410 of file DBManager.cpp.
References OPENTREP::Place::getDocID(), OPENTREP::Place::getIataCode(), OPENTREP_LOG_ERROR, and OPENTREP::Place::toString().
|
static |
Retrieve, from the (SQLite3) database, the row corresponding to the given place code (e.g., 'sfo' for San Francisco Intl airport), and fill the given Place object with that retrieved data.
soci::session& | SOCI session handler. |
const | LocationKey& The primary key of the place to be retrieved. |
Place& | The object corresponding to the place to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 449 of file DBManager.cpp.
References OPENTREP::LocationKey::getGeonamesID(), OPENTREP::LocationKey::getIataCode(), OPENTREP::LocationKey::getIataType(), OPENTREP::IATAType::getTypeAsString(), iterateOnStatement(), OPENTREP_LOG_DEBUG, and OPENTREP_LOG_ERROR.
|
static |
Retrieve, from the (SQLite3) database, the row corresponding to the given place code (e.g., 'sfo' for San Francisco Intl airport), and fill the given Place object with that retrieved data.
soci::session& | SOCI session handler. |
const | std::double& The latitude of the place to be retrieved. |
const | std::double& The longitude of the place to be retrieved. |
PlaceOrderedList_T& | The list corresponding to the places to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 494 of file DBManager.cpp.
References OPENTREP_LOG_ERROR.
|
static |
Prepare (parse and put in cache) the SQL statement.
soci::session& | SOCI session handler. |
soci::statement& | SOCI SQL statement handler. |
Place& | The object corresponding to the place to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 22 of file DBManager.cpp.
References OPENTREP_LOG_ERROR.
Referenced by buildSQLDB().
|
static |
Prepare (parse and put in cache) the SQL statement.
soci::session& | SOCI session handler. |
soci::statement& | SOCI SQL statement handler. |
Place& | The object corresponding to the place to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 109 of file DBManager.cpp.
References OPENTREP_LOG_ERROR.
|
static |
Prepare (parse and put in cache) the SQL statement.
soci::session& | SOCI session handler. |
soci::statement& | SOCI SQL statement handler. |
Place& | The object corresponding to the place to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 172 of file DBManager.cpp.
References OPENTREP::FacPlace::create(), OPENTREP::FacPlace::instance(), and OPENTREP_LOG_ERROR.
|
static |
Iterate on the SQL statement.
The SQL has to be already prepared.
soci::statement& | SOCI SQL statement handler. |
Place& | The object corresponding to the place to be retrieved. It has to be given empty, and is filled by the method. |
Definition at line 388 of file DBManager.cpp.
References OPENTREP::Place::describeKey(), and OPENTREP_LOG_ERROR.
Referenced by buildSQLDB(), and retrievePlace().