use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class Query_Basic_Tests method testReadNotNullGeometry.
/**
* Comparisons to geometry != NULL always fail.
*/
public void testReadNotNullGeometry() throws Exception {
ReadAllQuery roq = new ReadAllQuery(WrappedSpatial.class);
ExpressionBuilder eb = roq.getExpressionBuilder();
Expression selectionCriteria = eb.get("geometry").getField("geom").notNull();
roq.setSelectionCriteria(selectionCriteria);
List<WrappedSpatial> results = (List<WrappedSpatial>) session.executeQuery(roq);
assertNotNull(results);
int countAll = DeleteTests.countWrappedSpatial(session);
assertEquals("More then one found", countAll - 1, results.size());
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class Query_Basic_Tests method testMyGeometryGeomIsNull.
public void testMyGeometryGeomIsNull() throws Exception {
ReadAllQuery roq = new ReadAllQuery(WrappedSpatial.class);
ExpressionBuilder eb = new ExpressionBuilder(WrappedSpatial.class);
Expression geomExp = eb.get("geometry").getField("geom");
roq.setSelectionCriteria(geomExp.isNull());
List<WrappedSpatial> results = (List<WrappedSpatial>) session.executeQuery(roq);
assertNotNull(results);
assertEquals(1, results.size());
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class CreateTests method testInsertNullWithBinding.
public void testInsertNullWithBinding() throws Exception {
getSession().getLogin().setShouldBindAllParameters(true);
UnitOfWork uow = getSession().acquireUnitOfWork();
WrappedSpatial ss = (WrappedSpatial) uow.newInstance(WrappedSpatial.class);
ss.setId(123456789);
uow.writeChanges();
uow.release();
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class DeleteTests method testAnySingleDelete.
public void testAnySingleDelete() throws Exception {
int initialQuantity = countWrappedSpatial(session);
UnitOfWork uow = session.acquireUnitOfWork();
WrappedSpatial ss = (WrappedSpatial) uow.readObject(WrappedSpatial.class);
assertNotNull("No SimpleSpatial found", ss);
uow.deleteObject(ss);
uow.writeChanges();
int afterCount = countWrappedSpatial(uow);
assertEquals("Number of rows does not match", initialQuantity - 1, afterCount);
uow.release();
}
use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial in project eclipselink by eclipse-ee4j.
the class Query_SpatialOp_ExpReport_Tests method populateTestGeometry.
private void populateTestGeometry(JGeometry g) {
UnitOfWork uow = session.acquireUnitOfWork();
uow.registerNewObject(new WrappedSpatial(6666, 0, g));
uow.commit();
}
Aggregations