commitTxn();
}
public void testUnencodedLongPk_BatchGet() throws EntityNotFoundException {
switchDatasource(PersistenceManagerFactoryName.nontransactional);
HasLongPkJDO pojo = new HasLongPkJDO();
beginTxn();
pojo.setId(1L);
pm.makePersistent(pojo);
commitTxn();
HasLongPkJDO pojo2 = new HasLongPkJDO();
beginTxn();
pojo2.setId(2L);
pm.makePersistent(pojo2);
commitTxn();
assertNotNull(pojo.getId());
assertNotNull(pojo2.getId());
beginTxn();
Query q = pm.newQuery("select from " + HasLongPkJDO.class.getName() + " where id == :ids");
List<HasLongPkJDO> pojos =
(List<HasLongPkJDO>) q.execute(Utils.newArrayList(pojo.getId(), pojo2.getId()));
assertEquals(2, pojos.size());
// we should preserve order but right now we don't
Set<Long> pks = Utils.newHashSet(pojos.get(0).getId(), pojos.get(1).getId());
assertEquals(pks, Utils.newHashSet(1L, 2L));
commitTxn();