ReferenciaPersonal.java 888 Bytes
Newer Older
1 2
package com.roshka.modelo;

3
import javax.persistence.*;
4 5 6 7
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonBackReference;

8 9 10
import lombok.Data;

@Entity @Data
11 12 13
@Table(name = "referencia_personal")
public class ReferenciaPersonal {   
    @Id
14
    @GeneratedValue(strategy = GenerationType.IDENTITY)
15 16 17 18 19 20 21 22 23 24 25 26 27 28
    private Long id;

    @NotBlank
    @Column(name = "nombre")
    private String nombre;

    @NotBlank
    @Column(name = "telefono")
    private String telefono;

    @NotBlank
    @Column(name = "relacion")
    private String relacion;

29
    @ManyToOne(cascade = CascadeType.ALL, optional = false)
30 31 32 33 34 35 36 37 38 39 40
    @JoinColumn
    @JsonBackReference
    private Postulante postulante;

    public Postulante getPostulante() {
        return postulante;
    }
    public void setPostulante(Postulante postulante) {
        this.postulante = postulante;
    }
}