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

import com.fasterxml.jackson.annotation.JsonBackReference;
4 5
import lombok.Data;

6 7 8
import javax.persistence.*;
import javax.validation.constraints.NotBlank;

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

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

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

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

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

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