1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
package net.sf.webphotos.model; |
21 | |
|
22 | |
import java.io.Serializable; |
23 | |
import javax.persistence.Column; |
24 | |
import javax.persistence.Entity; |
25 | |
import javax.persistence.GeneratedValue; |
26 | |
import javax.persistence.GenerationType; |
27 | |
import javax.persistence.Id; |
28 | |
import javax.persistence.NamedQueries; |
29 | |
import javax.persistence.NamedQuery; |
30 | |
import javax.persistence.Table; |
31 | |
import net.sf.webphotos.entity.HasID; |
32 | |
import net.sf.webphotos.entity.IsCredits; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | 0 | @Entity |
39 | |
@Table(name = "CREDITOS") |
40 | |
@NamedQueries({ |
41 | |
@NamedQuery(name = "CreditsVO.findByCreditoID", query = "SELECT c FROM CreditsVO c WHERE c.creditoid = :creditoid"), |
42 | |
@NamedQuery(name = "CreditsVO.findByNome", query = "SELECT c FROM CreditsVO c WHERE c.nome = :nome")}) |
43 | |
public class CreditsVO implements Serializable, HasID<Integer>, IsCredits { |
44 | |
|
45 | |
private static final long serialVersionUID = 1L; |
46 | |
|
47 | |
@Id |
48 | |
@Column(name = "CREDITOID", nullable = false) |
49 | |
@GeneratedValue(strategy = GenerationType.IDENTITY) |
50 | |
private Integer creditoid; |
51 | |
|
52 | |
@Column(name = "NOME", nullable = false) |
53 | |
private String nome; |
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | 0 | public CreditsVO() { |
59 | 0 | nome = ""; |
60 | 0 | } |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | 0 | public CreditsVO(String nome) { |
67 | 0 | this.nome = nome; |
68 | 0 | } |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
public CreditsVO(Integer creditoid) { |
75 | 0 | this(); |
76 | 0 | this.creditoid = creditoid; |
77 | 0 | } |
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
public CreditsVO(Integer creditoid, String nome) { |
85 | 0 | this(); |
86 | 0 | this.creditoid = creditoid; |
87 | 0 | this.nome = nome; |
88 | 0 | } |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
public Integer getCreditoid() { |
95 | 0 | return creditoid; |
96 | |
} |
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
@Override |
103 | |
public String getNome() { |
104 | 0 | return nome; |
105 | |
} |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
public void setNome(String nome) { |
112 | 0 | this.nome = nome; |
113 | 0 | } |
114 | |
|
115 | |
@Override |
116 | |
public int hashCode() { |
117 | 0 | int hash = 0; |
118 | 0 | hash += (creditoid != null ? creditoid.hashCode() : 0); |
119 | 0 | return hash; |
120 | |
} |
121 | |
|
122 | |
@Override |
123 | |
public boolean equals(Object object) { |
124 | |
|
125 | 0 | if (!(object instanceof CreditsVO)) { |
126 | 0 | return false; |
127 | |
} |
128 | 0 | CreditsVO other = (CreditsVO) object; |
129 | 0 | if ((this.creditoid == null && other.creditoid != null) || (this.creditoid != null && !this.creditoid.equals(other.creditoid))) { |
130 | 0 | return false; |
131 | |
} |
132 | 0 | return true; |
133 | |
} |
134 | |
|
135 | |
@Override |
136 | |
public String toString() { |
137 | 0 | return this.getClass().getCanonicalName() + "[creditoid=" + creditoid + "]"; |
138 | |
} |
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
@Override |
145 | |
public Integer getId() { |
146 | 0 | return creditoid; |
147 | |
} |
148 | |
} |