docs: private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
      {
          Criteria crit = new Criteria();
          ArrayList values = new ArrayList(ids.size());
          Iterator iter = ids.iterator();
          Identity id;
  
          while (iter.hasNext())
          {
              id = (Identity) iter.next();
              values.add(id.getPrimaryKeyValues()[0]);
          }
  
          switch (values.size())
          {
              case 0:
                  break;
              case 1:
                  crit.addEqualTo(field.getAttributeName(), values.get(0));
                  break;
              default:
                  // create IN (...) for the single key field
                  crit.addIn(field.getAttributeName(), values);
                  break;
          }
  
          return crit;
      }