PostulanteTecnologia.java 1.49 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 19 20

import lombok.Data;
@Entity @Data
21 22
@Table(name="postulante_tecnologia",
uniqueConstraints=@UniqueConstraint(columnNames={"postulante_id", "tecnologia_id"}))
23

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

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

38

39
    @ManyToOne()
willgonzz committed
40
    @JoinColumn
41
    @JsonBackReference(value = "postulantetecnologia-postulante")
42
    private Postulante postulante;
43
    
44 45 46 47 48 49 50 51 52 53 54 55
    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;
    }
56 57


58
}