{"action":"created","comment":{"url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/comments/38772010","id":38772010,"diff_hunk":"@@ -0,0 +1,35 @@\n+package pl.home.services;\n+\n+import pl.home.entities.Client;\n+\n+import javax.ejb.Stateless;\n+import javax.persistence.EntityManager;\n+import javax.persistence.PersistenceContext;\n+import javax.persistence.Query;\n+import java.util.List;\n+\n+@Stateless\n+public class ClientService {\n+\n+    @PersistenceContext(name = \"app\")\n+    EntityManager entityManager;\n+\n+    public List<Client> getAll() {\n+        Query query = entityManager.createQuery(\"SELECT c from Client c\");\n+        return (List<Client>) query.getResultList();\n+    }\n+\n+    public void add(Client client) {\n+        entityManager.persist(client);\n+    }\n+\n+    public Client find(Long id) {\n+        Query query =  entityManager.createQuery(\"Select c from Client c where c.id = :id\");\n+        query.setParameter(\"id\", id);\n+        return (Client) query.getSingleResult();","path":"src/main/java/pl/home/services/ClientService.java","position":29,"original_position":29,"commit_id":"97feb5a78dbc6a0c4fafde652231f67348f56c7d","original_commit_id":"97feb5a78dbc6a0c4fafde652231f67348f56c7d","user":{"login":"mkrosnicki","id":11858116,"avatar_url":"https://avatars.githubusercontent.com/u/11858116?v=3","gravatar_id":"","url":"https://api.github.com/users/mkrosnicki","html_url":"https://github.com/mkrosnicki","followers_url":"https://api.github.com/users/mkrosnicki/followers","following_url":"https://api.github.com/users/mkrosnicki/following{/other_user}","gists_url":"https://api.github.com/users/mkrosnicki/gists{/gist_id}","starred_url":"https://api.github.com/users/mkrosnicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkrosnicki/subscriptions","organizations_url":"https://api.github.com/users/mkrosnicki/orgs","repos_url":"https://api.github.com/users/mkrosnicki/repos","events_url":"https://api.github.com/users/mkrosnicki/events{/privacy}","received_events_url":"https://api.github.com/users/mkrosnicki/received_events","type":"User","site_admin":false},"body":"być można zastosować TypedQuery?","created_at":"2015-09-04T17:00:37Z","updated_at":"2015-09-04T17:00:37Z","html_url":"https://github.com/alexandder/SimpleWebApp/pull/1#discussion_r38772010","pull_request_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/comments/38772010"},"html":{"href":"https://github.com/alexandder/SimpleWebApp/pull/1#discussion_r38772010"},"pull_request":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1","id":42060390,"html_url":"https://github.com/alexandder/SimpleWebApp/pull/1","diff_url":"https://github.com/alexandder/SimpleWebApp/pull/1.diff","patch_url":"https://github.com/alexandder/SimpleWebApp/pull/1.patch","issue_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/1","number":1,"state":"open","locked":false,"title":"Swa1","user":{"login":"alexandder","id":2956138,"avatar_url":"https://avatars.githubusercontent.com/u/2956138?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandder","html_url":"https://github.com/alexandder","followers_url":"https://api.github.com/users/alexandder/followers","following_url":"https://api.github.com/users/alexandder/following{/other_user}","gists_url":"https://api.github.com/users/alexandder/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandder/subscriptions","organizations_url":"https://api.github.com/users/alexandder/orgs","repos_url":"https://api.github.com/users/alexandder/repos","events_url":"https://api.github.com/users/alexandder/events{/privacy}","received_events_url":"https://api.github.com/users/alexandder/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-10T20:09:12Z","updated_at":"2015-09-04T17:00:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5a191f518ce1be1023f2dd6b9f4676736607aa8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/1/comments","statuses_url":"https://api.github.com/repos/alexandder/SimpleWebApp/statuses/97feb5a78dbc6a0c4fafde652231f67348f56c7d","head":{"label":"alexandder:SWA1","ref":"SWA1","sha":"97feb5a78dbc6a0c4fafde652231f67348f56c7d","user":{"login":"alexandder","id":2956138,"avatar_url":"https://avatars.githubusercontent.com/u/2956138?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandder","html_url":"https://github.com/alexandder","followers_url":"https://api.github.com/users/alexandder/followers","following_url":"https://api.github.com/users/alexandder/following{/other_user}","gists_url":"https://api.github.com/users/alexandder/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandder/subscriptions","organizations_url":"https://api.github.com/users/alexandder/orgs","repos_url":"https://api.github.com/users/alexandder/repos","events_url":"https://api.github.com/users/alexandder/events{/privacy}","received_events_url":"https://api.github.com/users/alexandder/received_events","type":"User","site_admin":false},"repo":{"id":40259942,"name":"SimpleWebApp","full_name":"alexandder/SimpleWebApp","owner":{"login":"alexandder","id":2956138,"avatar_url":"https://avatars.githubusercontent.com/u/2956138?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandder","html_url":"https://github.com/alexandder","followers_url":"https://api.github.com/users/alexandder/followers","following_url":"https://api.github.com/users/alexandder/following{/other_user}","gists_url":"https://api.github.com/users/alexandder/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandder/subscriptions","organizations_url":"https://api.github.com/users/alexandder/orgs","repos_url":"https://api.github.com/users/alexandder/repos","events_url":"https://api.github.com/users/alexandder/events{/privacy}","received_events_url":"https://api.github.com/users/alexandder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexandder/SimpleWebApp","description":"","fork":false,"url":"https://api.github.com/repos/alexandder/SimpleWebApp","forks_url":"https://api.github.com/repos/alexandder/SimpleWebApp/forks","keys_url":"https://api.github.com/repos/alexandder/SimpleWebApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexandder/SimpleWebApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexandder/SimpleWebApp/teams","hooks_url":"https://api.github.com/repos/alexandder/SimpleWebApp/hooks","issue_events_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/events{/number}","events_url":"https://api.github.com/repos/alexandder/SimpleWebApp/events","assignees_url":"https://api.github.com/repos/alexandder/SimpleWebApp/assignees{/user}","branches_url":"https://api.github.com/repos/alexandder/SimpleWebApp/branches{/branch}","tags_url":"https://api.github.com/repos/alexandder/SimpleWebApp/tags","blobs_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexandder/SimpleWebApp/statuses/{sha}","languages_url":"https://api.github.com/repos/alexandder/SimpleWebApp/languages","stargazers_url":"https://api.github.com/repos/alexandder/SimpleWebApp/stargazers","contributors_url":"https://api.github.com/repos/alexandder/SimpleWebApp/contributors","subscribers_url":"https://api.github.com/repos/alexandder/SimpleWebApp/subscribers","subscription_url":"https://api.github.com/repos/alexandder/SimpleWebApp/subscription","commits_url":"https://api.github.com/repos/alexandder/SimpleWebApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexandder/SimpleWebApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexandder/SimpleWebApp/contents/{+path}","compare_url":"https://api.github.com/repos/alexandder/SimpleWebApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexandder/SimpleWebApp/merges","archive_url":"https://api.github.com/repos/alexandder/SimpleWebApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexandder/SimpleWebApp/downloads","issues_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues{/number}","pulls_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls{/number}","milestones_url":"https://api.github.com/repos/alexandder/SimpleWebApp/milestones{/number}","notifications_url":"https://api.github.com/repos/alexandder/SimpleWebApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexandder/SimpleWebApp/labels{/name}","releases_url":"https://api.github.com/repos/alexandder/SimpleWebApp/releases{/id}","created_at":"2015-08-05T17:44:52Z","updated_at":"2015-08-05T17:51:56Z","pushed_at":"2015-08-10T20:09:12Z","git_url":"git://github.com/alexandder/SimpleWebApp.git","ssh_url":"git@github.com:alexandder/SimpleWebApp.git","clone_url":"https://github.com/alexandder/SimpleWebApp.git","svn_url":"https://github.com/alexandder/SimpleWebApp","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alexandder:master","ref":"master","sha":"457ffc9187e007aea9ce7ad0cd292aca5fcff5c6","user":{"login":"alexandder","id":2956138,"avatar_url":"https://avatars.githubusercontent.com/u/2956138?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandder","html_url":"https://github.com/alexandder","followers_url":"https://api.github.com/users/alexandder/followers","following_url":"https://api.github.com/users/alexandder/following{/other_user}","gists_url":"https://api.github.com/users/alexandder/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandder/subscriptions","organizations_url":"https://api.github.com/users/alexandder/orgs","repos_url":"https://api.github.com/users/alexandder/repos","events_url":"https://api.github.com/users/alexandder/events{/privacy}","received_events_url":"https://api.github.com/users/alexandder/received_events","type":"User","site_admin":false},"repo":{"id":40259942,"name":"SimpleWebApp","full_name":"alexandder/SimpleWebApp","owner":{"login":"alexandder","id":2956138,"avatar_url":"https://avatars.githubusercontent.com/u/2956138?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandder","html_url":"https://github.com/alexandder","followers_url":"https://api.github.com/users/alexandder/followers","following_url":"https://api.github.com/users/alexandder/following{/other_user}","gists_url":"https://api.github.com/users/alexandder/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandder/subscriptions","organizations_url":"https://api.github.com/users/alexandder/orgs","repos_url":"https://api.github.com/users/alexandder/repos","events_url":"https://api.github.com/users/alexandder/events{/privacy}","received_events_url":"https://api.github.com/users/alexandder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexandder/SimpleWebApp","description":"","fork":false,"url":"https://api.github.com/repos/alexandder/SimpleWebApp","forks_url":"https://api.github.com/repos/alexandder/SimpleWebApp/forks","keys_url":"https://api.github.com/repos/alexandder/SimpleWebApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexandder/SimpleWebApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexandder/SimpleWebApp/teams","hooks_url":"https://api.github.com/repos/alexandder/SimpleWebApp/hooks","issue_events_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/events{/number}","events_url":"https://api.github.com/repos/alexandder/SimpleWebApp/events","assignees_url":"https://api.github.com/repos/alexandder/SimpleWebApp/assignees{/user}","branches_url":"https://api.github.com/repos/alexandder/SimpleWebApp/branches{/branch}","tags_url":"https://api.github.com/repos/alexandder/SimpleWebApp/tags","blobs_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexandder/SimpleWebApp/statuses/{sha}","languages_url":"https://api.github.com/repos/alexandder/SimpleWebApp/languages","stargazers_url":"https://api.github.com/repos/alexandder/SimpleWebApp/stargazers","contributors_url":"https://api.github.com/repos/alexandder/SimpleWebApp/contributors","subscribers_url":"https://api.github.com/repos/alexandder/SimpleWebApp/subscribers","subscription_url":"https://api.github.com/repos/alexandder/SimpleWebApp/subscription","commits_url":"https://api.github.com/repos/alexandder/SimpleWebApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexandder/SimpleWebApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexandder/SimpleWebApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexandder/SimpleWebApp/contents/{+path}","compare_url":"https://api.github.com/repos/alexandder/SimpleWebApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexandder/SimpleWebApp/merges","archive_url":"https://api.github.com/repos/alexandder/SimpleWebApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexandder/SimpleWebApp/downloads","issues_url":"https://api.github.com/repos/alexandder/SimpleWebApp/issues{/number}","pulls_url":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls{/number}","milestones_url":"https://api.github.com/repos/alexandder/SimpleWebApp/milestones{/number}","notifications_url":"https://api.github.com/repos/alexandder/SimpleWebApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexandder/SimpleWebApp/labels{/name}","releases_url":"https://api.github.com/repos/alexandder/SimpleWebApp/releases{/id}","created_at":"2015-08-05T17:44:52Z","updated_at":"2015-08-05T17:51:56Z","pushed_at":"2015-08-10T20:09:12Z","git_url":"git://github.com/alexandder/SimpleWebApp.git","ssh_url":"git@github.com:alexandder/SimpleWebApp.git","clone_url":"https://github.com/alexandder/SimpleWebApp.git","svn_url":"https://github.com/alexandder/SimpleWebApp","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1"},"html":{"href":"https://github.com/alexandder/SimpleWebApp/pull/1"},"issue":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/1"},"comments":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/alexandder/SimpleWebApp/statuses/97feb5a78dbc6a0c4fafde652231f67348f56c7d"}}}}