Commit 666856007d6d6b9260eb3efef4873debaf708ca5

Authored by magno.oliveira
1 parent eb6efe3c
Exists in master

git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/e-selo@9524 c2178572-b5ca…

…-4887-91d2-9e3a90c7d55b
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/Criterio.java 0 → 100644
... ... @@ -0,0 +1,90 @@
  1 +package br.com.eselo.model;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.persistence.CascadeType;
  6 +import javax.persistence.Column;
  7 +import javax.persistence.Entity;
  8 +import javax.persistence.FetchType;
  9 +import javax.persistence.GeneratedValue;
  10 +import javax.persistence.GenerationType;
  11 +import javax.persistence.Id;
  12 +import javax.persistence.JoinColumn;
  13 +import javax.persistence.ManyToOne;
  14 +import javax.persistence.OneToMany;
  15 +import javax.persistence.OrderBy;
  16 +import javax.persistence.SequenceGenerator;
  17 +import javax.persistence.Table;
  18 +
  19 +import org.hibernate.annotations.ForeignKey;
  20 +
  21 +@Entity
  22 +@Table(name = "sel_criterio")
  23 +public class Criterio {
  24 +
  25 + @Id
  26 + @SequenceGenerator(name = "sel_criterio_id_criterio_seq", sequenceName = "sel_criterio_id_criterio_seq")
  27 + @GeneratedValue(strategy = GenerationType.AUTO, generator = "sel_criterio_id_criterio_seq")
  28 + @Column(name = "id_criterio", columnDefinition = "serial", unique = true, nullable = false)
  29 + private Long id;
  30 +
  31 + @Column(name = "vl_peso")
  32 + private Integer peso;
  33 +
  34 + @ManyToOne(fetch = FetchType.LAZY)
  35 + @JoinColumn(name = "id_tipo_teste", columnDefinition = "integer", nullable = false, insertable = true, updatable = true)
  36 + @ForeignKey(name = "fk_sel_criterio_sel_tipo_teste")
  37 + private TipoTeste tipoTeste;
  38 +
  39 + @ManyToOne(fetch = FetchType.LAZY)
  40 + @JoinColumn(name = "id_recomendacao", columnDefinition = "integer", nullable = false, insertable = true, updatable = true)
  41 + @ForeignKey(name = "fk_sel_criterio_sel_recomendacao")
  42 + private Recomendacao recomendacao;
  43 +
  44 + @OneToMany(mappedBy = "recomendacao", targetEntity = br.com.eselo.model.Faixa.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  45 + @OrderBy("faixaInicio desc, faixaFim desc")
  46 + private List<Faixa> faixas;
  47 +
  48 + public Long getId() {
  49 + return id;
  50 + }
  51 +
  52 + public void setId(Long id) {
  53 + this.id = id;
  54 + }
  55 +
  56 + public Integer getPeso() {
  57 + return peso;
  58 + }
  59 +
  60 + public void setPeso(Integer peso) {
  61 + this.peso = peso;
  62 + }
  63 +
  64 + public TipoTeste getTipoTeste() {
  65 + return tipoTeste;
  66 + }
  67 +
  68 + public void setTipoTeste(TipoTeste tipoTeste) {
  69 + this.tipoTeste = tipoTeste;
  70 + }
  71 +
  72 + public Recomendacao getRecomendacao() {
  73 + return recomendacao;
  74 + }
  75 +
  76 + public void setRecomendacao(Recomendacao recomendacao) {
  77 + this.recomendacao = recomendacao;
  78 + }
  79 +
  80 + public List<Faixa> getFaixas() {
  81 + return faixas;
  82 + }
  83 +
  84 + public void setFaixas(List<Faixa> faixas) {
  85 + this.faixas = faixas;
  86 + }
  87 +
  88 +
  89 +
  90 +}
... ...
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/TipoTeste.java 0 → 100644
... ... @@ -0,0 +1,62 @@
  1 +package br.com.eselo.model;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.SequenceGenerator;
  9 +import javax.persistence.Table;
  10 +
  11 +@Entity
  12 +@Table(name = "sel_tipo_teste")
  13 +public class TipoTeste{
  14 +
  15 + @Id
  16 + @SequenceGenerator(name = "sel_tipo_teste_id_tipo_teste_seq", sequenceName = "sel_tipo_teste_id_tipo_teste_seq")
  17 + @GeneratedValue(strategy = GenerationType.AUTO, generator = "sel_tipo_teste_id_tipo_teste_seq")
  18 + @Column(name = "id_tipo_teste", columnDefinition = "serial", unique = true, nullable = false)
  19 + private Long id;
  20 +
  21 + public String getTipo() {
  22 + return tipo;
  23 + }
  24 +
  25 + public void setTipo(String tipo) {
  26 + this.tipo = tipo;
  27 + }
  28 +
  29 + @Column(name = "ds_tipo", unique = true, nullable = false)
  30 + private String tipo;
  31 +
  32 + @Column(name = "ds_tipo_teste", unique = true, nullable = false)
  33 + private String descricao;
  34 +
  35 + @Column(name = "nu_maximo_teste", nullable = false)
  36 + private Long maximoTeste;
  37 +
  38 + public Long getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(Long id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public String getDescricao() {
  47 + return descricao;
  48 + }
  49 +
  50 + public void setDescricao(String descricao) {
  51 + this.descricao = descricao;
  52 + }
  53 +
  54 + public Long getMaximoTeste() {
  55 + return maximoTeste;
  56 + }
  57 +
  58 + public void setMaximoTeste(Long maximoTeste) {
  59 + this.maximoTeste = maximoTeste;
  60 + }
  61 +
  62 +}
... ...