PersistenceProvider.fromEntityManager(entityManager));
PartTreeJpaQuery jpaQuery = new PartTreeJpaQuery(queryMethod, entityManager);
Query query = jpaQuery.createQuery(new Object[] { "Matthews", new PageRequest(0, 1) });
HibernateQuery hibernateQuery = getValue(query, "h.target." + (isHibernate43() ? "jpqlQuery" : "val$jpaqlQuery"));
assertThat(hibernateQuery.getHibernateQuery().getQueryString(), endsWith("firstname=:param0"));
query = jpaQuery.createQuery(new Object[] { null, new PageRequest(0, 1) });
hibernateQuery = getValue(query, "h.target." + (isHibernate43() ? "jpqlQuery" : "val$jpaqlQuery"));
assertThat(hibernateQuery.getHibernateQuery().getQueryString(), endsWith("firstname is null"));
}