package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseActive;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * @author Salman
 * @version 1.0.0
 * @since 31/01/2024
 */
@Getter
@Setter
@Entity
@Table(name = "jenis_log_m")
public class JenisLog extends BaseActive implements Serializable {

	private static final long serialVersionUID = -5796583173860610757L;

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "sg_jenis_log_m")
	@SequenceGenerator(name = "sg_jenis_log_m", sequenceName = "jenis_log_m_seq", allocationSize = 1)
	@Column(name = "id")
	protected Long id;

	@Column(length = 150, unique = true, nullable = false)
	@Size(max = 150)
	@NotBlank
	@Caption("Jenis Log")
	private String jenisLog;

	@Column(length = 100, nullable = false)
	@Size(max = 100)
	@NotBlank
	@Caption("Relasi")
	private String relasi;

}
