Rev 771 | Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 760 | blopes | 1 | package br.com.sl.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.SequenceGenerator; |
||
| 11 | import javax.persistence.Table; |
||
| 12 | import javax.validation.constraints.Size; |
||
| 13 | |||
| 14 | import org.hibernate.validator.constraints.NotEmpty; |
||
| 15 | |||
| 16 | import br.com.ec.core.interfaces.Alterar; |
||
| 17 | import br.com.ec.core.interfaces.Cadastrar; |
||
| 18 | import br.com.ec.core.util.StringUtil; |
||
| 19 | |||
| 20 | @Entity |
||
| 21 | @Table(name="slp_ativo", schema="sc_slp") |
||
| 22 | public class Ativo implements Serializable { |
||
| 23 | |||
| 24 | private static final long serialVersionUID = 1L; |
||
| 25 | |||
| 26 | private Long sequencial; |
||
| 27 | private String nome; |
||
| 28 | |||
| 29 | @Id |
||
| 30 | @SequenceGenerator(name = "sq_ativo") |
||
| 31 | @GeneratedValue(strategy=GenerationType.IDENTITY) |
||
| 32 | @Column(name="seq_ativo", nullable=false) |
||
| 33 | public Long getSequencial() { |
||
| 34 | return sequencial; |
||
| 35 | } |
||
| 36 | public void setSequencial(Long sequencial) { |
||
| 37 | this.sequencial = sequencial; |
||
| 38 | } |
||
| 39 | |||
| 40 | @Column(name="dsc_ativo") |
||
| 41 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Nome do ativo") |
||
| 42 | @NotEmpty(message="Obrigatório informar o nome do ativo", groups={Cadastrar.class, Alterar.class}) |
||
| 43 | public String getNome() { |
||
| 44 | return nome; |
||
| 45 | } |
||
| 46 | public void setNome(String nome) { |
||
| 47 | this.nome = StringUtil.setarUpperCaseComTrim(nome); |
||
| 48 | } |
||
| 49 | |||
| 50 | } |