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.ManyToMany;
26
27
28
29
30
31
32
33
34 @Entity
35 @NamedQueries( {
36 @NamedQuery(name = "findDesignByName",
37 query = "SELECT d FROM DesignEntity d WHERE d.name = :name"),
38 @NamedQuery(name = "DesignBasicSearch",
39 query = "SELECT d FROM DesignEntity d WHERE d.name LIKE :search")
40 })
41 public class DesignEntity {
42
43
44
45
46 @Id
47 @GeneratedValue(strategy=GenerationType.TABLE)
48 private long id;
49
50 private int year;
51
52 private String name = "";
53
54 @ManyToMany
55 private Collection<PersonEntity> designers;
56
57 private String description = "";
58
59 public String getDescription() {
60 return description;
61 }
62
63 public void setDescription(String description) {
64 this.description = description;
65 }
66
67 public String getName() {
68 return name;
69 }
70
71 public void setName(String name) {
72 this.name = name;
73 }
74
75 public int getYear() {
76 return year;
77 }
78
79 public void setYear(int year) {
80 this.year = year;
81 }
82
83 public long getId() {
84 return id;
85 }
86
87 public void setId(long id) {
88 this.id = id;
89 }
90
91 public Collection<PersonEntity> getDesigners() {
92 return designers;
93 }
94
95 public void setDesigners(Collection<PersonEntity> designers) {
96 this.designers = designers;
97 }
98
99
100
101
102
103 public String toString(){
104 return name;
105 }
106
107 }