Skip to content

Commit

Permalink
Corrected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreCharles committed May 10, 2017
1 parent 6b44e97 commit 34064d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/Model/DBInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <QSqlError>
#include <qvariant.h>
#include <string>
#include <map>

using namespace std;

Expand All @@ -38,13 +39,13 @@ class DBInteractor

static DBInteractor* getInstance();

void PrepareAndExecuteQuerySelect(String tableName, Map<String, String> columnValueMappingForSelect);
void PrepareAndExecuteQueryInsert(String tableName, Map<String, String> columnValueMappingForInsert);
void PrepareAndExecuteQueryUpdate(String tableName, Map<String, String> columnValueMappingForSet, Map<String, String> columnValueMappingForCondition);
void PrepareAndExecuteQueryDelete(String tableName, Map<String, String> columnValueMappingForCondition);
void PrepareAndExecuteQuerySelect(string tableName, map<string, string> columnValueMappingForSelect);
void PrepareAndExecuteQueryInsert(string tableName, map<string, string> columnValueMappingForInsert);
void PrepareAndExecuteQueryUpdate(string tableName, map<string, string> columnValueMappingForSet, map<string, string> columnValueMappingForCondition);
void PrepareAndExecuteQueryDelete(string tableName, map<string, string> columnValueMappingForCondition);
void ExecuteQuery(string queryString);
void InsertDefaultData(string pathFileName);
map<string, string> RemovingNullOrBlankMappValue(columnValueMapping);
map<string, string> RemovingNullOrBlankMappValue(map<string, string> columnValueMapping);

~DBInteractor()
{
Expand Down
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include <iostream>
#include <string>
#include <map>
#include "Model/DBInteractor.h"

using namespace std;

int main()
{
Expand All @@ -13,13 +15,13 @@ int main()
// 2)
// EXAMPLE UPDATE
// Preparing to call and execute function to generate UPDATE SQL request
Map<String, String> columnValueMappingForSet = new HashMap<String, String>();
map<string, string> columnValueMappingForSet;
columnValueMappingForSet.put("FIRST_NAME", "'DEBOPAM'");
columnValueMappingForSet.put("LAST_NAME", "'PAL'");
columnValueMappingForSet.put("DESIGNATION", "'Software Developer'");
columnValueMappingForSet.put("ORGANIZATION", "'NIC'");

Map<String, String> columnValueMappingForCondition = new HashMap<String, String>();
map<string, string> columnValueMappingForCondition;
columnValueMappingForCondition.put("COLUMN1", "LAIEHDOA ZUFH");

// UPDATE
Expand Down

0 comments on commit 34064d1

Please sign in to comment.