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 JenisAset
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "JenisAset_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class JenisAset extends BaseMaster {

	@Caption(value = "Jenis Aset")
	private String jenisAset;

	@ManyToOne
	@JoinColumn(name = "ObjectAccountFk")
	@Caption(value = "Object Account")
	private ChartOfAccount account;

	@Column(name = "ObjectAccountFk", insertable = false, updatable = false)
	private Integer accountId;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Object Departemen Harus Diisi")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

	@Caption(value = "Kode Jenis Aset")
	private Byte kdJenisAset;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisAsetHeadFk")
	@Caption(value = "Object Jenis Aset Head")
	private JenisAset jenisAsetHead;

	@Column(name = "ObjectJenisAsetHeadFk", insertable = false, updatable = false)
	private Integer jenisAsetHeadId;

	@Caption(value = "QJenis Aset")
	private Byte qJenisAset;

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

}