{"action":"created","comment":{"url":"https://api.github.com/repos/Katerina207/JD2/pulls/comments/230589085","pull_request_review_id":171362784,"id":230589085,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDU4OTA4NQ==","diff_hunk":"@@ -1,68 +1,38 @@\n package dao;\r\n \r\n-import entity.Option;\r\n-import entity.Unit;\r\n-import enumeratiom.BoilingPoint;\r\n-import enumeratiom.UnitRange;\r\n-import exception.DaoException;\r\n import lombok.AccessLevel;\r\n+import lombok.Cleanup;\r\n import lombok.NoArgsConstructor;\r\n-import lombok.NonNull;\r\n-import util.ConnectionPool;\r\n+import model.Unit;\r\n+import org.hibernate.Session;\r\n+import org.hibernate.SessionFactory;\r\n+import org.hibernate.cfg.Configuration;\r\n \r\n-import java.sql.Connection;\r\n-import java.sql.PreparedStatement;\r\n-import java.sql.ResultSet;\r\n-import java.sql.SQLException;\r\n-import java.util.ArrayList;\r\n import java.util.List;\r\n \r\n @NoArgsConstructor(access = AccessLevel.PRIVATE)\r\n public class UnitDao {\r\n \r\n     private static final UnitDao INSTANCE = new UnitDao();\r\n \r\n-    private static final String GET_ALL = \"SELECT id, name, range, boiling_point, ref_capacity, \" +\r\n-            \"weight, length, width, height, price \" +\r\n-            \"FROM ref_storage.unit\";\r\n-\r\n     public static UnitDao getInstance() {\r\n         return INSTANCE;\r\n     }\r\n \r\n     public List<Unit> getAll() {\r\n-        List<Unit> units = new ArrayList<>();\r\n-        try (Connection connection = ConnectionPool.getConnection();\r\n-             PreparedStatement preparedStatement = connection.prepareStatement(GET_ALL)) {\r\n-            ResultSet resultSet = preparedStatement.executeQuery();\r\n-            while (resultSet.next()) {\r\n-                Unit unit = getUnitFromResultSet(resultSet);\r\n-                unit.setOptionList(getOptionList(unit));\r\n-                units.add(unit);\r\n-            }\r\n-        } catch (SQLException e) {\r\n-            throw new DaoException(e);\r\n+        List<Unit> list;\r\n+        @Cleanup\r","path":"database/src/main/java/dao/UnitDao.java","position":51,"original_position":51,"commit_id":"2571c554c2f35d0209ddfceea812bc6d15678312","original_commit_id":"2571c554c2f35d0209ddfceea812bc6d15678312","user":{"login":"DzianisMatveyenka","id":19999031,"node_id":"MDQ6VXNlcjE5OTk5MDMx","avatar_url":"https://avatars2.githubusercontent.com/u/19999031?v=4","gravatar_id":"","url":"https://api.github.com/users/DzianisMatveyenka","html_url":"https://github.com/DzianisMatveyenka","followers_url":"https://api.github.com/users/DzianisMatveyenka/followers","following_url":"https://api.github.com/users/DzianisMatveyenka/following{/other_user}","gists_url":"https://api.github.com/users/DzianisMatveyenka/gists{/gist_id}","starred_url":"https://api.github.com/users/DzianisMatveyenka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DzianisMatveyenka/subscriptions","organizations_url":"https://api.github.com/users/DzianisMatveyenka/orgs","repos_url":"https://api.github.com/users/DzianisMatveyenka/repos","events_url":"https://api.github.com/users/DzianisMatveyenka/events{/privacy}","received_events_url":"https://api.github.com/users/DzianisMatveyenka/received_events","type":"User","site_admin":false},"body":"эту аннотацию принято использовать на одной строчке с локальной переменной, к которой она относится","created_at":"2018-11-04T13:31:50Z","updated_at":"2018-11-04T13:38:10Z","html_url":"https://github.com/Katerina207/JD2/pull/1#discussion_r230589085","pull_request_url":"https://api.github.com/repos/Katerina207/JD2/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Katerina207/JD2/pulls/comments/230589085"},"html":{"href":"https://github.com/Katerina207/JD2/pull/1#discussion_r230589085"},"pull_request":{"href":"https://api.github.com/repos/Katerina207/JD2/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Katerina207/JD2/pulls/1","id":228168810,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTY4ODEw","html_url":"https://github.com/Katerina207/JD2/pull/1","diff_url":"https://github.com/Katerina207/JD2/pull/1.diff","patch_url":"https://github.com/Katerina207/JD2/pull/1.patch","issue_url":"https://api.github.com/repos/Katerina207/JD2/issues/1","number":1,"state":"open","locked":false,"title":"commit_2","user":{"login":"Katerina207","id":41114962,"node_id":"MDQ6VXNlcjQxMTE0OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/41114962?v=4","gravatar_id":"","url":"https://api.github.com/users/Katerina207","html_url":"https://github.com/Katerina207","followers_url":"https://api.github.com/users/Katerina207/followers","following_url":"https://api.github.com/users/Katerina207/following{/other_user}","gists_url":"https://api.github.com/users/Katerina207/gists{/gist_id}","starred_url":"https://api.github.com/users/Katerina207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katerina207/subscriptions","organizations_url":"https://api.github.com/users/Katerina207/orgs","repos_url":"https://api.github.com/users/Katerina207/repos","events_url":"https://api.github.com/users/Katerina207/events{/privacy}","received_events_url":"https://api.github.com/users/Katerina207/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Katerina207 <ekaterina.sokol.20@yandex.by>","created_at":"2018-11-04T10:32:11Z","updated_at":"2018-11-04T13:38:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0794089eb81b647b5f172d0c29c82bf9db21613","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Katerina207/JD2/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Katerina207/JD2/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Katerina207/JD2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Katerina207/JD2/issues/1/comments","statuses_url":"https://api.github.com/repos/Katerina207/JD2/statuses/2571c554c2f35d0209ddfceea812bc6d15678312","head":{"label":"Katerina207:dev","ref":"dev","sha":"2571c554c2f35d0209ddfceea812bc6d15678312","user":{"login":"Katerina207","id":41114962,"node_id":"MDQ6VXNlcjQxMTE0OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/41114962?v=4","gravatar_id":"","url":"https://api.github.com/users/Katerina207","html_url":"https://github.com/Katerina207","followers_url":"https://api.github.com/users/Katerina207/followers","following_url":"https://api.github.com/users/Katerina207/following{/other_user}","gists_url":"https://api.github.com/users/Katerina207/gists{/gist_id}","starred_url":"https://api.github.com/users/Katerina207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katerina207/subscriptions","organizations_url":"https://api.github.com/users/Katerina207/orgs","repos_url":"https://api.github.com/users/Katerina207/repos","events_url":"https://api.github.com/users/Katerina207/events{/privacy}","received_events_url":"https://api.github.com/users/Katerina207/received_events","type":"User","site_admin":false},"repo":{"id":153651264,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM2NTEyNjQ=","name":"JD2","full_name":"Katerina207/JD2","private":false,"owner":{"login":"Katerina207","id":41114962,"node_id":"MDQ6VXNlcjQxMTE0OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/41114962?v=4","gravatar_id":"","url":"https://api.github.com/users/Katerina207","html_url":"https://github.com/Katerina207","followers_url":"https://api.github.com/users/Katerina207/followers","following_url":"https://api.github.com/users/Katerina207/following{/other_user}","gists_url":"https://api.github.com/users/Katerina207/gists{/gist_id}","starred_url":"https://api.github.com/users/Katerina207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katerina207/subscriptions","organizations_url":"https://api.github.com/users/Katerina207/orgs","repos_url":"https://api.github.com/users/Katerina207/repos","events_url":"https://api.github.com/users/Katerina207/events{/privacy}","received_events_url":"https://api.github.com/users/Katerina207/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Katerina207/JD2","description":null,"fork":false,"url":"https://api.github.com/repos/Katerina207/JD2","forks_url":"https://api.github.com/repos/Katerina207/JD2/forks","keys_url":"https://api.github.com/repos/Katerina207/JD2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Katerina207/JD2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Katerina207/JD2/teams","hooks_url":"https://api.github.com/repos/Katerina207/JD2/hooks","issue_events_url":"https://api.github.com/repos/Katerina207/JD2/issues/events{/number}","events_url":"https://api.github.com/repos/Katerina207/JD2/events","assignees_url":"https://api.github.com/repos/Katerina207/JD2/assignees{/user}","branches_url":"https://api.github.com/repos/Katerina207/JD2/branches{/branch}","tags_url":"https://api.github.com/repos/Katerina207/JD2/tags","blobs_url":"https://api.github.com/repos/Katerina207/JD2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Katerina207/JD2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Katerina207/JD2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Katerina207/JD2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Katerina207/JD2/statuses/{sha}","languages_url":"https://api.github.com/repos/Katerina207/JD2/languages","stargazers_url":"https://api.github.com/repos/Katerina207/JD2/stargazers","contributors_url":"https://api.github.com/repos/Katerina207/JD2/contributors","subscribers_url":"https://api.github.com/repos/Katerina207/JD2/subscribers","subscription_url":"https://api.github.com/repos/Katerina207/JD2/subscription","commits_url":"https://api.github.com/repos/Katerina207/JD2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Katerina207/JD2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Katerina207/JD2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Katerina207/JD2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Katerina207/JD2/contents/{+path}","compare_url":"https://api.github.com/repos/Katerina207/JD2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Katerina207/JD2/merges","archive_url":"https://api.github.com/repos/Katerina207/JD2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Katerina207/JD2/downloads","issues_url":"https://api.github.com/repos/Katerina207/JD2/issues{/number}","pulls_url":"https://api.github.com/repos/Katerina207/JD2/pulls{/number}","milestones_url":"https://api.github.com/repos/Katerina207/JD2/milestones{/number}","notifications_url":"https://api.github.com/repos/Katerina207/JD2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Katerina207/JD2/labels{/name}","releases_url":"https://api.github.com/repos/Katerina207/JD2/releases{/id}","deployments_url":"https://api.github.com/repos/Katerina207/JD2/deployments","created_at":"2018-10-18T16:03:28Z","updated_at":"2018-10-18T17:41:39Z","pushed_at":"2018-11-04T10:32:12Z","git_url":"git://github.com/Katerina207/JD2.git","ssh_url":"git@github.com:Katerina207/JD2.git","clone_url":"https://github.com/Katerina207/JD2.git","svn_url":"https://github.com/Katerina207/JD2","homepage":null,"size":19,"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,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Katerina207:master","ref":"master","sha":"1c6c770504b425c2d6c5730b07221c6e361fbb92","user":{"login":"Katerina207","id":41114962,"node_id":"MDQ6VXNlcjQxMTE0OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/41114962?v=4","gravatar_id":"","url":"https://api.github.com/users/Katerina207","html_url":"https://github.com/Katerina207","followers_url":"https://api.github.com/users/Katerina207/followers","following_url":"https://api.github.com/users/Katerina207/following{/other_user}","gists_url":"https://api.github.com/users/Katerina207/gists{/gist_id}","starred_url":"https://api.github.com/users/Katerina207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katerina207/subscriptions","organizations_url":"https://api.github.com/users/Katerina207/orgs","repos_url":"https://api.github.com/users/Katerina207/repos","events_url":"https://api.github.com/users/Katerina207/events{/privacy}","received_events_url":"https://api.github.com/users/Katerina207/received_events","type":"User","site_admin":false},"repo":{"id":153651264,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM2NTEyNjQ=","name":"JD2","full_name":"Katerina207/JD2","private":false,"owner":{"login":"Katerina207","id":41114962,"node_id":"MDQ6VXNlcjQxMTE0OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/41114962?v=4","gravatar_id":"","url":"https://api.github.com/users/Katerina207","html_url":"https://github.com/Katerina207","followers_url":"https://api.github.com/users/Katerina207/followers","following_url":"https://api.github.com/users/Katerina207/following{/other_user}","gists_url":"https://api.github.com/users/Katerina207/gists{/gist_id}","starred_url":"https://api.github.com/users/Katerina207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katerina207/subscriptions","organizations_url":"https://api.github.com/users/Katerina207/orgs","repos_url":"https://api.github.com/users/Katerina207/repos","events_url":"https://api.github.com/users/Katerina207/events{/privacy}","received_events_url":"https://api.github.com/users/Katerina207/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Katerina207/JD2","description":null,"fork":false,"url":"https://api.github.com/repos/Katerina207/JD2","forks_url":"https://api.github.com/repos/Katerina207/JD2/forks","keys_url":"https://api.github.com/repos/Katerina207/JD2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Katerina207/JD2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Katerina207/JD2/teams","hooks_url":"https://api.github.com/repos/Katerina207/JD2/hooks","issue_events_url":"https://api.github.com/repos/Katerina207/JD2/issues/events{/number}","events_url":"https://api.github.com/repos/Katerina207/JD2/events","assignees_url":"https://api.github.com/repos/Katerina207/JD2/assignees{/user}","branches_url":"https://api.github.com/repos/Katerina207/JD2/branches{/branch}","tags_url":"https://api.github.com/repos/Katerina207/JD2/tags","blobs_url":"https://api.github.com/repos/Katerina207/JD2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Katerina207/JD2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Katerina207/JD2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Katerina207/JD2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Katerina207/JD2/statuses/{sha}","languages_url":"https://api.github.com/repos/Katerina207/JD2/languages","stargazers_url":"https://api.github.com/repos/Katerina207/JD2/stargazers","contributors_url":"https://api.github.com/repos/Katerina207/JD2/contributors","subscribers_url":"https://api.github.com/repos/Katerina207/JD2/subscribers","subscription_url":"https://api.github.com/repos/Katerina207/JD2/subscription","commits_url":"https://api.github.com/repos/Katerina207/JD2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Katerina207/JD2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Katerina207/JD2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Katerina207/JD2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Katerina207/JD2/contents/{+path}","compare_url":"https://api.github.com/repos/Katerina207/JD2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Katerina207/JD2/merges","archive_url":"https://api.github.com/repos/Katerina207/JD2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Katerina207/JD2/downloads","issues_url":"https://api.github.com/repos/Katerina207/JD2/issues{/number}","pulls_url":"https://api.github.com/repos/Katerina207/JD2/pulls{/number}","milestones_url":"https://api.github.com/repos/Katerina207/JD2/milestones{/number}","notifications_url":"https://api.github.com/repos/Katerina207/JD2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Katerina207/JD2/labels{/name}","releases_url":"https://api.github.com/repos/Katerina207/JD2/releases{/id}","deployments_url":"https://api.github.com/repos/Katerina207/JD2/deployments","created_at":"2018-10-18T16:03:28Z","updated_at":"2018-10-18T17:41:39Z","pushed_at":"2018-11-04T10:32:12Z","git_url":"git://github.com/Katerina207/JD2.git","ssh_url":"git@github.com:Katerina207/JD2.git","clone_url":"https://github.com/Katerina207/JD2.git","svn_url":"https://github.com/Katerina207/JD2","homepage":null,"size":19,"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,"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/Katerina207/JD2/pulls/1"},"html":{"href":"https://github.com/Katerina207/JD2/pull/1"},"issue":{"href":"https://api.github.com/repos/Katerina207/JD2/issues/1"},"comments":{"href":"https://api.github.com/repos/Katerina207/JD2/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Katerina207/JD2/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Katerina207/JD2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Katerina207/JD2/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Katerina207/JD2/statuses/2571c554c2f35d0209ddfceea812bc6d15678312"}},"author_association":"OWNER"}}
{"actor":{"display_login":"DzianisMatveyenka"}}