DaoUtils.checkDuplicates(hibernate, gateway, "name", new DuplicateNameException(gateway .getName())); DaoUtils.checkDuplicates(hibernate, gateway, "serialNumber",
DaoUtils.checkDuplicates(hibernate, Gateway.class, gateway, "name", new DuplicateNameException(gateway.getName())); DaoUtils.checkDuplicates(hibernate, Gateway.class, gateway, "serialNumber",
    public void storeGateway(Gateway gateway) {        // Before storing the gateway, make sure that it has a unique name.        // Throw an exception if it doesn't.        HibernateTemplate hibernate = getHibernateTemplate();        DaoUtils.checkDuplicates(hibernate, gateway, "name", new DuplicateNameException(gateway                .getName()));        DaoUtils.checkDuplicates(hibernate, gateway, "serialNumber",                new DuplicateSerialNumberException(gateway.getSerialNumber()));        // Store the updated gateway        hibernate.saveOrUpdate(gateway);        m_replicationContext.generate(DataSet.CALLER_ALIAS);    }