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;

@Getter
@Setter
@Entity
@Table(name = "DetailTOWS_M")
public class DetailTOWS extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "towsFk")
	@NotNull(message = "TOWS Harus Diisi")
	@Caption(value = "SWOT")
	private TOWS tows;

	@Column(name = "towsFk", insertable = false, updatable = false)
	private Integer towsId;

	@Column(name = "input", nullable = false)
	private String input;

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

}