package com.jasamedika.medifirst2000.vo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.vo.BaseTransactionVO;
import com.jasamedika.medifirst2000.helper.Caption;

public class KecelakaanKerjaVO extends BaseTransactionVO{
	
	@Column(name="tglInsiden",nullable=false)
	@Caption(value="Tanggal Insiden")
	@NotNull(message="Tanggal Insiden tidak boleh kosong")
	private Date tglInsiden;
	
	@Column(name="waktuInsiden",nullable=false)
	@Caption(value="Waktu Insiden")
	@NotNull(message="Waktu Insiden tidak boleh kosong")
	private Date waktuInsiden;
	
	@Column(name="pekerjaan",nullable=true)
	@Caption(value="Pekerjaan")
	private String pekerjaan;
	
	@Column(name="lokasi",nullable=true)
	@Caption(value="Lokasi")
	private String lokasi;
	
	@Column(name="area",nullable=true)
	@Caption(value="Area")
	private String area;
	
	@Column(name="Kronologi",nullable=true)
	@Caption(value="Kronologi")
	private String kronologi;
	
	@Column(name="kerugianAset",nullable=true)
	@Caption(value="Kerugian Aset")
	private String kerugianAset;
	
	@Column(name="kerugianLingkungan",nullable=true)
	@Caption(value="Kerugian Lingkungan")
	private String kerugianLingkungan;
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "kecelakaanKerja")
	@Caption(value = "korbanSet")
	private Set<KorbanVO> korbanSet = new HashSet<KorbanVO>();
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "kecelakaanKerja")
	@Caption(value = "tindakanSet")
	private Set<TindakanKeselamatanKerjaVO> tindakanKeselamatanKerja = new HashSet<TindakanKeselamatanKerjaVO>();
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "kecelakaanKerja")
	@Caption(value = "saksiSet")
	private Set<SaksiVO> saksiSet = new HashSet<SaksiVO>();
	
}
