1
2
3
4
5
6
7 package hu.elte.tribus.model;
8
9 import java.util.HashSet;
10 import java.util.Set;
11
12 import javax.persistence.Column;
13 import javax.persistence.Entity;
14 import javax.persistence.FetchType;
15 import javax.persistence.GeneratedValue;
16 import javax.persistence.Id;
17 import javax.persistence.ManyToMany;
18
19 /***
20 * @author linux48
21 *
22 * TODO To change the template for this generated type comment go to
23 * Window - Preferences - Java - Code Style - Code Templates
24 */
25 @Entity(name="topic")
26 public class Topic {
27 @Id
28 @GeneratedValue
29 @Column(name="id")
30 private Integer id;
31
32 @Column
33 private String name;
34 @Column(name="dscr")
35 private String desc;
36 @ManyToMany(targetEntity=Tag.class, fetch=FetchType.LAZY)
37 private Set<Tag> tags = new HashSet<Tag>();
38
39
40 public Topic() {}
41 /***
42 * @return Returns the desc.
43 */
44 public String getDesc() {
45 return desc;
46 }
47 /***
48 * @param desc The desc to set.
49 */
50 public void setDesc(String desc) {
51 this.desc = desc;
52 }
53 /***
54 * @return Returns the id.
55 */
56 public Integer getId() {
57 return id;
58 }
59 /***
60 * @param id The id to set.
61 */
62 public void setId(Integer id) {
63 this.id = id;
64 }
65 /***
66 * @return Returns the name.
67 */
68 public String getName() {
69 return name;
70 }
71 /***
72 * @param name The name to set.
73 */
74 public void setName(String name) {
75 this.name = name;
76 }
77 public Set<Tag> getTags() {
78 return tags;
79 }
80 public void setTags(Set<Tag> tags) {
81 this.tags = tags;
82 }
83
84 }