1
2
3
4
5
6
7 package hu.elte.tribus.model;
8
9 import java.util.Date;
10 import java.util.Set;
11
12 import javax.persistence.Column;
13 import javax.persistence.Entity;
14 import javax.persistence.GeneratedValue;
15 import javax.persistence.Id;
16 import javax.persistence.JoinColumn;
17 import javax.persistence.ManyToOne;
18 import javax.persistence.OneToMany;
19 /***
20 * @author linux48
21 */
22 @Entity(name="conversation")
23 public class Conversation {
24 @Id
25 @GeneratedValue
26 private Integer id;
27
28 @ManyToOne
29 private User user;
30
31 @ManyToOne
32 private Topic topic;
33
34 @Column(nullable=false)
35 private Date startdate;
36 @Column
37 private Date enddate;
38 @OneToMany(targetEntity=Item.class)
39 @JoinColumn(name="conversation")
40 private Set<Item> items;
41
42
43 /***
44 * @return Returns the enddate.
45 */
46 public Date getEnddate() {
47 return enddate;
48 }
49 /***
50 * @param enddate The enddate to set.
51 */
52 public void setEnddate(Date enddate) {
53 this.enddate = enddate;
54 }
55 /***
56 * @return Returns the id.
57 */
58 public Integer getId() {
59 return id;
60 }
61 /***
62 * @param id The id to set.
63 */
64 public void setId(Integer id) {
65 this.id = id;
66 }
67 /***
68 * @return Returns the startdate.
69 */
70 public Date getStartdate() {
71 return startdate;
72 }
73 /***
74 * @param startdate The startdate to set.
75 */
76 public void setStartdate(Date startdate) {
77 this.startdate = startdate;
78 }
79 /***
80 * @return Returns the topic.
81 */
82 public Topic getTopic() {
83 return topic;
84 }
85 /***
86 * @param topic The topic to set.
87 */
88 public void setTopic(Topic topic) {
89 this.topic = topic;
90 }
91 /***
92 * @return Returns the user.
93 */
94 public User getUser() {
95 return user;
96 }
97 /***
98 * @param user The user to set.
99 */
100 public void setUser(User user) {
101 this.user = user;
102 }
103
104 public Set<Item> getItems() {
105 return items;
106 }
107 public void setItems(Set<Item> items) {
108 this.items = items;
109 }
110 }