{"action":"created","comment":{"url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/comments/45436058","id":45436058,"diff_hunk":"@@ -0,0 +1,60 @@\n+#include \"AQueryBuilder.hpp\"\n+\n+//\n+// Init attributs\n+//\n+AQueryBuilder::AQueryBuilder(QString table, QSqlDatabase *db)\n+{\n+    _queryObj = NULL;\n+    _table = table;\n+    _db = db;\n+}\n+\n+AQueryBuilder::~AQueryBuilder()\n+{\n+}\n+\n+//\n+// Bind value to construct a secure query\n+//\n+AQueryBuilder *AQueryBuilder::bindValue(QString key, QString value)\n+{\n+    _bindedValues.insert(std::pair<QString,QString>(key, value));\n+    return (this);\n+}\n+\n+//\n+// Bind value to construct a secure query\n+//\n+AQueryBuilder *AQueryBuilder::bindValue(QString key, int value)\n+{\n+    _bindedValues.insert(std::pair<QString,QString>(key, QString::number(value)));\n+    return (this);\n+}\n+\n+//\n+// \"Build\" the QSqlQuery :\n+// - Prepare the query\n+// - Bind every saved value\n+// - Return the builded QSqlQuery\n+//\n+QSqlQuery *AQueryBuilder::build()\n+{\n+    std::map<QString, QString>::const_iterator it;\n+\n+    _queryObj = new QSqlQuery(*(_db));\n+    _queryObj->prepare(_queryStr);\n+\n+    for (it = _bindedValues.begin(); it != _bindedValues.end(); ++it)\n+    {\n+\tQVariant value(it->second);\n+\t_queryObj->bindValue(it->first, value);\n+    }\n+\n+    return _queryObj;\n+}\n+\n+QString AQueryBuilder::getQueryString() const","path":"source/server/microkernel_architecture/microkernel_modules/database_manager/AQueryBuilder.cpp","position":57,"original_position":57,"commit_id":"46dc6747e3c2857a86cdd3784ca87df44dd66b0a","original_commit_id":"b11c95cabab29b2c8ad86612e8665fdeb77c8fe0","user":{"login":"BernardJeremy","id":4998208,"avatar_url":"https://avatars.githubusercontent.com/u/4998208?v=3","gravatar_id":"","url":"https://api.github.com/users/BernardJeremy","html_url":"https://github.com/BernardJeremy","followers_url":"https://api.github.com/users/BernardJeremy/followers","following_url":"https://api.github.com/users/BernardJeremy/following{/other_user}","gists_url":"https://api.github.com/users/BernardJeremy/gists{/gist_id}","starred_url":"https://api.github.com/users/BernardJeremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BernardJeremy/subscriptions","organizations_url":"https://api.github.com/users/BernardJeremy/orgs","repos_url":"https://api.github.com/users/BernardJeremy/repos","events_url":"https://api.github.com/users/BernardJeremy/events{/privacy}","received_events_url":"https://api.github.com/users/BernardJeremy/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-11-20T04:59:32Z","updated_at":"2015-11-20T04:59:32Z","html_url":"https://github.com/EIP-SAM/SAM-Solution/pull/10#discussion_r45436058","pull_request_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/comments/45436058"},"html":{"href":"https://github.com/EIP-SAM/SAM-Solution/pull/10#discussion_r45436058"},"pull_request":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10","id":50735123,"html_url":"https://github.com/EIP-SAM/SAM-Solution/pull/10","diff_url":"https://github.com/EIP-SAM/SAM-Solution/pull/10.diff","patch_url":"https://github.com/EIP-SAM/SAM-Solution/pull/10.patch","issue_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/10","number":10,"state":"open","locked":false,"title":"ORM: #29: connect & find + #30: request + #31: save + #32: query builder","user":{"login":"clairealmozinos","id":12676729,"avatar_url":"https://avatars.githubusercontent.com/u/12676729?v=3","gravatar_id":"","url":"https://api.github.com/users/clairealmozinos","html_url":"https://github.com/clairealmozinos","followers_url":"https://api.github.com/users/clairealmozinos/followers","following_url":"https://api.github.com/users/clairealmozinos/following{/other_user}","gists_url":"https://api.github.com/users/clairealmozinos/gists{/gist_id}","starred_url":"https://api.github.com/users/clairealmozinos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clairealmozinos/subscriptions","organizations_url":"https://api.github.com/users/clairealmozinos/orgs","repos_url":"https://api.github.com/users/clairealmozinos/repos","events_url":"https://api.github.com/users/clairealmozinos/events{/privacy}","received_events_url":"https://api.github.com/users/clairealmozinos/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-14T23:24:21Z","updated_at":"2015-11-20T04:59:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf6f5770c8fbede4e7f25d4f1ee6627393d2f6dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10/commits","review_comments_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10/comments","review_comment_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/10/comments","statuses_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/statuses/46dc6747e3c2857a86cdd3784ca87df44dd66b0a","head":{"label":"EIP-SAM:entity_manager","ref":"entity_manager","sha":"46dc6747e3c2857a86cdd3784ca87df44dd66b0a","user":{"login":"EIP-SAM","id":12535470,"avatar_url":"https://avatars.githubusercontent.com/u/12535470?v=3","gravatar_id":"","url":"https://api.github.com/users/EIP-SAM","html_url":"https://github.com/EIP-SAM","followers_url":"https://api.github.com/users/EIP-SAM/followers","following_url":"https://api.github.com/users/EIP-SAM/following{/other_user}","gists_url":"https://api.github.com/users/EIP-SAM/gists{/gist_id}","starred_url":"https://api.github.com/users/EIP-SAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EIP-SAM/subscriptions","organizations_url":"https://api.github.com/users/EIP-SAM/orgs","repos_url":"https://api.github.com/users/EIP-SAM/repos","events_url":"https://api.github.com/users/EIP-SAM/events{/privacy}","received_events_url":"https://api.github.com/users/EIP-SAM/received_events","type":"Organization","site_admin":false},"repo":{"id":35975328,"name":"SAM-Solution","full_name":"EIP-SAM/SAM-Solution","owner":{"login":"EIP-SAM","id":12535470,"avatar_url":"https://avatars.githubusercontent.com/u/12535470?v=3","gravatar_id":"","url":"https://api.github.com/users/EIP-SAM","html_url":"https://github.com/EIP-SAM","followers_url":"https://api.github.com/users/EIP-SAM/followers","following_url":"https://api.github.com/users/EIP-SAM/following{/other_user}","gists_url":"https://api.github.com/users/EIP-SAM/gists{/gist_id}","starred_url":"https://api.github.com/users/EIP-SAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EIP-SAM/subscriptions","organizations_url":"https://api.github.com/users/EIP-SAM/orgs","repos_url":"https://api.github.com/users/EIP-SAM/repos","events_url":"https://api.github.com/users/EIP-SAM/events{/privacy}","received_events_url":"https://api.github.com/users/EIP-SAM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EIP-SAM/SAM-Solution","description":"System Administration Manager","fork":false,"url":"https://api.github.com/repos/EIP-SAM/SAM-Solution","forks_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/forks","keys_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/teams","hooks_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/hooks","issue_events_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/events{/number}","events_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/events","assignees_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/assignees{/user}","branches_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/branches{/branch}","tags_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/tags","blobs_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/refs{/sha}","trees_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/statuses/{sha}","languages_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/languages","stargazers_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/stargazers","contributors_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/contributors","subscribers_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/subscribers","subscription_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/subscription","commits_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/commits{/sha}","git_commits_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/commits{/sha}","comments_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/comments{/number}","issue_comment_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/comments{/number}","contents_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/contents/{+path}","compare_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/merges","archive_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/downloads","issues_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues{/number}","pulls_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls{/number}","milestones_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/milestones{/number}","notifications_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/labels{/name}","releases_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/releases{/id}","created_at":"2015-05-20T21:30:28Z","updated_at":"2015-10-01T16:29:40Z","pushed_at":"2015-11-20T04:28:42Z","git_url":"git://github.com/EIP-SAM/SAM-Solution.git","ssh_url":"git@github.com:EIP-SAM/SAM-Solution.git","clone_url":"https://github.com/EIP-SAM/SAM-Solution.git","svn_url":"https://github.com/EIP-SAM/SAM-Solution","homepage":null,"size":286,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"EIP-SAM:develop","ref":"develop","sha":"814e6938d6667b3604e9e422ac2ca3dce9791c53","user":{"login":"EIP-SAM","id":12535470,"avatar_url":"https://avatars.githubusercontent.com/u/12535470?v=3","gravatar_id":"","url":"https://api.github.com/users/EIP-SAM","html_url":"https://github.com/EIP-SAM","followers_url":"https://api.github.com/users/EIP-SAM/followers","following_url":"https://api.github.com/users/EIP-SAM/following{/other_user}","gists_url":"https://api.github.com/users/EIP-SAM/gists{/gist_id}","starred_url":"https://api.github.com/users/EIP-SAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EIP-SAM/subscriptions","organizations_url":"https://api.github.com/users/EIP-SAM/orgs","repos_url":"https://api.github.com/users/EIP-SAM/repos","events_url":"https://api.github.com/users/EIP-SAM/events{/privacy}","received_events_url":"https://api.github.com/users/EIP-SAM/received_events","type":"Organization","site_admin":false},"repo":{"id":35975328,"name":"SAM-Solution","full_name":"EIP-SAM/SAM-Solution","owner":{"login":"EIP-SAM","id":12535470,"avatar_url":"https://avatars.githubusercontent.com/u/12535470?v=3","gravatar_id":"","url":"https://api.github.com/users/EIP-SAM","html_url":"https://github.com/EIP-SAM","followers_url":"https://api.github.com/users/EIP-SAM/followers","following_url":"https://api.github.com/users/EIP-SAM/following{/other_user}","gists_url":"https://api.github.com/users/EIP-SAM/gists{/gist_id}","starred_url":"https://api.github.com/users/EIP-SAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EIP-SAM/subscriptions","organizations_url":"https://api.github.com/users/EIP-SAM/orgs","repos_url":"https://api.github.com/users/EIP-SAM/repos","events_url":"https://api.github.com/users/EIP-SAM/events{/privacy}","received_events_url":"https://api.github.com/users/EIP-SAM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EIP-SAM/SAM-Solution","description":"System Administration Manager","fork":false,"url":"https://api.github.com/repos/EIP-SAM/SAM-Solution","forks_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/forks","keys_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/teams","hooks_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/hooks","issue_events_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/events{/number}","events_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/events","assignees_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/assignees{/user}","branches_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/branches{/branch}","tags_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/tags","blobs_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/refs{/sha}","trees_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/statuses/{sha}","languages_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/languages","stargazers_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/stargazers","contributors_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/contributors","subscribers_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/subscribers","subscription_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/subscription","commits_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/commits{/sha}","git_commits_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/git/commits{/sha}","comments_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/comments{/number}","issue_comment_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/comments{/number}","contents_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/contents/{+path}","compare_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/merges","archive_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/downloads","issues_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues{/number}","pulls_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls{/number}","milestones_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/milestones{/number}","notifications_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/labels{/name}","releases_url":"https://api.github.com/repos/EIP-SAM/SAM-Solution/releases{/id}","created_at":"2015-05-20T21:30:28Z","updated_at":"2015-10-01T16:29:40Z","pushed_at":"2015-11-20T04:28:42Z","git_url":"git://github.com/EIP-SAM/SAM-Solution.git","ssh_url":"git@github.com:EIP-SAM/SAM-Solution.git","clone_url":"https://github.com/EIP-SAM/SAM-Solution.git","svn_url":"https://github.com/EIP-SAM/SAM-Solution","homepage":null,"size":286,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10"},"html":{"href":"https://github.com/EIP-SAM/SAM-Solution/pull/10"},"issue":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/10"},"comments":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/EIP-SAM/SAM-Solution/statuses/46dc6747e3c2857a86cdd3784ca87df44dd66b0a"}}}}