package com.dacrt.SBIABackend.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.springframework.lang.NonNull;

@Entity
@Table(name = "workers",schema = "main")
public class Workers {
	
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	
	@NotNull
	private String name;
	
	@NotNull
	private int status;
	
	@NonNull
	@Column(columnDefinition = "timestamp without time zone NOT NULL default now()")
	private Date createdat;
	
	@NonNull
	@Column(columnDefinition = "timestamp without time zone NOT NULL default now()")
	private Date modifiedat;
	
	private String ref;
	
	@ManyToOne
    @JoinColumn(name = "positionunitid")
	private Positionunits positionunitid;
	
	public Workers() {
	}

	public Workers(Integer id, @NotNull String name, @NotNull int status, Date createdat, Date modifiedat, String ref,
			Positionunits positionunitid) {
		super();
		this.id = id;
		this.name = name;
		this.status = status;
		this.createdat = createdat;
		this.modifiedat = modifiedat;
		this.ref = ref;
		this.positionunitid = positionunitid;
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public int getStatus() {
		return status;
	}


	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreatedat() {
		return createdat;
	}

	public void setCreatedat(Date createdat) {
		this.createdat = createdat;
	}

	public Date getModifiedat() {
		return modifiedat;
	}

	public void setModifiedat(Date modifiedat) {
		this.modifiedat = modifiedat;
	}

	public String getRef() {
		return ref;
	}

	public void setRef(String ref) {
		this.ref = ref;
	}

	public Positionunits getPositionunitid() {
		return positionunitid;
	}

	public void setPositionunitid(Positionunits positionunitid) {
		this.positionunitid = positionunitid;
	}

}