PostulanteTecnologia.java 1.62 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 15
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
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
39
    private Postulante postulante;
40 41 42 43 44 45 46 47 48 49 50 51
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;
}
Javier Ferreira committed
52 53
public Tecnologia getTecnologia() {
    return tecnologia;
54
}
Javier Ferreira committed
55 56
public void setTecnologia(Tecnologia tecnologia) {
    this.tecnologia = tecnologia;
57
}
Javier Ferreira committed
58
public Postulante getPostulante() {
59 60
    return postulante;
}
Javier Ferreira committed
61
public void setPostulante(Postulante postulante) {
62 63 64 65 66 67 68 69
    this.postulante = postulante;
}






Javier Ferreira committed
70 71


72
}