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 = "MastBasicSearch",
36 query = "SELECT m FROM MastEntity m WHERE " +
37 "m.description LIKE :search")
38 })
39 public class MastEntity {
40
41
42
43
44 @Id
45 @GeneratedValue(strategy=GenerationType.TABLE)
46 private long id;
47
48
49
50
51 private String type = "";
52
53
54
55
56 private String description = "";
57
58
59 @OneToOne
60 private EquipmentSupplierEntity builder;
61
62 public EquipmentSupplierEntity getBuilder() {
63 return builder;
64 }
65
66 public void setBuilder(EquipmentSupplierEntity builder) {
67 this.builder = builder;
68 }
69
70 public String getDescription() {
71 return description;
72 }
73
74 public void setDescription(String description) {
75 this.description = description;
76 }
77
78 public long getId() {
79 return id;
80 }
81
82 public void setId(long id) {
83 this.id = id;
84 }
85
86 public String getType() {
87 return type;
88 }
89
90 public void setType(String type) {
91 this.type = type;
92 }
93
94
95
96
97
98 public String toString(){
99 StringBuffer buf = new StringBuffer();
100 buf.append(builder.toString());
101 if (type.length() > 0) {
102 buf.append(" " + type);
103 }
104 buf.append(" (" + id + ")");
105 return buf.toString();
106 }
107 }