Birthday.java 639 Bytes
Newer Older
1 2 3
package com.roshka.modelo;

import lombok.Data;
4
import org.springframework.format.annotation.DateTimeFormat;
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.Date;


@Entity @Data
@Table(name="cumpleanos")
public class Birthday {
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name="id")
    private Long id;
    @Column(name="nombreCompleto")
    @NotBlank(message = "Este campo no puede estar vacio")
    private String nombreCompleto;
    @Column(name="fecha")
22 23
    @Temporal(TemporalType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
24 25
    private Date fecha;
}