Rev 452 | Rev 485 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 452 | Rev 468 | ||
|---|---|---|---|
| Line 26... | Line 26... | ||
| 26 | 26 | ||
| 27 | private static final long serialVersionUID = 1L; |
27 | private static final long serialVersionUID = 1L; |
| 28 | 28 | ||
| 29 | private Long sequencial; |
29 | private Long sequencial; |
| 30 | private NotaFiscal notaFiscal; |
30 | private NotaFiscal notaFiscal; |
| 31 | private Produto produto; |
- | |
| - | 31 | private CompraProduto compraProduto; |
|
| 32 | private Integer quantidade; |
32 | private Integer quantidade; |
| 33 | 33 | ||
| 34 | @Id |
34 | @Id |
| 35 | @SequenceGenerator(name = "sq_notafiscalproduto") |
35 | @SequenceGenerator(name = "sq_notafiscalproduto") |
| 36 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
36 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| Line 39... | Line 39... | ||
| 39 | return sequencial; |
39 | return sequencial; |
| 40 | }
|
40 | }
|
| 41 | public void setSequencial(Long sequencial) { |
41 | public void setSequencial(Long sequencial) { |
| 42 | this.sequencial = sequencial; |
42 | this.sequencial = sequencial; |
| 43 | }
|
43 | }
|
| 44 | - | ||
| - | 44 | ||
| 45 | @ManyToOne |
45 | @ManyToOne |
| 46 | @ForeignKey(name="fk_notafiscalproduto_notafiscal") |
46 | @ForeignKey(name="fk_notafiscalproduto_notafiscal") |
| 47 | @JoinColumn(name = "seq_nota_fiscal", referencedColumnName="seq_nota_fiscal", insertable=true, updatable=false, nullable=false) |
47 | @JoinColumn(name = "seq_nota_fiscal", referencedColumnName="seq_nota_fiscal", insertable=true, updatable=false, nullable=false) |
| 48 | public NotaFiscal getNotaFiscal() { |
48 | public NotaFiscal getNotaFiscal() { |
| 49 | return notaFiscal; |
49 | return notaFiscal; |
| 50 | }
|
50 | }
|
| 51 | public void setNotaFiscal(NotaFiscal notaFiscal) { |
51 | public void setNotaFiscal(NotaFiscal notaFiscal) { |
| 52 | this.notaFiscal = notaFiscal; |
52 | this.notaFiscal = notaFiscal; |
| 53 | }
|
53 | }
|
| 54 | 54 | ||
| - | 55 | @ManyToOne |
|
| - | 56 | @ForeignKey(name="fk_notafiscalproduto_compraproduto") |
|
| - | 57 | @JoinColumn(name = "seq_compraproduto", referencedColumnName="seq_compraproduto", insertable=true, updatable=false, nullable=false) |
|
| - | 58 | public CompraProduto getCompraProduto() { |
|
| - | 59 | return compraProduto; |
|
| - | 60 | }
|
|
| - | 61 | public void setCompraProduto(CompraProduto compraProduto) { |
|
| - | 62 | this.compraProduto = compraProduto; |
|
| - | 63 | }
|
|
| - | 64 | ||
| - | 65 | /*
|
|
| 55 | @ManyToOne |
66 | @ManyToOne
|
| 56 | @ForeignKey(name="fk_notafiscalproduto_produto") |
67 | @ForeignKey(name="fk_notafiscalproduto_produto")
|
| 57 | @JoinColumn(name = "seq_produto", insertable=true, updatable=false, nullable=false) |
68 | @JoinColumn(name = "seq_produto", insertable=true, updatable=false, nullable=false)
|
| 58 | public Produto getProduto() { |
69 | public Produto getProduto() {
|
| 59 | return produto; |
70 | return produto;
|
| 60 | }
|
71 | }
|
| 61 | public void setProduto(Produto produto) { |
72 | public void setProduto(Produto produto) {
|
| 62 | this.produto = produto; |
73 | this.produto = produto;
|
| 63 | }
|
74 | }
|
| - | 75 | */
|
|
| 64 | 76 | ||
| 65 | @NotNull(message = "Parâmetro obrigatório não preenchido: Quantidade de produtos", groups = {Cadastrar.class, Alterar.class}) |
77 | @NotNull(message = "Parâmetro obrigatório não preenchido: Quantidade de produtos", groups = {Cadastrar.class, Alterar.class}) |
| 66 | @Column(name="qtd_produto") |
78 | @Column(name="qtd_produto") |
| 67 | public Integer getQuantidade() { |
79 | public Integer getQuantidade() { |
| 68 | return quantidade; |
80 | return quantidade; |
| 69 | }
|
81 | }
|
| 70 | public void setQuantidade(Integer quantidade) { |
82 | public void setQuantidade(Integer quantidade) { |
| 71 | this.quantidade = quantidade; |
83 | this.quantidade = quantidade; |
| 72 | }
|
84 | }
|
| 73 | 85 | ||
| - | 86 | /*
|
|
| 74 | @Transient |
87 | @Transient
|
| 75 | public Long getSequencialDaNotaFiscal() { |
88 | public Long getSequencialDaNotaFiscal() {
|
| 76 | return VerificadorUtil.naoEstaNulo(notaFiscal)? notaFiscal.getSequencial() : null; |
89 | return VerificadorUtil.naoEstaNulo(notaFiscal)? notaFiscal.getSequencial() : null;
|
| 77 | }
|
90 | }
|
| 78 | 91 |
|
|
| 79 | @Transient |
92 | @Transient
|
| 80 | public Long getSequencialDoProduto() { |
93 | public Long getSequencialDoProduto() {
|
| 81 | return VerificadorUtil.naoEstaNulo(produto)? produto.getSequencial() : null; |
94 | return VerificadorUtil.naoEstaNulo(produto)? produto.getSequencial() : null;
|
| 82 | }
|
95 | }
|
| - | 96 | */
|
|
| 83 | 97 | ||
| 84 | @Override |
98 | @Override |
| 85 | public int hashCode() { |
99 | public int hashCode() { |
| 86 | final int prime = 31; |
100 | final int prime = 31; |
| 87 | int result = 1; |
101 | int result = 1; |