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 import javax.persistence.ManyToOne;
26
27
28
29
30
31
32
33
34 @Entity
35 @NamedQueries( {
36 @NamedQuery(name = "findEquipmentSupplierByName",
37 query = "SELECT e FROM EquipmentSupplierEntity e WHERE e.name = :name"),
38 @NamedQuery(name = "EquipmentSupplierBasicSearch",
39 query = "SELECT o FROM EquipmentSupplierEntity o WHERE o.name LIKE :search")
40 })
41 public class EquipmentSupplierEntity {
42
43
44
45
46 @Id
47 @GeneratedValue(strategy=GenerationType.TABLE)
48 private long id;
49
50 private String name = "";
51
52 @OneToOne
53 private AddressEntity address;
54
55 private String url = "";
56
57 public AddressEntity getAddress() {
58 return address;
59 }
60
61 @ManyToOne
62 private PersonEntity people;
63
64 public void setAddress(AddressEntity address) {
65 this.address = address;
66 }
67
68 public long getId() {
69 return id;
70 }
71
72 public void setId(long id) {
73 this.id = id;
74 }
75
76 public String getName() {
77 return name;
78 }
79
80 public void setName(String name) {
81 this.name = name;
82 }
83
84 public String getUrl() {
85 return url;
86 }
87
88 public void setUrl(String url) {
89 this.url = url;
90 }
91
92 public PersonEntity getPeople() {
93 return people;
94 }
95
96 public void setPeople(PersonEntity people) {
97 this.people = people;
98 }
99
100
101
102
103
104 public String toString(){
105 return name;
106 }
107 }