Rev 259 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 259 | Rev 623 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | import java.util.Date; |
4 | import java.util.Date; |
| 5 | import java.util.Random; |
5 | import java.util.Random; |
| 6 | 6 | ||
| 7 | import javax.persistence.Column; |
7 | import javax.persistence.Column; |
| 8 | import javax.persistence.Entity; |
8 | import javax.persistence.Entity; |
| - | 9 | import org.hibernate.annotations.ForeignKey; |
|
| 9 | import javax.persistence.GeneratedValue; |
10 | import javax.persistence.GeneratedValue; |
| 10 | import javax.persistence.GenerationType; |
11 | import javax.persistence.GenerationType; |
| 11 | import javax.persistence.Id; |
12 | import javax.persistence.Id; |
| - | 13 | import javax.persistence.JoinColumn; |
|
| - | 14 | import javax.persistence.ManyToOne; |
|
| 12 | import javax.persistence.SequenceGenerator; |
15 | import javax.persistence.SequenceGenerator; |
| 13 | import javax.persistence.Table; |
16 | import javax.persistence.Table; |
| 14 | import javax.persistence.Transient; |
17 | import javax.persistence.Transient; |
| 15 | import javax.validation.constraints.NotNull; |
18 | import javax.validation.constraints.NotNull; |
| 16 | import javax.validation.constraints.Size; |
19 | import javax.validation.constraints.Size; |
| Line 43... | Line 46... | ||
| 43 | private Date dataHoraEmissao; |
46 | private Date dataHoraEmissao; |
| 44 | private Boolean limiteUtilizacao; |
47 | private Boolean limiteUtilizacao; |
| 45 | private Boolean publico; |
48 | private Boolean publico; |
| 46 | private Boolean ativo; |
49 | private Boolean ativo; |
| 47 | 50 | ||
| 48 | // private Cliente cliente;
|
- | |
| - | 51 | private Cliente cliente; |
|
| 49 | 52 | ||
| 50 | private Lancamento lancamento; |
53 | private Lancamento lancamento; |
| 51 | 54 | ||
| 52 | public Cupom() {} |
55 | public Cupom() {} |
| 53 | 56 | ||
| Line 190... | Line 193... | ||
| 190 | if (VerificadorUtil.naoEstaNulo(getPercentual())) { |
193 | if (VerificadorUtil.naoEstaNulo(getPercentual())) { |
| 191 | return StringUtil.formatarPercentual(getPercentual()/100); |
194 | return StringUtil.formatarPercentual(getPercentual()/100); |
| 192 | }
|
195 | }
|
| 193 | return null; |
196 | return null; |
| 194 | }
|
197 | }
|
| 195 | /*
|
- | |
| - | 198 | ||
| 196 | @ManyToOne
|
199 | @ManyToOne |
| 197 | @ForeignKey(name="fk_cupom_cliente")
|
200 | @ForeignKey(name="fk_cupom_cliente") |
| 198 | @JoinColumn(name = "seq_cliente", nullable=true)
|
201 | @JoinColumn(name = "seq_cliente", nullable=true) |
| 199 | public Cliente getCliente() {
|
202 | public Cliente getCliente() { |
| 200 | return cliente;
|
203 | return cliente; |
| 201 | }
|
204 | }
|
| 202 | public void setCliente(Cliente cliente) {
|
205 | public void setCliente(Cliente cliente) { |
| 203 | this.cliente = cliente;
|
206 | this.cliente = cliente; |
| 204 | }
|
207 | }
|
| 205 | */
|
- | |
| - | 208 | ||
| 206 | @Transient |
209 | @Transient |
| 207 | public Lancamento getLancamento() { |
210 | public Lancamento getLancamento() { |
| 208 | return lancamento; |
211 | return lancamento; |
| 209 | }
|
212 | }
|
| 210 | public void setLancamento(Lancamento lancamento) { |
213 | public void setLancamento(Lancamento lancamento) { |