DaoUtils.checkDuplicatesByNamedQuery(hibernate, phone, "phoneIdsWithSerialNumber", serialNumber, new DuplicateSerialNumberException(serialNumber));
DaoUtils.checkDuplicatesByNamedQuery(hibernate, phone, QUERY_PHONE_ID_BY_SERIAL_NUMBER, serialNumber, new DuplicateSerialNumberException(serialNumber));
    public void storePhone(Phone phone) {        HibernateTemplate hibernate = getHibernateTemplate();        String serialNumber = phone.getSerialNumber();        DaoUtils.checkDuplicatesByNamedQuery(hibernate, phone, "phoneIdsWithSerialNumber", serialNumber,                new DuplicateSerialNumberException(serialNumber));        phone.setValueStorage(clearUnsavedValueStorage(phone.getValueStorage()));        hibernate.saveOrUpdate(phone);    }