class DBReportRequestStateManager extends DBManager<ReportRequestState> implements ReportRequestStateManager {

    @Override
    public final ReportRequestState getState(final Device device) {
        Criterion crit = Restrictions.eq("device", device);
        List<ReportRequestState> results = getWithCriteria(Collections.singletonList(crit));
        if (results.isEmpty()) {
            return null;
        } else {
            LOGGER.debug("Retrieved ReportRequestState: {}", results.get(0));
            return results.get(0);
        }
    }

    public  DBReportRequestStateManager(final SessionFactory sessionFactory);

}