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 javax.persistence.Entity;
19 import javax.persistence.GeneratedValue;
20 import javax.persistence.GenerationType;
21 import javax.persistence.Id;
22 import javax.persistence.NamedQueries;
23 import javax.persistence.NamedQuery;
24 import javax.persistence.OneToOne;
25
26
27
28
29
30
31
32
33 @Entity
34 @NamedQueries( {
35 @NamedQuery(name = "FoilBasicSearch",
36 query = "SELECT o FROM FoilEntity o WHERE type LIKE :search")
37 })
38 public class FoilEntity {
39
40
41
42
43 @Id
44 @GeneratedValue(strategy=GenerationType.TABLE)
45 private long id;
46
47
48
49
50 private String type = "";
51
52
53
54
55 private String description = "";
56
57 @OneToOne
58 private EquipmentSupplierEntity builder;
59
60 public EquipmentSupplierEntity getBuilder() {
61 return builder;
62 }
63
64 public void setBuilder(EquipmentSupplierEntity builder) {
65 this.builder = builder;
66 }
67
68 public String getDescription() {
69 return description;
70 }
71
72 public void setDescription(String description) {
73 this.description = description;
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 String getType() {
85 return type;
86 }
87
88 public void setType(String type) {
89 this.type = type;
90 }
91
92
93
94
95
96 public String toString(){
97 StringBuffer buf = new StringBuffer();
98 buf.append(builder.toString());
99 if (type.length() > 0) {
100 buf.append(" " + type);
101 }
102 buf.append(" (" + id + ")");
103 return buf.toString();
104 }
105
106 }