use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial 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.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class UpdateTests method testUpdateSingleToNull.
public void testUpdateSingleToNull() throws Exception {
UnitOfWork uow = session.acquireUnitOfWork();
WrappedSpatial ws = (WrappedSpatial) uow.readObject(WrappedSpatial.class, new ExpressionBuilder().get("geometry").notNull());
assertNotNull("No WrappedSpatial instances found", ws);
ws.setGeometry(null);
uow.writeChanges();
uow.release();
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class Query_SpatialOp_ExpExp_Tests method populateTestGeometry.
private void populateTestGeometry(JGeometry g) {
UnitOfWork uow = session.acquireUnitOfWork();
uow.registerNewObject(new WrappedSpatial(6666, 0, g));
uow.commit();
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class SampleGeometries method wrappedPopulation.
public List<WrappedSpatial> wrappedPopulation() throws Exception {
List<WrappedSpatial> population = new ArrayList<WrappedSpatial>();
population.add(new WrappedSpatial(1000, 1, pointCluster1()));
population.add(new WrappedSpatial(1001, 2, pointCluster2()));
population.add(new WrappedSpatial(1002, 3, simplyPolygon()));
population.add(new WrappedSpatial(1003, 4, polygonOfCircularArcs()));
population.add(new WrappedSpatial(1004, 5, circle()));
population.add(new WrappedSpatial(1005, 6, rectangle()));
population.add(new WrappedSpatial(1006, 7, compoundLineAndRectangle()));
population.add(new WrappedSpatial(1007, 8, compoundPolygonWithRectangularHole()));
population.add(new WrappedSpatial(1008, 9, geometry1008()));
population.add(new WrappedSpatial(1009, 10, geometryWithNulls()));
population.add(new WrappedSpatial(1010, 11, null));
population.add(new WrappedSpatial(1011, 12, polygon1011()));
population.add(new WrappedSpatial(1012, 13, polygon1012()));
population.add(new WrappedSpatial(1013, 14, point()));
return population;
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class CreateTests method testInsertNullWithoutBinding.
public void testInsertNullWithoutBinding() throws Exception {
getSession().getLogin().setShouldBindAllParameters(false);
UnitOfWork uow = getSession().acquireUnitOfWork();
WrappedSpatial ss = (WrappedSpatial) uow.newInstance(WrappedSpatial.class);
ss.setId(123456789);
uow.writeChanges();
uow.release();
}
Aggregations