|
@@ -1,52 +1,52 @@
|
1
|
|
-//package ZipTeamOrange.model;
|
2
|
|
-//
|
3
|
|
-//import ZipTeamOrange.model.Message;
|
4
|
|
-//import ZipTeamOrange.model.User;
|
5
|
|
-//import javax.persistence.*;
|
6
|
|
-//import java.util.Set;
|
7
|
|
-//
|
8
|
|
-//@Entity
|
9
|
|
-//public class Chat {
|
10
|
|
-//
|
11
|
|
-// @Id
|
12
|
|
-// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
13
|
|
-// private Long id;
|
14
|
|
-// private String name;
|
15
|
|
-//
|
16
|
|
-// @OneToMany(mappedBy = "chat")
|
17
|
|
-// private Set<Message> messages;
|
18
|
|
-//
|
19
|
|
-// @ManyToMany(mappedBy = "chat")
|
20
|
|
-// private Set<User> users;
|
21
|
|
-//
|
22
|
|
-// public Chat(String name, Set<User> users) {
|
23
|
|
-// this.name = name;
|
24
|
|
-// this.users = users;
|
25
|
|
-// }
|
26
|
|
-//
|
27
|
|
-// public Chat(){}
|
28
|
|
-//
|
29
|
|
-// public Long getId() {
|
30
|
|
-// return id;
|
31
|
|
-// }
|
32
|
|
-//
|
33
|
|
-// public void setId(Long id) {
|
34
|
|
-// this.id = id;
|
35
|
|
-// }
|
36
|
|
-//
|
37
|
|
-// public String getName() {
|
38
|
|
-// return name;
|
39
|
|
-// }
|
40
|
|
-//
|
41
|
|
-// public void setName(String name) {
|
42
|
|
-// this.name = name;
|
43
|
|
-// }
|
44
|
|
-//
|
45
|
|
-// public Set<User> getUsers() {
|
46
|
|
-// return users;
|
47
|
|
-// }
|
48
|
|
-//
|
49
|
|
-// public void setUsers(Set<User> users) {
|
50
|
|
-// this.users = users;
|
51
|
|
-// }
|
52
|
|
-//}
|
|
1
|
+package ZipTeamOrange.model;
|
|
2
|
+
|
|
3
|
+import ZipTeamOrange.model.Message;
|
|
4
|
+import ZipTeamOrange.model.User;
|
|
5
|
+import javax.persistence.*;
|
|
6
|
+import java.util.Set;
|
|
7
|
+
|
|
8
|
+@Entity
|
|
9
|
+public class Chat {
|
|
10
|
+
|
|
11
|
+ @Id
|
|
12
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
13
|
+ private Long id;
|
|
14
|
+ private String name;
|
|
15
|
+
|
|
16
|
+ @OneToMany(mappedBy = "chat")
|
|
17
|
+ private Set<Message> messages;
|
|
18
|
+
|
|
19
|
+ @ManyToMany(mappedBy = "chat")
|
|
20
|
+ private Set<User> users;
|
|
21
|
+
|
|
22
|
+ public Chat(String name, Set<User> users) {
|
|
23
|
+ this.name = name;
|
|
24
|
+ this.users = users;
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ public Chat(){}
|
|
28
|
+
|
|
29
|
+ public Long getId() {
|
|
30
|
+ return id;
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+ public void setId(Long id) {
|
|
34
|
+ this.id = id;
|
|
35
|
+ }
|
|
36
|
+
|
|
37
|
+ public String getName() {
|
|
38
|
+ return name;
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ public void setName(String name) {
|
|
42
|
+ this.name = name;
|
|
43
|
+ }
|
|
44
|
+
|
|
45
|
+ public Set<User> getUsers() {
|
|
46
|
+ return users;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ public void setUsers(Set<User> users) {
|
|
50
|
+ this.users = users;
|
|
51
|
+ }
|
|
52
|
+}
|