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.Date;
19
20 import javax.persistence.Entity;
21 import javax.persistence.GeneratedValue;
22 import javax.persistence.GenerationType;
23 import javax.persistence.Id;
24 import javax.persistence.NamedQueries;
25 import javax.persistence.NamedQuery;
26 import javax.persistence.OneToOne;
27
28
29
30
31
32
33
34
35 @Entity
36 @NamedQueries( {
37 @NamedQuery(name = "SailBasicSearch",
38 query="SELECT o FROM SailEntity o WHERE " +
39 "o.description = :search")
40 })
41 public class SailEntity {
42
43
44
45
46 @Id
47 @GeneratedValue(strategy=GenerationType.TABLE)
48 private long id;
49
50
51
52
53 private String type = "";
54
55
56
57
58 private String description = "";
59
60 @OneToOne
61 private EquipmentSupplierEntity sailmaker;
62
63 @OneToOne
64 private PersonEntity measurer;
65
66 private Date measuredDate;
67
68 public long getId() {
69 return id;
70 }
71
72 public void setId(long id) {
73 this.id = id;
74 }
75
76 public PersonEntity getMeasurer() {
77 return measurer;
78 }
79
80 public void setMeasurer(PersonEntity measurer) {
81 this.measurer = measurer;
82 }
83
84 public EquipmentSupplierEntity getSailmaker() {
85 return sailmaker;
86 }
87
88 public void setSailmaker(EquipmentSupplierEntity sailmaker) {
89 this.sailmaker = sailmaker;
90 }
91
92 public Date getMeasuredDate() {
93 return measuredDate;
94 }
95
96 public void setMeasuredDate(Date measuredDate) {
97 this.measuredDate = measuredDate;
98 }
99
100 public String getType() {
101 return type;
102 }
103
104 public void setType(String type) {
105 this.type = type;
106 }
107
108 public String getDescription() {
109 return description;
110 }
111
112 public void setDescription(String description) {
113 this.description = description;
114 }
115
116
117
118
119
120 public String toString(){
121 StringBuffer buf = new StringBuffer();
122 buf.append(sailmaker.toString());
123 if (type.length() > 0) {
124 buf.append(" " + type);
125 }
126 buf.append(" (" + id + ")");
127 return buf.toString();
128 }
129 }