PostulanteTecnologia.java 1.71 KB
Newer Older
1 2
package com.roshka.modelo;

willgonzz committed
3
import javax.persistence.CascadeType;
4 5 6 7 8
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
Javier Ferreira committed
9 10
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
11
import javax.persistence.Table;
12
import javax.persistence.UniqueConstraint;
13 14
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
15

16 17

import com.fasterxml.jackson.annotation.JsonBackReference;
18
@Entity 
19 20
@Table(name="postulante_tecnologia",
uniqueConstraints=@UniqueConstraint(columnNames={"postulante_id", "tecnologia_id"}))
21

22
public class PostulanteTecnologia {
23 24
   @Id 
   @GeneratedValue(strategy = GenerationType.AUTO)
25
   @Column(name="id")
26
   private long id ;
27

28
   @Column(name="nivel")
29 30
   @Min(value = 1)
   @Max(value = 5)
31
   private Long nivel;
32
    @ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE},optional = false)
Javier Ferreira committed
33 34
    @JoinColumn
   private Tecnologia tecnologia;
35 36

    @ManyToOne()
Javier Ferreira committed
37
   @JoinColumn
38
    @JsonBackReference(value = "postulantetecnologia-postulante")
39
    private Postulante postulante;
40
    
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public Long getNivel() {
        return nivel;
    }
    public void setNivel(Long nivel) {
        this.nivel = nivel;
    }
    public Tecnologia getTecnologia() {
        return tecnologia;
    }
    public void setTecnologia(Tecnologia tecnologia) {
        this.tecnologia = tecnologia;
    }
    public Postulante getPostulante() {
        return postulante;
    }
    public void setPostulante(Postulante postulante) {
        this.postulante = postulante;
    }
65 66


67
}