use of org.eclipse.persistence.sessions.changesets.UnitOfWorkChangeSet in project eclipselink by eclipse-ee4j.
the class DirectMapUnitOfWorkTest method test.
@Override
public void test() throws Exception {
// put a new value in, will now be in the cache
UnitOfWork uow1 = getSession().acquireUnitOfWork();
DirectMapMappings maps = (DirectMapMappings) uow1.registerObject(new DirectMapMappings());
maps.directMap.put(1, "bogus");
maps.directMap.put(3, "third");
uow1.commit();
UnitOfWork uow2 = getSession().acquireUnitOfWork();
DirectMapMappings mapsClone = (DirectMapMappings) uow2.registerObject(maps);
mapsClone.directMap.put(2, "axemen");
mapsClone.directMap.put(1, "guy");
UnitOfWorkChangeSet changes = uow2.getCurrentChanges();
uow2.commit();
ReadObjectQuery query = new ReadObjectQuery(mapsClone);
mapsQueryResult = (DirectMapMappings) getSession().executeQuery(query);
}
Aggregations