{"action":"created","comment":{"url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/comments/189888705","pull_request_review_id":122153144,"id":189888705,"diff_hunk":"@@ -0,0 +1,91 @@\n+package ua.tor.jdbc.dao;\n+\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+import java.util.List;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.beans.factory.annotation.Qualifier;\n+import org.springframework.jdbc.core.JdbcTemplate;\n+import org.springframework.jdbc.core.RowMapper;\n+import org.springframework.stereotype.Component;\n+import ua.tor.jdbc.dao.interfaces.ItemDao;\n+import ua.tor.jdbc.models.Item;\n+\n+/**\n+ * \n+ * @date 05.21.2018\n+ * @author alex\n+ *\n+ */\n+@Component\n+public class ItemDaoImpl implements ItemDao {\n+\n+\tprivate static final int ITEMS_PER_PAGE = 5;\n+\n+\tprivate static final String QUERY_INSERT_USER = \"INSERT INTO Item(name, price) VALUES(?,?)\";\n+\n+\tprivate static final String QUERY_UPDATE_USER =\n+\t\t\t\"UPDATE Item SET name = ?, price = ? WHERE id = ? \";\n+\n+\tprivate static final String QUERY_DELETE_USER = \"DELETE FROM Item WHERE id = ?\";\n+\n+\tprivate static final String QUERY_GET_0NE_USER = \"SELECT * FROM User WHERE id = ?\";\n+\n+\tprivate static final String QUERY_GET_ALL_USER = \"SELECT * FROM Item  LIMIT ?, ? \";\n+\n+\t@Autowired\n+\t@Qualifier(\"jdbcItem\")\n+\tprivate JdbcTemplate jdbcTemplate;\n+\n+\t/**\n+\t * \n+\t */\n+\t@Override\n+\tpublic void inserData(Item item) {\n+\t\tjdbcTemplate.update(QUERY_INSERT_USER, new Object[] {item.getName(), item.getPrice()});\n+\t}\n+\n+\t/**\n+\t * Get all user from database;\n+\t */\n+\t@Override\n+\tpublic List<Item> getUserList(int page) {\n+\t\treturn this.jdbcTemplate.query(QUERY_GET_ALL_USER,\n+\t\t\t\tnew Object[] {ITEMS_PER_PAGE * (page - 1), ITEMS_PER_PAGE}, new ItemMapper());\n+\t}\n+\n+\t/**\n+\t * Get user by id;","path":"src/main/java/ua/tor/jdbc/dao/ItemDaoImpl.java","position":58,"original_position":58,"commit_id":"884ad63eb662f29432b2c9c824924ff6e3763372","original_commit_id":"884ad63eb662f29432b2c9c824924ff6e3763372","user":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2018-05-22T12:54:21Z","updated_at":"2018-05-22T12:54:22Z","html_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1#discussion_r189888705","pull_request_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/comments/189888705"},"html":{"href":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1#discussion_r189888705"},"pull_request":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1"}},"in_reply_to_id":189585837},"pull_request":{"url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1","id":189359617,"html_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1","diff_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1.diff","patch_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1.patch","issue_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/1","number":1,"state":"open","locked":false,"title":"merge to develop","user":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"body":"The task was: create a simple application that has CRUD operations with two databases;\r\nThe way to interact with - RESTful API.","created_at":"2018-05-21T12:00:30Z","updated_at":"2018-05-22T12:54:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e48e6145b521d0db4dd0f663d409659c60fb0df0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1/commits","review_comments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1/comments","review_comment_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/1/comments","statuses_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/statuses/884ad63eb662f29432b2c9c824924ff6e3763372","head":{"label":"AlexanderTorchynskyi:develop","ref":"develop","sha":"884ad63eb662f29432b2c9c824924ff6e3763372","user":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"repo":{"id":134262515,"name":"SpringJDBS","full_name":"AlexanderTorchynskyi/SpringJDBS","owner":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS","description":"Simple spring boot project with CRUD for two db using Spring JDBC  ","fork":false,"url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS","forks_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/forks","keys_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/teams","hooks_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/hooks","issue_events_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/events","assignees_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/tags","blobs_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/languages","stargazers_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/stargazers","contributors_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/contributors","subscribers_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/subscribers","subscription_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/subscription","commits_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/merges","archive_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/downloads","issues_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/deployments","created_at":"2018-05-21T11:53:40Z","updated_at":"2018-05-21T11:53:42Z","pushed_at":"2018-05-21T12:00:31Z","git_url":"git://github.com/AlexanderTorchynskyi/SpringJDBS.git","ssh_url":"git@github.com:AlexanderTorchynskyi/SpringJDBS.git","clone_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS.git","svn_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"AlexanderTorchynskyi:master","ref":"master","sha":"530aa9d863ecf096c92e48b57e856d9fad5e0cbc","user":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"repo":{"id":134262515,"name":"SpringJDBS","full_name":"AlexanderTorchynskyi/SpringJDBS","owner":{"login":"AlexanderTorchynskyi","id":17685386,"avatar_url":"https://avatars3.githubusercontent.com/u/17685386?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderTorchynskyi","html_url":"https://github.com/AlexanderTorchynskyi","followers_url":"https://api.github.com/users/AlexanderTorchynskyi/followers","following_url":"https://api.github.com/users/AlexanderTorchynskyi/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderTorchynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderTorchynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderTorchynskyi/subscriptions","organizations_url":"https://api.github.com/users/AlexanderTorchynskyi/orgs","repos_url":"https://api.github.com/users/AlexanderTorchynskyi/repos","events_url":"https://api.github.com/users/AlexanderTorchynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderTorchynskyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS","description":"Simple spring boot project with CRUD for two db using Spring JDBC  ","fork":false,"url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS","forks_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/forks","keys_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/teams","hooks_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/hooks","issue_events_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/events","assignees_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/tags","blobs_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/languages","stargazers_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/stargazers","contributors_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/contributors","subscribers_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/subscribers","subscription_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/subscription","commits_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/merges","archive_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/downloads","issues_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/deployments","created_at":"2018-05-21T11:53:40Z","updated_at":"2018-05-21T11:53:42Z","pushed_at":"2018-05-21T12:00:31Z","git_url":"git://github.com/AlexanderTorchynskyi/SpringJDBS.git","ssh_url":"git@github.com:AlexanderTorchynskyi/SpringJDBS.git","clone_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS.git","svn_url":"https://github.com/AlexanderTorchynskyi/SpringJDBS","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1"},"html":{"href":"https://github.com/AlexanderTorchynskyi/SpringJDBS/pull/1"},"issue":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/1"},"comments":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/AlexanderTorchynskyi/SpringJDBS/statuses/884ad63eb662f29432b2c9c824924ff6e3763372"}},"author_association":"OWNER"}}
{"actor":{"display_login":"AlexanderTorchynskyi"}}