}
}
public void testUnencodedStringPk_BatchGet() throws EntityNotFoundException {
switchDatasource(EntityManagerFactoryName.nontransactional_ds_non_transactional_ops_allowed);
HasUnencodedStringPkJPA pojo = new HasUnencodedStringPkJPA();
beginTxn();
pojo.setId("yar1");
em.persist(pojo);
commitTxn();
HasUnencodedStringPkJPA pojo2 = new HasUnencodedStringPkJPA();
beginTxn();
pojo2.setId("yar2");
em.persist(pojo2);
commitTxn();
assertNotNull(pojo.getId());
assertNotNull(pojo2.getId());
beginTxn();
Query q = em.createQuery("select from " + HasUnencodedStringPkJPA.class.getName() + " b where id = :ids");
q.setParameter("ids", Utils.newArrayList(pojo.getId(), pojo2.getId()));
List<HasUnencodedStringPkJPA> pojos = (List<HasUnencodedStringPkJPA>) q.getResultList();
assertEquals(2, pojos.size());
// we should preserve order but right now we don't
Set<String> pks = Utils.newHashSet(pojos.get(0).getId(), pojos.get(1).getId());
assertEquals(pks, Utils.newHashSet("yar1", "yar2"));