1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.imca.model.entities;
17
18 import java.util.Collection;
19 import javax.persistence.Entity;
20 import javax.persistence.GeneratedValue;
21 import javax.persistence.GenerationType;
22 import javax.persistence.Id;
23 import javax.persistence.NamedQueries;
24 import javax.persistence.NamedQuery;
25 import javax.persistence.OneToMany;
26 import javax.persistence.ManyToMany;
27
28
29
30
31
32
33
34
35 @Entity
36 @NamedQueries( {
37 @NamedQuery(name = "EventBasicSearch",
38 query = "SELECT o FROM EventEntity o WHERE o.name LIKE :search")
39 })
40 public class EventEntity {
41
42
43
44
45 @Id
46 @GeneratedValue(strategy=GenerationType.TABLE)
47 private long id;
48
49 @ManyToMany
50 private Collection<SailingClubEntity> sailingClub;
51
52 private String name = "";
53
54 private String location = "";
55
56 @OneToMany
57 private Collection<EventEntryEntity> entries;
58
59 public Collection<EventEntryEntity> getEntries() {
60 return entries;
61 }
62
63 public void setEntries(Collection<EventEntryEntity> entries) {
64 this.entries = entries;
65 }
66
67 public long getId() {
68 return id;
69 }
70
71 public void setId(long id) {
72 this.id = id;
73 }
74
75 public String getLocation() {
76 return location;
77 }
78
79 public void setLocation(String location) {
80 this.location = location;
81 }
82
83 public Collection<SailingClubEntity> getSailingClub() {
84 return sailingClub;
85 }
86
87 public void setSailingClub(Collection<SailingClubEntity> sailingClub) {
88 this.sailingClub = sailingClub;
89 }
90
91 public String getName() {
92 return name;
93 }
94
95 public void setName(String name) {
96 this.name = name;
97 }
98
99
100
101
102
103 public String toString(){
104 return name;
105 }
106
107 }