Search in sources :

Example 1 with MyGeometry

use of org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.MyGeometry 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();
}
Also used : UnitOfWork(org.eclipse.persistence.sessions.UnitOfWork) WrappedSpatial(org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) MyGeometry(org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.MyGeometry) SampleGeometries(org.eclipse.persistence.testing.tests.spatial.jgeometry.SampleGeometries)

Aggregations

ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)1 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)1 MyGeometry (org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.MyGeometry)1 WrappedSpatial (org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial)1 SampleGeometries (org.eclipse.persistence.testing.tests.spatial.jgeometry.SampleGeometries)1