Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 524 | blopes | 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.com.ec.core.interfaces.Alterar; |
||
| 19 | import br.com.ec.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 | public ConsolidadoEstoque() {} |
||
| 34 | |||
| 35 | public ConsolidadoEstoque(Long sequencial) { |
||
| 36 | this.sequencial = sequencial; |
||
| 37 | } |
||
| 38 | |||
| 39 | @Id |
||
| 40 | @SequenceGenerator(name = "sq_consolidadoestoque") |
||
| 41 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
||
| 42 | @Column(name="seq_consolidadoestoque", nullable=false) |
||
| 43 | public Long getSequencial() { |
||
| 44 | return sequencial; |
||
| 45 | } |
||
| 46 | public void setSequencial(Long sequencial) { |
||
| 47 | this.sequencial = sequencial; |
||
| 48 | } |
||
| 49 | |||
| 50 | @ManyToOne |
||
| 51 | @ForeignKey(name="fk_consolidadoestoque_vigencia") |
||
| 52 | @NotNull(message = "Parâmetro obrigatório não preenchido: Vigência", groups = {Cadastrar.class, Alterar.class}) |
||
| 53 | @JoinColumn(name = "seq_vigencia", referencedColumnName="seq_vigencia", nullable=true) |
||
| 54 | public Vigencia getVigencia() { |
||
| 55 | return vigencia; |
||
| 56 | } |
||
| 57 | public void setVigencia(Vigencia vigencia) { |
||
| 58 | this.vigencia = vigencia; |
||
| 59 | } |
||
| 60 | |||
| 61 | @ManyToOne |
||
| 62 | @ForeignKey(name="fk_consolidadoestoque_modelo") |
||
| 63 | @NotNull(message = "Parâmetro obrigatório não preenchido: Modelo", groups = {Cadastrar.class, Alterar.class}) |
||
| 64 | @JoinColumn(name = "seq_modelo", referencedColumnName="seq_modelo", nullable=true) |
||
| 65 | public Modelo getModelo() { |
||
| 66 | return modelo; |
||
| 67 | } |
||
| 68 | public void setModelo(Modelo modelo) { |
||
| 69 | this.modelo = modelo; |
||
| 70 | } |
||
| 71 | |||
| 72 | @Column(name="qtd_estoque", nullable=false) |
||
| 73 | @NotNull(message = "Parâmetro obrigatório não preenchido: Quantidade em estoque", groups = {Cadastrar.class, Alterar.class}) |
||
| 74 | public Integer getQuantidadeEstoque() { |
||
| 75 | return quantidadeEstoque; |
||
| 76 | } |
||
| 77 | public void setQuantidadeEstoque(Integer quantidadeEstoque) { |
||
| 78 | this.quantidadeEstoque = quantidadeEstoque; |
||
| 79 | } |
||
| 80 | |||
| 81 | @Column(name="val_total_estoque", nullable=false) |
||
| 82 | @NotNull(message = "Parâmetro obrigatório não preenchido: Valor total de estoque", groups = {Cadastrar.class, Alterar.class}) |
||
| 83 | public Double getValorTotalEstoque() { |
||
| 84 | return valorTotalEstoque; |
||
| 85 | } |
||
| 86 | public void setValorTotalEstoque(Double valorTotalEstoque) { |
||
| 87 | this.valorTotalEstoque = valorTotalEstoque; |
||
| 88 | } |
||
| 89 | |||
| 90 | } |