15 #ifndef ORM_FUNCTIONAL_OBJECT_HPP
16 #define ORM_FUNCTIONAL_OBJECT_HPP
48 std::string
processJSON(
const std::string& input_message);
77 void createDriverByName();
79 void setDatabaseName();
81 void put(
const std::string & key,
const std::string & value ) {
82 this->_dbDriver->put(key,value);
83 this->_status = this->_dbDriver->getLastError();
85 std::string
get (
const std::string & key ) {
86 std::string value(this->_dbDriver->get(key));
87 this->_status = this->_dbDriver->getLastError();
90 std::vector<std::string> get_all () {
91 std::vector<std::string> value (this->_dbDriver->get_all());
92 this->_status = this->_dbDriver->getLastError();
95 void del (
const std::string& key) {
96 this->_dbDriver->del(key);
97 this->_status = _dbDriver->getLastError();
104 Poco::SharedPtr<Response> putData(
const std::string&);
105 Poco::SharedPtr<Response> getData(
const std::string&);
106 Poco::SharedPtr<Response> delData(
const std::string&);
107 Poco::SharedPtr<Response> checkData(
const std::string&);
108 Poco::SharedPtr<Response> adminData(
const std::string&);
112 inline int getLastError() {
return _dbDriver->getLastError(); }
120 STATUS loadResourcesFromJSON(
const std::string&, std::map<std::string, std::string>&);
121 STATUS loadDocIdsFromJSON(
const std::string&, std::vector<std::string>&);
128 const std::string getDBEngine()
const {
return this->_dbConfig.
getDriverName(); }
130 unsigned int _errorCode;
131 std::string _errorMsg;
134 typedef std::function<Poco::SharedPtr<HCE::Response>(
ORMFunctionalObject*,
const std::string&)> FP;
135 std::vector<FP> command;
137 Poco::SharedPtr<HCE::BaseDB> _dbDriver;
139 Poco::DynamicFactory<HCE::BaseDB> _factory;
142 inline void ORMFunctionalObject::createDriverByName() {
144 this->_dbDriver = this->_factory.createInstance( this->_dbConfig.
getDriverName() );
148 inline void ORMFunctionalObject::setDriverUrl() {
150 if (this->_dbDriver) {
151 this->_dbDriver->setDriverUrl( this->_dbConfig.
getDataBaseUrl() );
156 inline void ORMFunctionalObject::setDatabaseName() {
158 if (this->_dbDriver) {