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 @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 public CreditsVO() {
59 nome = "";
60 }
61
62
63
64
65
66 public CreditsVO(String nome) {
67 this.nome = nome;
68 }
69
70
71
72
73
74 public CreditsVO(Integer creditoid) {
75 this();
76 this.creditoid = creditoid;
77 }
78
79
80
81
82
83
84 public CreditsVO(Integer creditoid, String nome) {
85 this();
86 this.creditoid = creditoid;
87 this.nome = nome;
88 }
89
90
91
92
93
94 public Integer getCreditoid() {
95 return creditoid;
96 }
97
98
99
100
101
102 @Override
103 public String getNome() {
104 return nome;
105 }
106
107
108
109
110
111 public void setNome(String nome) {
112 this.nome = nome;
113 }
114
115 @Override
116 public int hashCode() {
117 int hash = 0;
118 hash += (creditoid != null ? creditoid.hashCode() : 0);
119 return hash;
120 }
121
122 @Override
123 public boolean equals(Object object) {
124
125 if (!(object instanceof CreditsVO)) {
126 return false;
127 }
128 CreditsVO other = (CreditsVO) object;
129 if ((this.creditoid == null && other.creditoid != null) || (this.creditoid != null && !this.creditoid.equals(other.creditoid))) {
130 return false;
131 }
132 return true;
133 }
134
135 @Override
136 public String toString() {
137 return this.getClass().getCanonicalName() + "[creditoid=" + creditoid + "]";
138 }
139
140
141
142
143
144 @Override
145 public Integer getId() {
146 return creditoid;
147 }
148 }