package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 MerkProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MerkProduk_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class MerkProduk extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@NotNull(message = "Kd Merk Produk tidak boleh kosong")
	@Column(name = "KdMerkProduk", nullable = false)
	@Caption(value = "Kode Merk Produk")
	private short kdMerkProduk;

	@NotNull(message = "Merk Produk tidak boleh kosong")
	@Column(name = "MerkProduk", nullable = false, length = 30)
	@Caption(value = "Merk Produk")
	private String merkProduk;

	@NotNull(message = "QMerk Produk tidak boleh kosong")
	@Column(name = "QMerkProduk", nullable = false)
	@Caption(value = "QMerk Produk")
	private short qMerkProduk;

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

}