public <E> List<E> find(Class<E> entityClass, Object... primaryKeys)
    {
        List<E> entities = new ArrayList<E>();
        if (primaryKeys == null)
        {
            return entities;
        }
        Set<Object> pKeys = new HashSet<Object>(Arrays.asList(primaryKeys));
        for (Object primaryKey : pKeys)
        {
            E e = find(entityClass, primaryKey);
            if (e != null)
            {
                entities.add(e);
            }
        }
        return entities;
    }
public < E > List < E > find ( Class < E > entityClass , Object ... primaryKeys ) { List < E > entities = new ArrayList < E > ( ) ; if ( primaryKeys == null ) { return entities ; } Set < Object > pKeys = new HashSet < Object > ( Arrays . asList ( primaryKeys ) ) ; for ( Object primaryKey : pKeys ) { E e = find ( entityClass , primaryKey ) ; if ( e != null ) { entities . add ( e ) ; } } return entities ; }
TODO Is it possible to pass all primary keys directly to database client.