1000), true, ObjectIdQuery.CACHE_REFRESH);
assertEquals(1, context.performQuery(q).size());
}
public void testGeneratedKey() throws Exception {
MeaningfulPKTest1 obj = context.newObject(MeaningfulPKTest1.class);
obj.setDescr("aaa-aaa");
context.commitChanges();
assertNotNull(obj.getPkAttribute());
assertSame(obj, Cayenne.objectForPK(context, MeaningfulPKTest1.class, obj
.getPkAttribute()));
int id = Cayenne.intPKForObject(obj);
Map snapshot = context.getObjectStore().getDataRowCache().getCachedSnapshot(
obj.getObjectId());
assertNotNull(snapshot);
assertTrue(snapshot.containsKey(MeaningfulPKTest1.PK_ATTRIBUTE_PK_COLUMN));
assertEquals(new Integer(id), snapshot
.get(MeaningfulPKTest1.PK_ATTRIBUTE_PK_COLUMN));
}