package info.bukova.isspst.services.numberseries;

import info.bukova.isspst.data.NumberSeries;
import info.bukova.isspst.services.AbstractService;

import org.springframework.transaction.annotation.Transactional;

public class NumberSeriesServiceImpl extends AbstractService<NumberSeries> implements NumberSeriesService
{
	@Transactional
	@Override
	public NumberSeries getNumberSerie(String module)
	{
		return this.selectSingle("from NumberSeries where MODULE = '" + module + "'");
	}

	@Transactional
	@Override
	public void increase(NumberSeries ns)
	{
		ns.setNumber(ns.getNumber() + 1);
		this.update(ns);
	}
}
