rollbackTxn();
}
}
public void testEncodedStringPk_SeparateNameField() throws EntityNotFoundException {
HasEncodedStringPkSeparateNameFieldJDO pojo = new HasEncodedStringPkSeparateNameFieldJDO();
pojo.setName("a name");
beginTxn();
pm.makePersistent(pojo);
commitTxn();
assertEquals(TestUtils.createKey(pojo, "a name"), KeyFactory.stringToKey(pojo.getId()));
Entity e = ds.get(KeyFactory.stringToKey(pojo.getId()));
beginTxn();
pojo = pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, e.getKey().getName());
assertEquals("a name", pojo.getName());
pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, e.getKey());
assertEquals("a name", pojo.getName());
pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, KeyFactory.keyToString(e.getKey()));
assertEquals("a name", pojo.getName());
commitTxn();
}