private Criteria buildPrefetchCriteriaMultipleKeys(Collection ids, FieldDescriptor fields[])
    {
        Criteria crit = new Criteria();
        Iterator iter = ids.iterator();
        Object[] val;
        Identity id;

        while (iter.hasNext())
        {
            Criteria c = new Criteria();
            id = (Identity) iter.next();
            val = id.getPrimaryKeyValues();
            for (int i = 0; i < val.length; i++)
            {
                if (val[i] == null)
                {
                    c.addIsNull(fields[i].getAttributeName());
                }
                else
                {
                    c.addEqualTo(fields[i].getAttributeName(), val[i]);
                }
            }
            crit.addOrCriteria(c);
        }

        return crit;
    }
private Criteria buildPrefetchCriteriaMultipleKeys ( Collection ids , FieldDescriptor fields [ ] ) { Criteria crit = new Criteria ( ) ; Iterator iter = ids . iterator ( ) ; Object [ ] val ; Identity id ; while ( iter . hasNext ( ) ) { Criteria c = new Criteria ( ) ; id = ( Identity ) iter . next ( ) ; val = id . getPrimaryKeyValues ( ) ; for ( int i = 0 ; i < val . length ; i ++ ) { if ( val [ i ] == null ) { c . addIsNull ( fields [ i ] . getAttributeName ( ) ) ; } else { c . addEqualTo ( fields [ i ] . getAttributeName ( ) , val [ i ] ) ; } } crit . addOrCriteria ( c ) ; } return crit ; }
Build the Criteria using multiple ORs
@param ids collection of identities
@param fields
@return Criteria