use of org.eclipse.persistence.testing.tests.spatial.jgeometry.SampleGeometries in project eclipselink by eclipse-ee4j.
the class UpdateTests method testReplaceExisting.
public void testReplaceExisting() {
UnitOfWork uow = session.acquireUnitOfWork();
WrappedSpatial ws = (WrappedSpatial) uow.readObject(WrappedSpatial.class, new ExpressionBuilder().get("id").equal(1001));
assertNotNull("No WrappedSpatial instances found", ws);
MyGeometry geom = new MyGeometry(30, new SampleGeometries().simplyPolygon());
ws.setGeometry(geom);
uow.writeChanges();
uow.release();
}
use of org.eclipse.persistence.testing.tests.spatial.jgeometry.SampleGeometries in project eclipselink by eclipse-ee4j.
the class WrappedSpatialTestCase method repopulate.
public static void repopulate(DatabaseSession session, boolean replaceTables) throws Exception {
if (replaceTables) {
replaceTables(session);
}
UnitOfWork uow = session.acquireUnitOfWork();
List existing = uow.readAllObjects(WrappedSpatial.class);
uow.deleteAllObjects(existing);
uow.commit();
session.getIdentityMapAccessor().initializeIdentityMaps();
SampleGeometries samples = new SampleGeometries(DEFAULT_SRID);
uow = session.acquireUnitOfWork();
uow.registerAllObjects(samples.wrappedPopulation());
uow.commit();
assertEquals(samples.wrappedPopulation().size(), countWrappedSpatial(session));
session.getIdentityMapAccessor().initializeIdentityMaps();
}
Aggregations