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.ManyToOne;
27
28
29
30
31
32
33
34
35 @Entity
36 @NamedQueries ({
37 @NamedQuery(name = "BoatVersionSearch",
38 query = "SELECT o FROM BoatVersionEntity o WHERE o.id LIKE :search"),
39 @NamedQuery(name = "BoatVersionBasicSearch",
40 query = "SELECT o FROM BoatVersionEntity o WHERE o.description LIKE :search")
41 })
42 public class BoatVersionEntity {
43
44
45
46
47 @Id
48 @GeneratedValue(strategy=GenerationType.TABLE)
49 private long id;
50
51
52
53
54 private String description = "";
55
56 @ManyToOne
57 private BoatEntity boat;
58
59 @OneToMany
60 private Collection<SailEntity> sails;
61
62 @OneToMany
63 private Collection<FoilEntity> foils;
64
65 @OneToMany
66 private Collection<MastEntity> masts;
67
68 public BoatEntity getBoat() {
69 return boat;
70 }
71
72 public void setBoat(BoatEntity boat) {
73 this.boat = boat;
74 }
75
76 public long getId() {
77 return id;
78 }
79
80 public void setId(long id) {
81 this.id = id;
82 }
83
84 public Collection<FoilEntity> getFoils() {
85 return foils;
86 }
87
88 public void setFoils(Collection<FoilEntity> foils) {
89 this.foils = foils;
90 }
91
92 public Collection<MastEntity> getMasts() {
93 return masts;
94 }
95
96 public void setMasts(Collection<MastEntity> masts) {
97 this.masts = masts;
98 }
99
100 public Collection<SailEntity> getSails() {
101 return sails;
102 }
103
104 public void setSails(Collection<SailEntity> sails) {
105 this.sails = sails;
106 }
107
108
109
110
111
112 public String toString(){
113 return id + "";
114 }
115
116 public String getDescription() {
117 return description;
118 }
119
120 public void setDescription(String description) {
121 this.description = description;
122 }
123
124 }