Cargo.java 1.1 KB
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 = "cargo")
public class Cargo {
    @Id
14
    @GeneratedValue(strategy = GenerationType.IDENTITY)
15
    private Long id;
16 17 18 19 20 21 22 23 24

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

    @OneToMany(mappedBy = "cargo")
    @JsonManagedReference
    private List<ConvocatoriaCargo> convocatorias;

25
    @Column(name = "existe_convocatoria")
26
    private boolean existeConvocatoria=false;
27

28 29 30 31 32 33
    public List<ConvocatoriaCargo> getConvocatorias() {
        return convocatorias;
    }
    public void setConvocatorias(List<ConvocatoriaCargo> convocatorias) {
        this.convocatorias = convocatorias;
    }
willgonzz committed
34 35 36
    public static Object values() {
        return null;
    }
37 38 39 40 41 42 43 44 45

    public boolean isExisteConvocatoria() {
        return this.existeConvocatoria;
    }

    public void setExisteConvocatoria(boolean existeConvocatoria) {
        this.existeConvocatoria = existeConvocatoria;
    }

46
}