package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "running_number", uniqueConstraints = @UniqueConstraint(columnNames = { "reset", "kegunaan" }) )
public class RunningNumber implements Serializable {
	
	@Id
	@GeneratedValue
	private Long id;

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

	@NotNull
	@Min(1)
	@Column(name = "nomer_terbaru", nullable = false)
	private Integer nomerTerbaru = 0;

	@NotNull
	@NotEmpty
	@Column(nullable = false)
	private String kegunaan;

	@Column(name = "extention", nullable = true)
	private String extention;

	public Long getId() {
		return id;
	}

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

	public String getReset() {
		return reset;
	}

	public void setReset(String reset) {
		this.reset = reset;
	}

	public Integer getNomerTerbaru() {
		return nomerTerbaru;
	}

	public void setNomerTerbaru(Integer nomerTerbaru) {
		this.nomerTerbaru = nomerTerbaru;
	}

	public String getKegunaan() {
		return kegunaan;
	}

	public void setKegunaan(String kegunaan) {
		this.kegunaan = kegunaan;
	}

	public String getExtention() {
		return extention;
	}

	public void setExtention(String extention) {
		this.extention = extention;
	}

	

}