Cargo.java 1.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package com.roshka.modelo;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonManagedReference;

16 17 18
import lombok.Data;

@Entity @Data
19 20 21
@Table(name = "cargo")
public class Cargo {
    @Id
22
    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
    private Long id;
24 25 26 27 28 29 30 31 32

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

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

33
    @Column(name = "existe_convocatoria")
34
    private boolean existeConvocatoria=false;
35

36 37 38 39 40 41
    public List<ConvocatoriaCargo> getConvocatorias() {
        return convocatorias;
    }
    public void setConvocatorias(List<ConvocatoriaCargo> convocatorias) {
        this.convocatorias = convocatorias;
    }
willgonzz committed
42 43 44
    public static Object values() {
        return null;
    }
45 46 47 48 49 50 51 52 53

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

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

54
}