Cargo.java 1.01 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 33 34 35 36 37 38

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

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

    public List<ConvocatoriaCargo> getConvocatorias() {
        return convocatorias;
    }
    public void setConvocatorias(List<ConvocatoriaCargo> convocatorias) {
        this.convocatorias = convocatorias;
    }
willgonzz committed
39 40 41
    public static Object values() {
        return null;
    }
42
}