package no.valg.valgnatt.database.hibernate;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "rapporter")
@NoArgsConstructor //Hibernate-krav
@AllArgsConstructor //Builder-krav
@Builder
public class Rapport implements java.io.Serializable {

    @Id
    @Getter
    @Setter
    @Column(name = "rappnavn", unique = true, nullable = false, length = 120)
    private String rappnavn;

    @Getter
    @Setter
    @Column(name = "rappsekvens", nullable = false)
    private Integer rappsekvens;

    @Getter
    @Setter
    @Column(name = "json", nullable = false)
    private String json;

    @Getter
    @CreationTimestamp
    @Column(name = "opprettet_tid", updatable = false)
    private Date opprettetTid;

}
