Cargo.java 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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;

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

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

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

31
    public Long getId() {
32 33 34 35 36
        return id;
    }
    public String getNombre() {
        return nombre;
    }
37
    public void setId(Long id) {
38 39 40 41 42 43 44 45 46 47 48 49 50
        this.id = id;
    }
    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<ConvocatoriaCargo> getConvocatorias() {
        return convocatorias;
    }
    public void setConvocatorias(List<ConvocatoriaCargo> convocatorias) {
        this.convocatorias = convocatorias;
    }
}