{"action":"created","comment":{"url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/comments/37696622","id":37696622,"diff_hunk":"@@ -0,0 +1,59 @@\n+package org.levelup.labradoodle.repositories;\n+\n+\n+import org.levelup.labradoodle.models.entities.UsersPeople;\n+import org.springframework.stereotype.Repository;\n+import org.springframework.transaction.annotation.Transactional;\n+import javax.persistence.EntityManager;\n+import javax.persistence.PersistenceContext;\n+import java.util.List;\n+\n+/**\n+ * Created by RomanMosiienko on 18.08.15.\n+ */\n+@Repository\n+@Transactional\n+public class UserRepository implements IUserRepository {\n+\n+    @PersistenceContext\n+    private EntityManager entityManager;\n+\n+    @Override\n+    public UsersPeople getById(int id) {\n+        try {\n+            return (UsersPeople) entityManager.createNamedQuery(\"getById\").setParameter(\"id\", id).getSingleResult();\n+        } catch (Exception e) {\n+            e.printStackTrace();\n+            return null;\n+        }\n+\n+    }\n+\n+    @Override\n+    public List<UsersPeople> getAll() {\n+        return entityManager.createNamedQuery(\"getAll\").getResultList();\n+    }\n+\n+    @Override\n+    public List<UsersPeople> delete(int id) {\n+        try {\n+            return entityManager.createNamedQuery(\"deleteById\").setParameter(\"id\", id).getResultList();\n+        } catch (Exception e) {\n+            e.printStackTrace();\n+            return null;\n+        }\n+\n+    }\n+\n+    @Override\n+    public List<UsersPeople> add(UsersPeople admin) {\n+        String query = \"insert into users (email, pass) values (\\\"\"+ admin.getEmail()+\"\\\",\" +admin.getPass()+\");\";","path":"src/main/java/org/levelup/labradoodle/repositories/UserRepository.java","position":50,"original_position":50,"commit_id":"0a0c3cc007527e059856f8a570e8f1a290187fe4","original_commit_id":"0a0c3cc007527e059856f8a570e8f1a290187fe4","user":{"login":"TonySoprano","id":5079816,"avatar_url":"https://avatars.githubusercontent.com/u/5079816?v=3","gravatar_id":"","url":"https://api.github.com/users/TonySoprano","html_url":"https://github.com/TonySoprano","followers_url":"https://api.github.com/users/TonySoprano/followers","following_url":"https://api.github.com/users/TonySoprano/following{/other_user}","gists_url":"https://api.github.com/users/TonySoprano/gists{/gist_id}","starred_url":"https://api.github.com/users/TonySoprano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonySoprano/subscriptions","organizations_url":"https://api.github.com/users/TonySoprano/orgs","repos_url":"https://api.github.com/users/TonySoprano/repos","events_url":"https://api.github.com/users/TonySoprano/events{/privacy}","received_events_url":"https://api.github.com/users/TonySoprano/received_events","type":"User","site_admin":false},"body":"Try to find a way insert parameters to created query using prepared statements (or analogue)","created_at":"2015-08-22T15:24:57Z","updated_at":"2015-08-22T15:24:57Z","html_url":"https://github.com/TonySoprano/labradoodle/pull/18#discussion_r37696622","pull_request_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/comments/37696622"},"html":{"href":"https://github.com/TonySoprano/labradoodle/pull/18#discussion_r37696622"},"pull_request":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18","id":43099843,"html_url":"https://github.com/TonySoprano/labradoodle/pull/18","diff_url":"https://github.com/TonySoprano/labradoodle/pull/18.diff","patch_url":"https://github.com/TonySoprano/labradoodle/pull/18.patch","issue_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/18","number":18,"state":"open","locked":false,"title":"Created Repositories layer for entities  #4","user":{"login":"troian88","id":6154569,"avatar_url":"https://avatars.githubusercontent.com/u/6154569?v=3","gravatar_id":"","url":"https://api.github.com/users/troian88","html_url":"https://github.com/troian88","followers_url":"https://api.github.com/users/troian88/followers","following_url":"https://api.github.com/users/troian88/following{/other_user}","gists_url":"https://api.github.com/users/troian88/gists{/gist_id}","starred_url":"https://api.github.com/users/troian88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troian88/subscriptions","organizations_url":"https://api.github.com/users/troian88/orgs","repos_url":"https://api.github.com/users/troian88/repos","events_url":"https://api.github.com/users/troian88/events{/privacy}","received_events_url":"https://api.github.com/users/troian88/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-22T08:09:30Z","updated_at":"2015-08-22T15:24:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a50d034ee8922ccc1355ba7f43878d9ff2547520","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18/commits","review_comments_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18/comments","review_comment_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/18/comments","statuses_url":"https://api.github.com/repos/TonySoprano/labradoodle/statuses/0a0c3cc007527e059856f8a570e8f1a290187fe4","head":{"label":"TonySoprano:Repositories_layer_for_entites","ref":"Repositories_layer_for_entites","sha":"0a0c3cc007527e059856f8a570e8f1a290187fe4","user":{"login":"TonySoprano","id":5079816,"avatar_url":"https://avatars.githubusercontent.com/u/5079816?v=3","gravatar_id":"","url":"https://api.github.com/users/TonySoprano","html_url":"https://github.com/TonySoprano","followers_url":"https://api.github.com/users/TonySoprano/followers","following_url":"https://api.github.com/users/TonySoprano/following{/other_user}","gists_url":"https://api.github.com/users/TonySoprano/gists{/gist_id}","starred_url":"https://api.github.com/users/TonySoprano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonySoprano/subscriptions","organizations_url":"https://api.github.com/users/TonySoprano/orgs","repos_url":"https://api.github.com/users/TonySoprano/repos","events_url":"https://api.github.com/users/TonySoprano/events{/privacy}","received_events_url":"https://api.github.com/users/TonySoprano/received_events","type":"User","site_admin":false},"repo":{"id":39449085,"name":"labradoodle","full_name":"TonySoprano/labradoodle","owner":{"login":"TonySoprano","id":5079816,"avatar_url":"https://avatars.githubusercontent.com/u/5079816?v=3","gravatar_id":"","url":"https://api.github.com/users/TonySoprano","html_url":"https://github.com/TonySoprano","followers_url":"https://api.github.com/users/TonySoprano/followers","following_url":"https://api.github.com/users/TonySoprano/following{/other_user}","gists_url":"https://api.github.com/users/TonySoprano/gists{/gist_id}","starred_url":"https://api.github.com/users/TonySoprano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonySoprano/subscriptions","organizations_url":"https://api.github.com/users/TonySoprano/orgs","repos_url":"https://api.github.com/users/TonySoprano/repos","events_url":"https://api.github.com/users/TonySoprano/events{/privacy}","received_events_url":"https://api.github.com/users/TonySoprano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TonySoprano/labradoodle","description":"LevelUp 14 Common Web Project","fork":false,"url":"https://api.github.com/repos/TonySoprano/labradoodle","forks_url":"https://api.github.com/repos/TonySoprano/labradoodle/forks","keys_url":"https://api.github.com/repos/TonySoprano/labradoodle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TonySoprano/labradoodle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TonySoprano/labradoodle/teams","hooks_url":"https://api.github.com/repos/TonySoprano/labradoodle/hooks","issue_events_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/events{/number}","events_url":"https://api.github.com/repos/TonySoprano/labradoodle/events","assignees_url":"https://api.github.com/repos/TonySoprano/labradoodle/assignees{/user}","branches_url":"https://api.github.com/repos/TonySoprano/labradoodle/branches{/branch}","tags_url":"https://api.github.com/repos/TonySoprano/labradoodle/tags","blobs_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/refs{/sha}","trees_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TonySoprano/labradoodle/statuses/{sha}","languages_url":"https://api.github.com/repos/TonySoprano/labradoodle/languages","stargazers_url":"https://api.github.com/repos/TonySoprano/labradoodle/stargazers","contributors_url":"https://api.github.com/repos/TonySoprano/labradoodle/contributors","subscribers_url":"https://api.github.com/repos/TonySoprano/labradoodle/subscribers","subscription_url":"https://api.github.com/repos/TonySoprano/labradoodle/subscription","commits_url":"https://api.github.com/repos/TonySoprano/labradoodle/commits{/sha}","git_commits_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/commits{/sha}","comments_url":"https://api.github.com/repos/TonySoprano/labradoodle/comments{/number}","issue_comment_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/comments{/number}","contents_url":"https://api.github.com/repos/TonySoprano/labradoodle/contents/{+path}","compare_url":"https://api.github.com/repos/TonySoprano/labradoodle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TonySoprano/labradoodle/merges","archive_url":"https://api.github.com/repos/TonySoprano/labradoodle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TonySoprano/labradoodle/downloads","issues_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues{/number}","pulls_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls{/number}","milestones_url":"https://api.github.com/repos/TonySoprano/labradoodle/milestones{/number}","notifications_url":"https://api.github.com/repos/TonySoprano/labradoodle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TonySoprano/labradoodle/labels{/name}","releases_url":"https://api.github.com/repos/TonySoprano/labradoodle/releases{/id}","created_at":"2015-07-21T14:08:49Z","updated_at":"2015-08-16T12:24:10Z","pushed_at":"2015-08-22T08:09:30Z","git_url":"git://github.com/TonySoprano/labradoodle.git","ssh_url":"git@github.com:TonySoprano/labradoodle.git","clone_url":"https://github.com/TonySoprano/labradoodle.git","svn_url":"https://github.com/TonySoprano/labradoodle","homepage":null,"size":940,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"TonySoprano:master","ref":"master","sha":"66695c7a3e1ace70050f114dbe563ea8648dbdf6","user":{"login":"TonySoprano","id":5079816,"avatar_url":"https://avatars.githubusercontent.com/u/5079816?v=3","gravatar_id":"","url":"https://api.github.com/users/TonySoprano","html_url":"https://github.com/TonySoprano","followers_url":"https://api.github.com/users/TonySoprano/followers","following_url":"https://api.github.com/users/TonySoprano/following{/other_user}","gists_url":"https://api.github.com/users/TonySoprano/gists{/gist_id}","starred_url":"https://api.github.com/users/TonySoprano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonySoprano/subscriptions","organizations_url":"https://api.github.com/users/TonySoprano/orgs","repos_url":"https://api.github.com/users/TonySoprano/repos","events_url":"https://api.github.com/users/TonySoprano/events{/privacy}","received_events_url":"https://api.github.com/users/TonySoprano/received_events","type":"User","site_admin":false},"repo":{"id":39449085,"name":"labradoodle","full_name":"TonySoprano/labradoodle","owner":{"login":"TonySoprano","id":5079816,"avatar_url":"https://avatars.githubusercontent.com/u/5079816?v=3","gravatar_id":"","url":"https://api.github.com/users/TonySoprano","html_url":"https://github.com/TonySoprano","followers_url":"https://api.github.com/users/TonySoprano/followers","following_url":"https://api.github.com/users/TonySoprano/following{/other_user}","gists_url":"https://api.github.com/users/TonySoprano/gists{/gist_id}","starred_url":"https://api.github.com/users/TonySoprano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonySoprano/subscriptions","organizations_url":"https://api.github.com/users/TonySoprano/orgs","repos_url":"https://api.github.com/users/TonySoprano/repos","events_url":"https://api.github.com/users/TonySoprano/events{/privacy}","received_events_url":"https://api.github.com/users/TonySoprano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TonySoprano/labradoodle","description":"LevelUp 14 Common Web Project","fork":false,"url":"https://api.github.com/repos/TonySoprano/labradoodle","forks_url":"https://api.github.com/repos/TonySoprano/labradoodle/forks","keys_url":"https://api.github.com/repos/TonySoprano/labradoodle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TonySoprano/labradoodle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TonySoprano/labradoodle/teams","hooks_url":"https://api.github.com/repos/TonySoprano/labradoodle/hooks","issue_events_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/events{/number}","events_url":"https://api.github.com/repos/TonySoprano/labradoodle/events","assignees_url":"https://api.github.com/repos/TonySoprano/labradoodle/assignees{/user}","branches_url":"https://api.github.com/repos/TonySoprano/labradoodle/branches{/branch}","tags_url":"https://api.github.com/repos/TonySoprano/labradoodle/tags","blobs_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/refs{/sha}","trees_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TonySoprano/labradoodle/statuses/{sha}","languages_url":"https://api.github.com/repos/TonySoprano/labradoodle/languages","stargazers_url":"https://api.github.com/repos/TonySoprano/labradoodle/stargazers","contributors_url":"https://api.github.com/repos/TonySoprano/labradoodle/contributors","subscribers_url":"https://api.github.com/repos/TonySoprano/labradoodle/subscribers","subscription_url":"https://api.github.com/repos/TonySoprano/labradoodle/subscription","commits_url":"https://api.github.com/repos/TonySoprano/labradoodle/commits{/sha}","git_commits_url":"https://api.github.com/repos/TonySoprano/labradoodle/git/commits{/sha}","comments_url":"https://api.github.com/repos/TonySoprano/labradoodle/comments{/number}","issue_comment_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues/comments{/number}","contents_url":"https://api.github.com/repos/TonySoprano/labradoodle/contents/{+path}","compare_url":"https://api.github.com/repos/TonySoprano/labradoodle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TonySoprano/labradoodle/merges","archive_url":"https://api.github.com/repos/TonySoprano/labradoodle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TonySoprano/labradoodle/downloads","issues_url":"https://api.github.com/repos/TonySoprano/labradoodle/issues{/number}","pulls_url":"https://api.github.com/repos/TonySoprano/labradoodle/pulls{/number}","milestones_url":"https://api.github.com/repos/TonySoprano/labradoodle/milestones{/number}","notifications_url":"https://api.github.com/repos/TonySoprano/labradoodle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TonySoprano/labradoodle/labels{/name}","releases_url":"https://api.github.com/repos/TonySoprano/labradoodle/releases{/id}","created_at":"2015-07-21T14:08:49Z","updated_at":"2015-08-16T12:24:10Z","pushed_at":"2015-08-22T08:09:30Z","git_url":"git://github.com/TonySoprano/labradoodle.git","ssh_url":"git@github.com:TonySoprano/labradoodle.git","clone_url":"https://github.com/TonySoprano/labradoodle.git","svn_url":"https://github.com/TonySoprano/labradoodle","homepage":null,"size":940,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18"},"html":{"href":"https://github.com/TonySoprano/labradoodle/pull/18"},"issue":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/issues/18"},"comments":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/TonySoprano/labradoodle/statuses/0a0c3cc007527e059856f8a570e8f1a290187fe4"}}}}