QUERY_PHONE_ID_BY_SERIAL_NUMBER, "value", serialNumber); if (SipxCollectionUtils.safeSize(objs) != 0) { if (objs.size() > 1) {   throw new IllegalStateException("Duplicate phone serial number: " + serialNumber); } phoneId = (Integer) objs.get(0); } return phoneId;
QUERY_PHONE_ID_BY_SERIAL_NUMBER, "value", Phone.cleanSerialNumber(serialNumber)); return (Integer) DaoUtils.requireOneOrZero(objs, QUERY_PHONE_ID_BY_SERIAL_NUMBER);
    public Integer getPhoneIdBySerialNumber(String serialNumber) {        Integer phoneId = null;        List objs = getHibernateTemplate().findByNamedQueryAndNamedParam(                QUERY_PHONE_ID_BY_SERIAL_NUMBER, "value", serialNumber);        if (SipxCollectionUtils.safeSize(objs) != 0) {            if (objs.size() > 1) {                // There is a database uniqueness constraint that should prevent this from ever                // happening                throw new IllegalStateException("Duplicate phone serial number: " + serialNumber);            }            phoneId = (Integer) objs.get(0);        }        return phoneId;    }