package gov.va.vss.persistence.impl;

import org.springframework.stereotype.Repository;

import gov.va.vss.model.volunteer.AvailableIdentifyingCode;
import gov.va.vss.persistence.dao.AvailableIdentifyingCodeDAO;

@Repository
public class AvailableIdentifyingCodeDAOImpl extends GenericHibernateDAOImpl<AvailableIdentifyingCode>
		implements AvailableIdentifyingCodeDAO {

	@Override
	public AvailableIdentifyingCode getFirstUnused() {
		return (AvailableIdentifyingCode) em
				.createQuery("from " + AvailableIdentifyingCode.class.getName() + " order by id").setMaxResults(1)
				.getSingleResult();
	}

}
