code: public static <E extends Identifiable> List<E> findByPrimaryKeys(EntityManager em, List<BigInteger> ids, Class<E> type) {
          requireArgument(em != null, "The entity manager cannot be null.");
          requireArgument(ids != null && !ids.isEmpty(), "IDs cannot be null or empty.");
          requireArgument(type != null, "The entity type cannot be null.");
  
          TypedQuery<E> query = em.createNamedQuery("JPAEntity.findByPrimaryKeys", type);
  
          query.setHint("javax.persistence.cache.storeMode", "REFRESH");
          try {
              query.setParameter("ids", ids);
              query.setParameter("deleted", false);
              return query.getResultList();
          } catch (NoResultException ex) {
              return new ArrayList<>(0);
          }
      }
docs: Finds JPA entities by their primary keys.
  
  @param   <E>   The JPA entity type.
  @param   em    The entity manager to use.  Cannot be null.
  @param   ids    The list of IDs of the entities to find.  Must be a non-null non-empty list.
  @param   type  The runtime type to cast the result value to.
  
  @return  The corresponding entity or null if no entity exists.