Subversion Repositories Integrator Subversion

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
106 espaco 1
package br.com.ec.domain.model;
2
 
3
import java.io.Serializable;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.GeneratedValue;
8
import javax.persistence.GenerationType;
9
import javax.persistence.Id;
10
import javax.persistence.JoinColumn;
11
import javax.persistence.ManyToOne;
12
import javax.persistence.SequenceGenerator;
13
import javax.persistence.Table;
14
import javax.validation.constraints.NotNull;
15
 
16
import org.hibernate.annotations.ForeignKey;
17
 
18
import br.edu.cesmac.core.interfaces.Alterar;
19
import br.edu.cesmac.core.interfaces.Cadastrar;
20
 
21
@Entity
22
@Table(name="sec_consolidado_estoque", schema="sc_sec")
23
public class ConsolidadoEstoque implements Serializable {
24
 
25
        private static final long serialVersionUID = 1L;
26
 
27
        private Long sequencial;
28
        private Vigencia vigencia;
29
        private Modelo modelo;
30
        private Integer quantidadeEstoque;
31
        private Double valorTotalEstoque;
32
 
33
        @Id
34
        @SequenceGenerator(name = "sq_consolidadoestoque")
35
        @GeneratedValue(strategy = GenerationType.IDENTITY)
36
        @Column(name="seq_consolidadoestoque", nullable=false)
37
        public Long getSequencial() {
38
                return sequencial;
39
        }
40
        public void setSequencial(Long sequencial) {
41
                this.sequencial = sequencial;
42
        }
43
 
44
        @ManyToOne
45
        @ForeignKey(name="fk_consolidadoestoque_vigencia")
46
        @NotNull(message = "Parâmetro obrigatório não preenchido: Vigência", groups = {Cadastrar.class, Alterar.class})
47
        @JoinColumn(name = "seq_vigencia", referencedColumnName="seq_vigencia", nullable=true)
48
        public Vigencia getVigencia() {
49
                return vigencia;
50
        }
51
        public void setVigencia(Vigencia vigencia) {
52
                this.vigencia = vigencia;
53
        }
54
 
55
        @ManyToOne
56
        @ForeignKey(name="fk_consolidadoestoque_modelo")
57
        @NotNull(message = "Parâmetro obrigatório não preenchido: Modelo", groups = {Cadastrar.class, Alterar.class})
58
        @JoinColumn(name = "seq_modelo", referencedColumnName="seq_modelo", nullable=true)
59
        public Modelo getModelo() {
60
                return modelo;
61
        }
62
        public void setModelo(Modelo modelo) {
63
                this.modelo = modelo;
64
        }
65
 
66
        @Column(name="qtd_estoque", nullable=false)
67
        @NotNull(message = "Parâmetro obrigatório não preenchido: Quantidade em estoque", groups = {Cadastrar.class, Alterar.class})
68
        public Integer getQuantidadeEstoque() {
69
                return quantidadeEstoque;
70
        }
71
        public void setQuantidadeEstoque(Integer quantidadeEstoque) {
72
                this.quantidadeEstoque = quantidadeEstoque;
73
        }
74
 
75
        @Column(name="val_total_estoque", nullable=false)
76
        @NotNull(message = "Parâmetro obrigatório não preenchido: Valor total de estoque", groups = {Cadastrar.class, Alterar.class})
77
        public Double getValorTotalEstoque() {
78
                return valorTotalEstoque;
79
        }
80
        public void setValorTotalEstoque(Double valorTotalEstoque) {
81
                this.valorTotalEstoque = valorTotalEstoque;
82
        }
83
 
84
}