source: Git/src/main/java/com/wediscussmovies/project/model/RepliesEntityPK.java@ 2d57cad

main
Last change on this file since 2d57cad was 2d57cad, checked in by Test <matonikolov77@…>, 2 years ago

Initial model part

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.wediscussmovies.project.model;
2
3import javax.persistence.Column;
4import javax.persistence.GeneratedValue;
5import javax.persistence.GenerationType;
6import javax.persistence.Id;
7import java.io.Serializable;
8
9public class RepliesEntityPK implements Serializable {
10 @Column(name = "discussion_id")
11 @Id
12 private int discussionId;
13 @Column(name = "reply_id")
14 @Id
15 @GeneratedValue(strategy = GenerationType.IDENTITY)
16 private int replyId;
17
18 public int getDiscussionId() {
19 return discussionId;
20 }
21
22 public void setDiscussionId(int discussionId) {
23 this.discussionId = discussionId;
24 }
25
26 public int getReplyId() {
27 return replyId;
28 }
29
30 public void setReplyId(int replyId) {
31 this.replyId = replyId;
32 }
33
34 @Override
35 public boolean equals(Object o) {
36 if (this == o) return true;
37 if (o == null || getClass() != o.getClass()) return false;
38
39 RepliesEntityPK that = (RepliesEntityPK) o;
40
41 if (discussionId != that.discussionId) return false;
42 if (replyId != that.replyId) return false;
43
44 return true;
45 }
46
47 @Override
48 public int hashCode() {
49 int result = discussionId;
50 result = 31 * result + replyId;
51 return result;
52 }
53}
Note: See TracBrowser for help on using the repository browser.