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 KategoryAccount
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KategoryAccount_M")
public class KategoryAccount extends BaseMaster {

	@NotNull(message = "Kategory Account tidak boleh kosong")
	@Column(name = "KategoryAccount", nullable = false, length = 30)
	@Caption(value = "Kategory Account")
	private String kategoryAccount;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisAccountFk")
	@NotNull(message = "Kd Jenis Account tidak boleh kosong")
	@Caption(value = "Object Jenis Account")
	private JenisAccount jenisAccount;

	@Column(name = "ObjectJenisAccountFk", insertable = false, updatable = false)
	private Integer jenisAccountId;

	@NotNull(message = "Kd Kategory Account tidak boleh kosong")
	@Column(name = "KdKategoryAccount", nullable = false)
	@Caption(value = "Kode Kategory Account")
	private Byte kdKategoryAccount;

	@NotNull(message = "QKategory Account tidak boleh kosong")
	@Column(name = "QKategoryAccount", nullable = false)
	@Caption(value = "QKategory Account")
	private Byte qKategoryAccount;

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

}