Institucion.java 891 Bytes
Newer Older
1 2 3
package com.roshka.modelo;

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

6 7 8 9
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.List;

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

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

    //Facultades
    @Column(name = "sub_nombre")
    private String subNombre;

    @OneToMany(cascade = CascadeType.PERSIST, mappedBy = "institucion", fetch = FetchType.LAZY)
    @JsonManagedReference
    private List<Estudio> estudioList;
29 30 31 32 33 34 35 36

    public List<Estudio> getEstudioList() {
        return estudioList;
    }

    public void setEstudioList(List<Estudio> estudioList) {
        this.estudioList = estudioList;
    }
37
}