package com.jasamedika.medifirst2000.entities;

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;

/**
 * class MapAngkaToBulan
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapAngkaToBulan_M")
public class MapAngkaToBulan extends BaseMaster {

	@NotNull(message = "Format Angka tidak boleh kosong")
	@Column(name = "FormatAngka", nullable = false)
	@Caption(value = "Format Angka")
	private Byte formatAngka;

	@NotNull(message = "Format Bulan tidak boleh kosong")
	@Column(name = "FormatBulan", nullable = false, length = 10)
	@Caption(value = "Format Bulan")
	private String formatBulan;

	@ManyToOne
	@JoinColumn(name = "ObjectMappingFk")
	@NotNull(message = "Kd Mapping tidak boleh kosong")
	@Caption(value = "Object Mapping")
	private MapAngkaToHari mapping;

	@Column(name = "ObjectMappingFk", insertable = false, updatable = false)
	private Integer mappingId;

	@NotNull(message = "No Urut tidak boleh kosong")
	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Byte noUrut;

	@NotNull(message = "QMapping tidak boleh kosong")
	@Column(name = "QMapping", nullable = false)
	@Caption(value = "QMapping")
	private Byte qMapping;

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

}