-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathCommentEntity.java
More file actions
76 lines (59 loc) · 1.34 KB
/
CommentEntity.java
File metadata and controls
76 lines (59 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.example.demo.End.project.ENTITY;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
@Entity
public class CommentEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
int commentid;
String comment;
public String getComment() {
return comment;
}
public CommentEntity(String comment, VideoEntity ve, UserEntity ue) {
super();
this.comment = comment;
this.ve = ve;
this.ue = ue;
}
public void setComment(String comment) {
this.comment = comment;
}
@ManyToOne
@JoinColumn(referencedColumnName = "videoid")
private VideoEntity ve;
@ManyToOne
@JoinColumn(referencedColumnName = "userid")
private UserEntity ue;
public int getCommentid() {
return commentid;
}
public void setCommentid(int commentid) {
this.commentid = commentid;
}
public VideoEntity getVe() {
return ve;
}
public void setVe(VideoEntity ve) {
this.ve = ve;
}
public UserEntity getUe() {
return ue;
}
public void setUe(UserEntity ue) {
this.ue = ue;
}
//public CommentEntity(VideoEntity ve, UserEntity ue) {
// super();
// this.ve = ve;
// this.ue = ue;
//}
public CommentEntity() {
super();
// TODO Auto-generated constructor stub
}
}