package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.google.gson.annotations.Expose;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MetodePengadaanDetail_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class MetodePengadaanDetail extends BaseMaster {

	@NotNull(message = "Name tidak boleh kosong")
	@Column(name = "Name", nullable = false, length = 100)
	@Caption(value = "Name")
	private String name;

	@ManyToOne
	@JoinColumn(name = "ObjectMetodePengadaanFk")
	@Expose(serialize = false)
	@Caption(value = "Metode Pegadaan Header")
	private MetodePengadaanHeader metodePengadaanHeader;

	@Column(name = "ObjectMetodePengadaanFk", insertable = false, updatable = false)
	private Integer metodePengadaanHeaderId;

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "public.metodepengadaandetail_m_id_seq")
	@SequenceGenerator(name = "public.metodepengadaandetail_m_id_seq", sequenceName = "public.metodepengadaandetail_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

}