package info.bukova.isspst.data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "NUMBERSERIES")
public class NumberSeries extends BaseSimpleData
{
	@Column(name = "MODULE")
	private String module;

	@Column(name = "PREFIX")
	private String prefix;

	@Column(name = "NUMBER")
	private int number;

	@OneToOne
	@JoinColumn(name = "SEASON_ID")
	private Season season;

	public String getCurrentNumber()
	{
		return String.format("%s%06d", this.getPrefix(), this.getNumber());
	}

	public String getModule()
	{
		return module;
	}

	public void setModule(String module)
	{
		this.module = module;
	}

	public String getPrefix()
	{
		return prefix;
	}

	public void setPrefix(String prefix)
	{
		this.prefix = prefix;
	}

	public int getNumber()
	{
		return number;
	}

	public void setNumber(int number)
	{
		this.number = number;
	}

	public Season getSeason() {
		return season;
	}

	public void setSeason(Season season) {
		this.season = season;
	}
}
