dialPlan.duplicateRules(selectedRows);
List rules = dialPlan.getRules(); Collection selectedRules = DataCollectionUtil.findByPrimaryKey(rules, selectedRows.toArray()); for (Iterator i = selectedRules.iterator(); i.hasNext();) { DialingRule rule = (DialingRule) i.next();   DialingRule ruleDup = (DialingRule) duplicateBean(rule, QUERY_DIALING_RULE_IDS_WITH_NAME);  rules.add(ruleDup); } DataCollectionUtil.updatePositions(rules);
    public void duplicateRules(Collection selectedRows) {        DialPlan dialPlan = getDialPlan();        dialPlan.duplicateRules(selectedRows);        getHibernateTemplate().saveOrUpdate(dialPlan);    }