{"action":"created","comment":{"url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/comments/186412122","pull_request_review_id":117983290,"id":186412122,"diff_hunk":"@@ -1,74 +1,89 @@\n package models;\n \n-import com.fasterxml.jackson.databind.annotation.JsonSerialize;\n-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;\n-import org.bson.types.ObjectId;\n+import com.fasterxml.jackson.annotation.JsonBackReference;\n \n+import javax.persistence.*;\n import java.util.Objects;\n \n+@Entity(name = \"AnchorPosition\")\n+@Table(name = \"anchorposition\")\n public class AnchorPosition {\n-    @JsonSerialize(using = ToStringSerializer.class)\n-    private ObjectId anchorId;\n-    private String name;\n+    @Id @GeneratedValue @Column(name=\"id\")\n+    private long anchorId;\n     private double xPosition;\n     private double yPosition;\n     private double zPosition;\n \n-    public ObjectId getAnchorId() {\n-        return anchorId;\n-    }\n+    @ManyToOne\n+    @JoinColumn(name = \"measurementId\")\n+    @JsonBackReference\n+    private Measurement measurement;\n \n-    public void setAnchorId(ObjectId anchorId) {\n-        this.anchorId = anchorId;\n-    }\n+    @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)\n+    @JoinColumn(name = \"anchorid\")\n+    private Anchor anchor;\n \n-    public String getName() {\n-        return name;\n+    public long getAnchorId() {\n+        return anchorId;\n     }\n \n-    public void setName(String name) {\n-        this.name = name;\n+    public void setAnchorId(final long anchorId) {\n+        this.anchorId = anchorId;\n     }\n \n     public double getXPosition() {\n         return xPosition;\n     }\n \n-    public void setXPosition(double xPosition) {\n+    public void setXPosition(final double xPosition) {\n         this.xPosition = xPosition;\n     }\n \n     public double getYPosition() {\n         return yPosition;\n     }\n \n-    public void setYPosition(double yPosition) {\n+    public void setYPosition(final double yPosition) {\n         this.yPosition = yPosition;\n     }\n \n     public double getZPosition() {\n         return zPosition;\n     }\n \n-    public void setZPosition(double zPosition) {\n+    public void setZPosition(final double zPosition) {\n         this.zPosition = zPosition;\n     }\n \n+    public Measurement getMeasurement() {\n+        return measurement;\n+    }\n+\n+    public void setMeasurement(Measurement measurement) {\n+        this.measurement = measurement;\n+    }\n+\n+    public Anchor getAnchor() {\n+        return anchor;\n+    }\n+\n+    public void setAnchor(Anchor anchor) {\n+        this.anchor = anchor;\n+    }\n+\n     @Override\n     public boolean equals(Object o) {\n         if (this == o) return true;\n         if (o == null || getClass() != o.getClass()) return false;\n         AnchorPosition that = (AnchorPosition) o;\n         return Double.compare(that.xPosition, xPosition) == 0 &&\n                 Double.compare(that.yPosition, yPosition) == 0 &&\n-                Double.compare(that.zPosition, zPosition) == 0 &&\n-                Objects.equals(getAnchorId(), that.getAnchorId()) &&\n-                Objects.equals(getName(), that.getName());\n+                Double.compare(that.zPosition, zPosition) == 0;\n     }\n \n     @Override\n     public int hashCode() {\n \n-        return Objects.hash(getAnchorId(), getName(), xPosition, yPosition, zPosition);","path":"app/models/AnchorPosition.java","position":111,"original_position":109,"commit_id":"9e5d9110f1da55d9ff31b473fe3ec958294523b0","original_commit_id":"b257a3758846bde27af239f99e9e14984c887311","user":{"login":"eluchsinger","id":12324017,"avatar_url":"https://avatars0.githubusercontent.com/u/12324017?v=4","gravatar_id":"","url":"https://api.github.com/users/eluchsinger","html_url":"https://github.com/eluchsinger","followers_url":"https://api.github.com/users/eluchsinger/followers","following_url":"https://api.github.com/users/eluchsinger/following{/other_user}","gists_url":"https://api.github.com/users/eluchsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/eluchsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eluchsinger/subscriptions","organizations_url":"https://api.github.com/users/eluchsinger/orgs","repos_url":"https://api.github.com/users/eluchsinger/repos","events_url":"https://api.github.com/users/eluchsinger/events{/privacy}","received_events_url":"https://api.github.com/users/eluchsinger/received_events","type":"User","site_admin":false},"body":"Because anchors have no name according to the database schema and `AnchorId` does not belong into the hashCode.","created_at":"2018-05-07T12:47:31Z","updated_at":"2018-05-07T12:47:31Z","html_url":"https://github.com/Flux-Coordinator/flux-server/pull/18#discussion_r186412122","pull_request_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/comments/186412122"},"html":{"href":"https://github.com/Flux-Coordinator/flux-server/pull/18#discussion_r186412122"},"pull_request":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18"}},"in_reply_to_id":186304147},"pull_request":{"url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18","id":186171575,"html_url":"https://github.com/Flux-Coordinator/flux-server/pull/18","diff_url":"https://github.com/Flux-Coordinator/flux-server/pull/18.diff","patch_url":"https://github.com/Flux-Coordinator/flux-server/pull/18.patch","issue_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/18","number":18,"state":"open","locked":false,"title":"Migration to Postgres","user":{"login":"eluchsinger","id":12324017,"avatar_url":"https://avatars0.githubusercontent.com/u/12324017?v=4","gravatar_id":"","url":"https://api.github.com/users/eluchsinger","html_url":"https://github.com/eluchsinger","followers_url":"https://api.github.com/users/eluchsinger/followers","following_url":"https://api.github.com/users/eluchsinger/following{/other_user}","gists_url":"https://api.github.com/users/eluchsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/eluchsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eluchsinger/subscriptions","organizations_url":"https://api.github.com/users/eluchsinger/orgs","repos_url":"https://api.github.com/users/eluchsinger/repos","events_url":"https://api.github.com/users/eluchsinger/events{/privacy}","received_events_url":"https://api.github.com/users/eluchsinger/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-05T19:14:32Z","updated_at":"2018-05-07T12:47:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b1fa155955f4bcec326da97c4fdfc3a7d74763d","assignee":{"login":"eluchsinger","id":12324017,"avatar_url":"https://avatars0.githubusercontent.com/u/12324017?v=4","gravatar_id":"","url":"https://api.github.com/users/eluchsinger","html_url":"https://github.com/eluchsinger","followers_url":"https://api.github.com/users/eluchsinger/followers","following_url":"https://api.github.com/users/eluchsinger/following{/other_user}","gists_url":"https://api.github.com/users/eluchsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/eluchsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eluchsinger/subscriptions","organizations_url":"https://api.github.com/users/eluchsinger/orgs","repos_url":"https://api.github.com/users/eluchsinger/repos","events_url":"https://api.github.com/users/eluchsinger/events{/privacy}","received_events_url":"https://api.github.com/users/eluchsinger/received_events","type":"User","site_admin":false},"assignees":[{"login":"eluchsinger","id":12324017,"avatar_url":"https://avatars0.githubusercontent.com/u/12324017?v=4","gravatar_id":"","url":"https://api.github.com/users/eluchsinger","html_url":"https://github.com/eluchsinger","followers_url":"https://api.github.com/users/eluchsinger/followers","following_url":"https://api.github.com/users/eluchsinger/following{/other_user}","gists_url":"https://api.github.com/users/eluchsinger/gists{/gist_id}","starred_url":"https://api.github.com/users/eluchsinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eluchsinger/subscriptions","organizations_url":"https://api.github.com/users/eluchsinger/orgs","repos_url":"https://api.github.com/users/eluchsinger/repos","events_url":"https://api.github.com/users/eluchsinger/events{/privacy}","received_events_url":"https://api.github.com/users/eluchsinger/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18/commits","review_comments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18/comments","review_comment_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/18/comments","statuses_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/statuses/9e5d9110f1da55d9ff31b473fe3ec958294523b0","head":{"label":"Flux-Coordinator:feature/postgres","ref":"feature/postgres","sha":"9e5d9110f1da55d9ff31b473fe3ec958294523b0","user":{"login":"Flux-Coordinator","id":36757275,"avatar_url":"https://avatars1.githubusercontent.com/u/36757275?v=4","gravatar_id":"","url":"https://api.github.com/users/Flux-Coordinator","html_url":"https://github.com/Flux-Coordinator","followers_url":"https://api.github.com/users/Flux-Coordinator/followers","following_url":"https://api.github.com/users/Flux-Coordinator/following{/other_user}","gists_url":"https://api.github.com/users/Flux-Coordinator/gists{/gist_id}","starred_url":"https://api.github.com/users/Flux-Coordinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flux-Coordinator/subscriptions","organizations_url":"https://api.github.com/users/Flux-Coordinator/orgs","repos_url":"https://api.github.com/users/Flux-Coordinator/repos","events_url":"https://api.github.com/users/Flux-Coordinator/events{/privacy}","received_events_url":"https://api.github.com/users/Flux-Coordinator/received_events","type":"Organization","site_admin":false},"repo":{"id":124896896,"name":"flux-server","full_name":"Flux-Coordinator/flux-server","owner":{"login":"Flux-Coordinator","id":36757275,"avatar_url":"https://avatars1.githubusercontent.com/u/36757275?v=4","gravatar_id":"","url":"https://api.github.com/users/Flux-Coordinator","html_url":"https://github.com/Flux-Coordinator","followers_url":"https://api.github.com/users/Flux-Coordinator/followers","following_url":"https://api.github.com/users/Flux-Coordinator/following{/other_user}","gists_url":"https://api.github.com/users/Flux-Coordinator/gists{/gist_id}","starred_url":"https://api.github.com/users/Flux-Coordinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flux-Coordinator/subscriptions","organizations_url":"https://api.github.com/users/Flux-Coordinator/orgs","repos_url":"https://api.github.com/users/Flux-Coordinator/repos","events_url":"https://api.github.com/users/Flux-Coordinator/events{/privacy}","received_events_url":"https://api.github.com/users/Flux-Coordinator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flux-Coordinator/flux-server","description":null,"fork":false,"url":"https://api.github.com/repos/Flux-Coordinator/flux-server","forks_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/forks","keys_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/teams","hooks_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/hooks","issue_events_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/events{/number}","events_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/events","assignees_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/assignees{/user}","branches_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/branches{/branch}","tags_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/tags","blobs_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/languages","stargazers_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/stargazers","contributors_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/contributors","subscribers_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/subscribers","subscription_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/subscription","commits_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/contents/{+path}","compare_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/merges","archive_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/downloads","issues_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues{/number}","pulls_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/labels{/name}","releases_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/releases{/id}","deployments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/deployments","created_at":"2018-03-12T13:54:19Z","updated_at":"2018-04-15T12:28:42Z","pushed_at":"2018-05-07T12:42:20Z","git_url":"git://github.com/Flux-Coordinator/flux-server.git","ssh_url":"git@github.com:Flux-Coordinator/flux-server.git","clone_url":"https://github.com/Flux-Coordinator/flux-server.git","svn_url":"https://github.com/Flux-Coordinator/flux-server","homepage":null,"size":273,"stargazers_count":1,"watchers_count":1,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Flux-Coordinator:develop","ref":"develop","sha":"8fa51306e8a2dcf0b550f3ef725826dc78d6d26a","user":{"login":"Flux-Coordinator","id":36757275,"avatar_url":"https://avatars1.githubusercontent.com/u/36757275?v=4","gravatar_id":"","url":"https://api.github.com/users/Flux-Coordinator","html_url":"https://github.com/Flux-Coordinator","followers_url":"https://api.github.com/users/Flux-Coordinator/followers","following_url":"https://api.github.com/users/Flux-Coordinator/following{/other_user}","gists_url":"https://api.github.com/users/Flux-Coordinator/gists{/gist_id}","starred_url":"https://api.github.com/users/Flux-Coordinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flux-Coordinator/subscriptions","organizations_url":"https://api.github.com/users/Flux-Coordinator/orgs","repos_url":"https://api.github.com/users/Flux-Coordinator/repos","events_url":"https://api.github.com/users/Flux-Coordinator/events{/privacy}","received_events_url":"https://api.github.com/users/Flux-Coordinator/received_events","type":"Organization","site_admin":false},"repo":{"id":124896896,"name":"flux-server","full_name":"Flux-Coordinator/flux-server","owner":{"login":"Flux-Coordinator","id":36757275,"avatar_url":"https://avatars1.githubusercontent.com/u/36757275?v=4","gravatar_id":"","url":"https://api.github.com/users/Flux-Coordinator","html_url":"https://github.com/Flux-Coordinator","followers_url":"https://api.github.com/users/Flux-Coordinator/followers","following_url":"https://api.github.com/users/Flux-Coordinator/following{/other_user}","gists_url":"https://api.github.com/users/Flux-Coordinator/gists{/gist_id}","starred_url":"https://api.github.com/users/Flux-Coordinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flux-Coordinator/subscriptions","organizations_url":"https://api.github.com/users/Flux-Coordinator/orgs","repos_url":"https://api.github.com/users/Flux-Coordinator/repos","events_url":"https://api.github.com/users/Flux-Coordinator/events{/privacy}","received_events_url":"https://api.github.com/users/Flux-Coordinator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flux-Coordinator/flux-server","description":null,"fork":false,"url":"https://api.github.com/repos/Flux-Coordinator/flux-server","forks_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/forks","keys_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/teams","hooks_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/hooks","issue_events_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/events{/number}","events_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/events","assignees_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/assignees{/user}","branches_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/branches{/branch}","tags_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/tags","blobs_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/languages","stargazers_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/stargazers","contributors_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/contributors","subscribers_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/subscribers","subscription_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/subscription","commits_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/contents/{+path}","compare_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/merges","archive_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/downloads","issues_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues{/number}","pulls_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/labels{/name}","releases_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/releases{/id}","deployments_url":"https://api.github.com/repos/Flux-Coordinator/flux-server/deployments","created_at":"2018-03-12T13:54:19Z","updated_at":"2018-04-15T12:28:42Z","pushed_at":"2018-05-07T12:42:20Z","git_url":"git://github.com/Flux-Coordinator/flux-server.git","ssh_url":"git@github.com:Flux-Coordinator/flux-server.git","clone_url":"https://github.com/Flux-Coordinator/flux-server.git","svn_url":"https://github.com/Flux-Coordinator/flux-server","homepage":null,"size":273,"stargazers_count":1,"watchers_count":1,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18"},"html":{"href":"https://github.com/Flux-Coordinator/flux-server/pull/18"},"issue":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/18"},"comments":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/Flux-Coordinator/flux-server/statuses/9e5d9110f1da55d9ff31b473fe3ec958294523b0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"eluchsinger"}}