{"action":"created","comment":{"url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/comments/128207068","pull_request_review_id":50860933,"id":128207068,"diff_hunk":"@@ -0,0 +1,74 @@\n+package com.store.components.service;\n+\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+import java.util.Collection;\n+import java.util.List;\n+\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.jdbc.core.JdbcTemplate;\n+import org.springframework.jdbc.core.RowMapper;\n+import org.springframework.stereotype.Repository;\n+\n+import com.store.components.entity.Cheque;\n+import com.store.components.interface_i.ICheque;\n+\n+@Repository\n+public class ChequeDao implements ICheque{\n+\t/**\n+\t * variable to work with the base\n+\t */\n+\t@Autowired\n+\tprivate JdbcTemplate jdbc;\n+\n+\tpublic static class workingWithRowMap implements RowMapper<Cheque> {\n+\t\t/**\n+\t\t * copy data from DB to cheque\n+\t\t */\n+\t\tpublic Cheque mapRow(ResultSet rs, int rowNum) throws SQLException {\n+\t\t\tCheque cheque = new Cheque();\n+\t\t\tcheque.setId(rs.getInt(1));\n+\t\t\tcheque.setIdReserve(rs.getInt(2));\n+\t\t\tcheque.setIdOrder(rs.getInt(3));\n+\t\t\tcheque.setIdCustomer(rs.getInt(4));\n+\t\t\tcheque.setIdSale(rs.getInt(5));\n+\t\t\tcheque.setAmount(rs.getInt(6));\n+\t\t\tcheque.setOrderDate(rs.getString(7));\n+\n+\t\t\treturn cheque;\n+\t\t}\n+\t}\n+\t\n+\tpublic Collection<Cheque> infoAboutAllCheque(int page) {\n+\t\tpage *= 3;\n+\t\tfinal String SQL = \"SELECT * FROM Cheque LIMIT 3 offset ?\";\n+\t\tList<Cheque> cheque = jdbc.query(SQL, new workingWithRowMap(), page);\n+\t\treturn cheque;\n+\t}\n+\t\n+\t/**\n+\t * Looking information about amount of order by order id\n+\t * \n+\t * @param id\n+\t * @return cheque\n+\t */\n+\tpublic Cheque infoAboutAmountOfOrderById(int id) {\n+\t\tfinal String SQL = \"SELECT * from Cheque WHERE idOrder=?\";\n+\t\tCheque cheque = jdbc.queryForObject(SQL, new workingWithRowMap(), id);\n+\t\treturn cheque;\n+\t}\n+\t\n+\tpublic void addCheque(Cheque cheque) {\n+\t\tfinal String SQL = \"INSERT INTO Cheque (idReserve, idOrder, idCustomer, idSale, Amount, OrderDate) values (?, ?, ?, ?, ?, ?) \";\n+\t\tfinal int idReserve = cheque.getIdReserve();","path":"GroceryStoreRESTfullCRUD/src/main/java/com/store/components/service/ChequeDao.java","position":63,"original_position":63,"commit_id":"6f42f08f90ed25ed7fd0ee6ab36accedf56875fe","original_commit_id":"6f42f08f90ed25ed7fd0ee6ab36accedf56875fe","user":{"login":"af150416","id":24603957,"avatar_url":"https://avatars1.githubusercontent.com/u/24603957?v=4","gravatar_id":"","url":"https://api.github.com/users/af150416","html_url":"https://github.com/af150416","followers_url":"https://api.github.com/users/af150416/followers","following_url":"https://api.github.com/users/af150416/following{/other_user}","gists_url":"https://api.github.com/users/af150416/gists{/gist_id}","starred_url":"https://api.github.com/users/af150416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/af150416/subscriptions","organizations_url":"https://api.github.com/users/af150416/orgs","repos_url":"https://api.github.com/users/af150416/repos","events_url":"https://api.github.com/users/af150416/events{/privacy}","received_events_url":"https://api.github.com/users/af150416/received_events","type":"User","site_admin":false},"body":"you was create a suitable constructor for cheque model, so why you ignore it and write  this unnecessary code line ","created_at":"2017-07-19T10:15:15Z","updated_at":"2017-07-19T10:15:57Z","html_url":"https://github.com/OlenkaA/GroceryStore/pull/35#discussion_r128207068","pull_request_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/comments/128207068"},"html":{"href":"https://github.com/OlenkaA/GroceryStore/pull/35#discussion_r128207068"},"pull_request":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35","id":131273537,"html_url":"https://github.com/OlenkaA/GroceryStore/pull/35","diff_url":"https://github.com/OlenkaA/GroceryStore/pull/35.diff","patch_url":"https://github.com/OlenkaA/GroceryStore/pull/35.patch","issue_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/35","number":35,"state":"open","locked":false,"title":"PrimeFaces","user":{"login":"OlenkaA","id":28622400,"avatar_url":"https://avatars1.githubusercontent.com/u/28622400?v=4","gravatar_id":"","url":"https://api.github.com/users/OlenkaA","html_url":"https://github.com/OlenkaA","followers_url":"https://api.github.com/users/OlenkaA/followers","following_url":"https://api.github.com/users/OlenkaA/following{/other_user}","gists_url":"https://api.github.com/users/OlenkaA/gists{/gist_id}","starred_url":"https://api.github.com/users/OlenkaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlenkaA/subscriptions","organizations_url":"https://api.github.com/users/OlenkaA/orgs","repos_url":"https://api.github.com/users/OlenkaA/repos","events_url":"https://api.github.com/users/OlenkaA/events{/privacy}","received_events_url":"https://api.github.com/users/OlenkaA/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-19T09:19:23Z","updated_at":"2017-07-19T10:15:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"942b1c9174a2a9e9b5670bfbaed917a1c5e354d6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35/commits","review_comments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35/comments","review_comment_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/35/comments","statuses_url":"https://api.github.com/repos/OlenkaA/GroceryStore/statuses/6f42f08f90ed25ed7fd0ee6ab36accedf56875fe","head":{"label":"OlenkaA:hotfix","ref":"hotfix","sha":"6f42f08f90ed25ed7fd0ee6ab36accedf56875fe","user":{"login":"OlenkaA","id":28622400,"avatar_url":"https://avatars1.githubusercontent.com/u/28622400?v=4","gravatar_id":"","url":"https://api.github.com/users/OlenkaA","html_url":"https://github.com/OlenkaA","followers_url":"https://api.github.com/users/OlenkaA/followers","following_url":"https://api.github.com/users/OlenkaA/following{/other_user}","gists_url":"https://api.github.com/users/OlenkaA/gists{/gist_id}","starred_url":"https://api.github.com/users/OlenkaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlenkaA/subscriptions","organizations_url":"https://api.github.com/users/OlenkaA/orgs","repos_url":"https://api.github.com/users/OlenkaA/repos","events_url":"https://api.github.com/users/OlenkaA/events{/privacy}","received_events_url":"https://api.github.com/users/OlenkaA/received_events","type":"User","site_admin":false},"repo":{"id":92270507,"name":"GroceryStore","full_name":"OlenkaA/GroceryStore","owner":{"login":"OlenkaA","id":28622400,"avatar_url":"https://avatars1.githubusercontent.com/u/28622400?v=4","gravatar_id":"","url":"https://api.github.com/users/OlenkaA","html_url":"https://github.com/OlenkaA","followers_url":"https://api.github.com/users/OlenkaA/followers","following_url":"https://api.github.com/users/OlenkaA/following{/other_user}","gists_url":"https://api.github.com/users/OlenkaA/gists{/gist_id}","starred_url":"https://api.github.com/users/OlenkaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlenkaA/subscriptions","organizations_url":"https://api.github.com/users/OlenkaA/orgs","repos_url":"https://api.github.com/users/OlenkaA/repos","events_url":"https://api.github.com/users/OlenkaA/events{/privacy}","received_events_url":"https://api.github.com/users/OlenkaA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OlenkaA/GroceryStore","description":"Realization RESTfull CRUD for model of a grocery store.","fork":false,"url":"https://api.github.com/repos/OlenkaA/GroceryStore","forks_url":"https://api.github.com/repos/OlenkaA/GroceryStore/forks","keys_url":"https://api.github.com/repos/OlenkaA/GroceryStore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OlenkaA/GroceryStore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OlenkaA/GroceryStore/teams","hooks_url":"https://api.github.com/repos/OlenkaA/GroceryStore/hooks","issue_events_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/events{/number}","events_url":"https://api.github.com/repos/OlenkaA/GroceryStore/events","assignees_url":"https://api.github.com/repos/OlenkaA/GroceryStore/assignees{/user}","branches_url":"https://api.github.com/repos/OlenkaA/GroceryStore/branches{/branch}","tags_url":"https://api.github.com/repos/OlenkaA/GroceryStore/tags","blobs_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/refs{/sha}","trees_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OlenkaA/GroceryStore/statuses/{sha}","languages_url":"https://api.github.com/repos/OlenkaA/GroceryStore/languages","stargazers_url":"https://api.github.com/repos/OlenkaA/GroceryStore/stargazers","contributors_url":"https://api.github.com/repos/OlenkaA/GroceryStore/contributors","subscribers_url":"https://api.github.com/repos/OlenkaA/GroceryStore/subscribers","subscription_url":"https://api.github.com/repos/OlenkaA/GroceryStore/subscription","commits_url":"https://api.github.com/repos/OlenkaA/GroceryStore/commits{/sha}","git_commits_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/commits{/sha}","comments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/comments{/number}","issue_comment_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/comments{/number}","contents_url":"https://api.github.com/repos/OlenkaA/GroceryStore/contents/{+path}","compare_url":"https://api.github.com/repos/OlenkaA/GroceryStore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OlenkaA/GroceryStore/merges","archive_url":"https://api.github.com/repos/OlenkaA/GroceryStore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OlenkaA/GroceryStore/downloads","issues_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues{/number}","pulls_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls{/number}","milestones_url":"https://api.github.com/repos/OlenkaA/GroceryStore/milestones{/number}","notifications_url":"https://api.github.com/repos/OlenkaA/GroceryStore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OlenkaA/GroceryStore/labels{/name}","releases_url":"https://api.github.com/repos/OlenkaA/GroceryStore/releases{/id}","deployments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/deployments","created_at":"2017-05-24T08:45:27Z","updated_at":"2017-07-18T14:37:26Z","pushed_at":"2017-07-19T09:19:23Z","git_url":"git://github.com/OlenkaA/GroceryStore.git","ssh_url":"git@github.com:OlenkaA/GroceryStore.git","clone_url":"https://github.com/OlenkaA/GroceryStore.git","svn_url":"https://github.com/OlenkaA/GroceryStore","homepage":"","size":26691,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"OlenkaA:master","ref":"master","sha":"3d4ed478c13af30b0189eb17b988d5536687133a","user":{"login":"OlenkaA","id":28622400,"avatar_url":"https://avatars1.githubusercontent.com/u/28622400?v=4","gravatar_id":"","url":"https://api.github.com/users/OlenkaA","html_url":"https://github.com/OlenkaA","followers_url":"https://api.github.com/users/OlenkaA/followers","following_url":"https://api.github.com/users/OlenkaA/following{/other_user}","gists_url":"https://api.github.com/users/OlenkaA/gists{/gist_id}","starred_url":"https://api.github.com/users/OlenkaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlenkaA/subscriptions","organizations_url":"https://api.github.com/users/OlenkaA/orgs","repos_url":"https://api.github.com/users/OlenkaA/repos","events_url":"https://api.github.com/users/OlenkaA/events{/privacy}","received_events_url":"https://api.github.com/users/OlenkaA/received_events","type":"User","site_admin":false},"repo":{"id":92270507,"name":"GroceryStore","full_name":"OlenkaA/GroceryStore","owner":{"login":"OlenkaA","id":28622400,"avatar_url":"https://avatars1.githubusercontent.com/u/28622400?v=4","gravatar_id":"","url":"https://api.github.com/users/OlenkaA","html_url":"https://github.com/OlenkaA","followers_url":"https://api.github.com/users/OlenkaA/followers","following_url":"https://api.github.com/users/OlenkaA/following{/other_user}","gists_url":"https://api.github.com/users/OlenkaA/gists{/gist_id}","starred_url":"https://api.github.com/users/OlenkaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlenkaA/subscriptions","organizations_url":"https://api.github.com/users/OlenkaA/orgs","repos_url":"https://api.github.com/users/OlenkaA/repos","events_url":"https://api.github.com/users/OlenkaA/events{/privacy}","received_events_url":"https://api.github.com/users/OlenkaA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OlenkaA/GroceryStore","description":"Realization RESTfull CRUD for model of a grocery store.","fork":false,"url":"https://api.github.com/repos/OlenkaA/GroceryStore","forks_url":"https://api.github.com/repos/OlenkaA/GroceryStore/forks","keys_url":"https://api.github.com/repos/OlenkaA/GroceryStore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OlenkaA/GroceryStore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OlenkaA/GroceryStore/teams","hooks_url":"https://api.github.com/repos/OlenkaA/GroceryStore/hooks","issue_events_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/events{/number}","events_url":"https://api.github.com/repos/OlenkaA/GroceryStore/events","assignees_url":"https://api.github.com/repos/OlenkaA/GroceryStore/assignees{/user}","branches_url":"https://api.github.com/repos/OlenkaA/GroceryStore/branches{/branch}","tags_url":"https://api.github.com/repos/OlenkaA/GroceryStore/tags","blobs_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/refs{/sha}","trees_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OlenkaA/GroceryStore/statuses/{sha}","languages_url":"https://api.github.com/repos/OlenkaA/GroceryStore/languages","stargazers_url":"https://api.github.com/repos/OlenkaA/GroceryStore/stargazers","contributors_url":"https://api.github.com/repos/OlenkaA/GroceryStore/contributors","subscribers_url":"https://api.github.com/repos/OlenkaA/GroceryStore/subscribers","subscription_url":"https://api.github.com/repos/OlenkaA/GroceryStore/subscription","commits_url":"https://api.github.com/repos/OlenkaA/GroceryStore/commits{/sha}","git_commits_url":"https://api.github.com/repos/OlenkaA/GroceryStore/git/commits{/sha}","comments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/comments{/number}","issue_comment_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/comments{/number}","contents_url":"https://api.github.com/repos/OlenkaA/GroceryStore/contents/{+path}","compare_url":"https://api.github.com/repos/OlenkaA/GroceryStore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OlenkaA/GroceryStore/merges","archive_url":"https://api.github.com/repos/OlenkaA/GroceryStore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OlenkaA/GroceryStore/downloads","issues_url":"https://api.github.com/repos/OlenkaA/GroceryStore/issues{/number}","pulls_url":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls{/number}","milestones_url":"https://api.github.com/repos/OlenkaA/GroceryStore/milestones{/number}","notifications_url":"https://api.github.com/repos/OlenkaA/GroceryStore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OlenkaA/GroceryStore/labels{/name}","releases_url":"https://api.github.com/repos/OlenkaA/GroceryStore/releases{/id}","deployments_url":"https://api.github.com/repos/OlenkaA/GroceryStore/deployments","created_at":"2017-05-24T08:45:27Z","updated_at":"2017-07-18T14:37:26Z","pushed_at":"2017-07-19T09:19:23Z","git_url":"git://github.com/OlenkaA/GroceryStore.git","ssh_url":"git@github.com:OlenkaA/GroceryStore.git","clone_url":"https://github.com/OlenkaA/GroceryStore.git","svn_url":"https://github.com/OlenkaA/GroceryStore","homepage":"","size":26691,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35"},"html":{"href":"https://github.com/OlenkaA/GroceryStore/pull/35"},"issue":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/35"},"comments":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/OlenkaA/GroceryStore/statuses/6f42f08f90ed25ed7fd0ee6ab36accedf56875fe"}}}}
{"actor":{"display_login":"af150416"}}