{"action":"created","comment":{"url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/comments/24928944","id":24928944,"diff_hunk":"@@ -0,0 +1,108 @@\n+package ru.hhschool.earlvik.JDBCHibernateHW.Clients;\n+\n+import ru.hhschool.earlvik.JDBCHibernateHW.Taxis.TaxiId;\n+\n+import javax.persistence.*;\n+import java.util.Date;\n+\n+/**\n+ * Created by Earlviktor on 21.01.2015.\n+ */\n+\n+@Entity\n+@Table(name = \"clients\")\n+public class Client {\n+\n+    @Id\n+    @GeneratedValue(strategy = GenerationType.IDENTITY)\n+    @Column(name=\"client_id\")\n+    private Integer id;\n+\n+    @Column(name = \"first_name\")\n+    private String firstName;\n+\n+    @Column(name = \"last_name\")\n+    private String lastName;\n+\n+    @Column(name = \"creation_time\", nullable = false, updatable = false)\n+    @Temporal(TemporalType.TIMESTAMP)\n+    private Date creationDate;\n+    /**\n+     * Id of taxi called for this client\n+     */\n+    @Column(name = \"car_id\")\n+    private Integer carId;\n+\n+\n+\n+\n+    public Client(final String firstName, final String lastName, TaxiId carId) {\n+        this.firstName = firstName;\n+        this.lastName = lastName;\n+        this.creationDate = new Date();\n+        this.carId = (carId == null)?null:carId.getValue();\n+    }\n+\n+    @Deprecated\n+    Client() {}\n+\n+    public Integer getCarId() {\n+        return carId;\n+    }\n+\n+    public void setCarId(Integer carId) {\n+        this.carId = carId;\n+    }\n+\n+    public String getFirstName() {\n+        return firstName;\n+    }\n+\n+    public void setFirstName(String firstName) {\n+        this.firstName = firstName;\n+    }\n+\n+    public String getLastName() {\n+        return lastName;\n+    }\n+\n+    public void setLastName(String lastName) {\n+        this.lastName = lastName;\n+    }\n+\n+    public Integer getId() {\n+        return id;\n+    }\n+\n+    public Date getCreationDate() {\n+        return creationDate;\n+    }\n+\n+    @Override\n+    public boolean equals(final Object that) {\n+        if (this == that) return true;\n+        if (that == null || getClass() != that.getClass()) return false;\n+\n+        final Client thatClient = (Client) that;\n+        if (firstName != null ? !firstName.equals(thatClient.firstName) : thatClient.firstName != null) return false;\n+        if (id != null ? !id.equals(thatClient.id) : thatClient.id != null) return false;\n+        if (lastName != null ? !lastName.equals(thatClient.lastName) : thatClient.lastName != null) return false;","path":"src/main/java/ru/hhschool/earlvik/JDBCHibernateHW/Clients/Client.java","position":89,"original_position":89,"commit_id":"30fcd2865e9cab19118b4fab9b539776248fbcdc","original_commit_id":"30fcd2865e9cab19118b4fab9b539776248fbcdc","user":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"body":"Я подумал, что это поле по идее наиболее часто меняющееся и наименее\r\nотносящееся к самом у клиенту, поэтому в проверке на равенство один и тот\r\nже клиент с разными carId всё равно должен быть равен сам себе.\r\n\r\n2015-02-18 21:51 GMT+03:00 Anton Ivanov <notifications@github.com>:\r\n\r\n> In src/main/java/ru/hhschool/earlvik/JDBCHibernateHW/Clients/Client.java\r\n> <https://github.com/Earlvik/JDBCHibernateHW/pull/1#discussion_r24928553>:\r\n>\r\n> > +        return id;\r\n> > +    }\r\n> > +\r\n> > +    public Date getCreationDate() {\r\n> > +        return creationDate;\r\n> > +    }\r\n> > +\r\n> > +    @Override\r\n> > +    public boolean equals(final Object that) {\r\n> > +        if (this == that) return true;\r\n> > +        if (that == null || getClass() != that.getClass()) return false;\r\n> > +\r\n> > +        final Client thatClient = (Client) that;\r\n> > +        if (firstName != null ? !firstName.equals(thatClient.firstName) : thatClient.firstName != null) return false;\r\n> > +        if (id != null ? !id.equals(thatClient.id) : thatClient.id != null) return false;\r\n> > +        if (lastName != null ? !lastName.equals(thatClient.lastName) : thatClient.lastName != null) return false;\r\n>\r\n> А carId почему не включил в equals?\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/Earlvik/JDBCHibernateHW/pull/1/files#r24928553>.\r\n>\r\n","created_at":"2015-02-18T18:54:55Z","updated_at":"2015-02-18T18:54:55Z","html_url":"https://github.com/Earlvik/JDBCHibernateHW/pull/1#discussion_r24928944","pull_request_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/comments/24928944"},"html":{"href":"https://github.com/Earlvik/JDBCHibernateHW/pull/1#discussion_r24928944"},"pull_request":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1","id":28299216,"html_url":"https://github.com/Earlvik/JDBCHibernateHW/pull/1","diff_url":"https://github.com/Earlvik/JDBCHibernateHW/pull/1.diff","patch_url":"https://github.com/Earlvik/JDBCHibernateHW/pull/1.patch","issue_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/1","number":1,"state":"open","locked":false,"title":"Checking","user":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"body":"Pull request for comfortable code review and homework checking","created_at":"2015-01-29T17:44:20Z","updated_at":"2015-02-18T18:54:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9f9b937496713380c124a43ec3c34167b2acd03","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/1/comments","statuses_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/statuses/30fcd2865e9cab19118b4fab9b539776248fbcdc","head":{"label":"Earlvik:master","ref":"master","sha":"30fcd2865e9cab19118b4fab9b539776248fbcdc","user":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"repo":{"id":30032646,"name":"JDBCHibernateHW","full_name":"Earlvik/JDBCHibernateHW","owner":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Earlvik/JDBCHibernateHW","description":"","fork":false,"url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW","forks_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/forks","keys_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/teams","hooks_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/hooks","issue_events_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/events{/number}","events_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/events","assignees_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/assignees{/user}","branches_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/branches{/branch}","tags_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/tags","blobs_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/refs{/sha}","trees_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/statuses/{sha}","languages_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/languages","stargazers_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/stargazers","contributors_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/contributors","subscribers_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/subscribers","subscription_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/subscription","commits_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/commits{/sha}","git_commits_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/commits{/sha}","comments_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/comments{/number}","issue_comment_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/comments/{number}","contents_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/contents/{+path}","compare_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/merges","archive_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/downloads","issues_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues{/number}","pulls_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls{/number}","milestones_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/milestones{/number}","notifications_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/labels{/name}","releases_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/releases{/id}","created_at":"2015-01-29T17:40:10Z","updated_at":"2015-01-29T17:42:56Z","pushed_at":"2015-01-29T17:42:56Z","git_url":"git://github.com/Earlvik/JDBCHibernateHW.git","ssh_url":"git@github.com:Earlvik/JDBCHibernateHW.git","clone_url":"https://github.com/Earlvik/JDBCHibernateHW.git","svn_url":"https://github.com/Earlvik/JDBCHibernateHW","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"Earlvik:forPull","ref":"forPull","sha":"a1df66209706127e38d0979b0622a4deff2a932a","user":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"repo":{"id":30032646,"name":"JDBCHibernateHW","full_name":"Earlvik/JDBCHibernateHW","owner":{"login":"Earlvik","id":1942256,"avatar_url":"https://avatars.githubusercontent.com/u/1942256?v=3","gravatar_id":"","url":"https://api.github.com/users/Earlvik","html_url":"https://github.com/Earlvik","followers_url":"https://api.github.com/users/Earlvik/followers","following_url":"https://api.github.com/users/Earlvik/following{/other_user}","gists_url":"https://api.github.com/users/Earlvik/gists{/gist_id}","starred_url":"https://api.github.com/users/Earlvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Earlvik/subscriptions","organizations_url":"https://api.github.com/users/Earlvik/orgs","repos_url":"https://api.github.com/users/Earlvik/repos","events_url":"https://api.github.com/users/Earlvik/events{/privacy}","received_events_url":"https://api.github.com/users/Earlvik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Earlvik/JDBCHibernateHW","description":"","fork":false,"url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW","forks_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/forks","keys_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/teams","hooks_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/hooks","issue_events_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/events{/number}","events_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/events","assignees_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/assignees{/user}","branches_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/branches{/branch}","tags_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/tags","blobs_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/refs{/sha}","trees_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/statuses/{sha}","languages_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/languages","stargazers_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/stargazers","contributors_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/contributors","subscribers_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/subscribers","subscription_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/subscription","commits_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/commits{/sha}","git_commits_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/git/commits{/sha}","comments_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/comments{/number}","issue_comment_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/comments/{number}","contents_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/contents/{+path}","compare_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/merges","archive_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/downloads","issues_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues{/number}","pulls_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls{/number}","milestones_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/milestones{/number}","notifications_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/labels{/name}","releases_url":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/releases{/id}","created_at":"2015-01-29T17:40:10Z","updated_at":"2015-01-29T17:42:56Z","pushed_at":"2015-01-29T17:42:56Z","git_url":"git://github.com/Earlvik/JDBCHibernateHW.git","ssh_url":"git@github.com:Earlvik/JDBCHibernateHW.git","clone_url":"https://github.com/Earlvik/JDBCHibernateHW.git","svn_url":"https://github.com/Earlvik/JDBCHibernateHW","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Java","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/Earlvik/JDBCHibernateHW/pulls/1"},"html":{"href":"https://github.com/Earlvik/JDBCHibernateHW/pull/1"},"issue":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/1"},"comments":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Earlvik/JDBCHibernateHW/statuses/30fcd2865e9cab19118b4fab9b539776248fbcdc"}}}}