Package org.gdbms.engine.data

Examples of org.gdbms.engine.data.SpatialDataSource.beginTrans()


    public void testIndexedSpatialEditionUndoRedo() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        d.buildIndex();
        Set set1 = getValuesSet(d);
        d.setFieldValue(0, 1, ValueFactory.createValue(10));
        Set set2 = getValuesSet(d);
        d.setFieldValue(0, 1, ValueFactory.createValue(12));
View Full Code Here


    public void testClearHistoryAfterBuildIndex() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        d.deleteRow(1);
        assertTrue(d.canUndo());
        d.buildIndex();
        assertTrue(!d.canUndo());
        assertTrue(!d.canRedo());
View Full Code Here

    public void testInsertModify() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        d.buildIndex();
        int ri = (int) d.getRowCount();
        d.insertEmptyRow();
        d.setFieldValue(ri, 0, d.getFieldValue(0, 0));
        d.setFieldValue(ri, 1, d.getFieldValue(0, 1));
View Full Code Here

  private void testManyDeleteIndexedEdition(String dsName, Value geom)
      throws Exception {
    SpatialDataSource d = (SpatialDataSource) ds.getDataSource(dsName);

    d.beginTrans();
    d.buildIndex();
    d.deleteRow(0);
    d.deleteRow(1);
    d.commitTrans();
  }
View Full Code Here

  }

  private void testIndexedEdition(String dsName, Value geom) throws Exception {
    SpatialDataSource d = (SpatialDataSource) ds.getDataSource(dsName);

    d.beginTrans();
    d.buildIndex();
    long originalRowCount = d.getRowCount();
    d.deleteRow(0);
    assertTrue(d.getRowCount() == originalRowCount);
    try {
View Full Code Here

    gpx.lineTo(2449.44777522841, 152.70207120894);
    gpx.lineTo(2434.9323374404, 152.807255540738);
    gpx.closePath();
    Geometry g = GeometryFactory.createPolygon2D(gpx);

    d.beginTrans();
    int sfi = d.getSpatialFieldIndex();
    Value gid = ValueFactory.createValue(1);
    for (int i = 0; i < d.getRowCount(); i++) {
      if (((BooleanValue) gid.equals(d.getFieldValue(i, 0))).getValue()) {
        d.setFieldValue(i, sfi, g);
View Full Code Here

  }

  private void testMetadata(String dsName) throws Exception {
    SpatialDataSource d = (SpatialDataSource) ds.getDataSource(dsName);

    d.beginTrans();
    d.commitTrans();

    SpatialDataSource d2 = (SpatialDataSource) ds.getDataSource(dsName);
    d2.start();
    d2.stop();
View Full Code Here

      ads.rollBackTrans();
    }

    if (d instanceof SpatialDataSource) {
      SpatialDataSource sds = (SpatialDataSource) d;
      sds.beginTrans();
      assertFalse(sds.isModified());
      sds.deleteRow(0);
      assertTrue(sds.isModified());
      sds.rollBackTrans();
View Full Code Here

      assertFalse(sds.isModified());
      sds.deleteRow(0);
      assertTrue(sds.isModified());
      sds.rollBackTrans();

      sds.beginTrans();
      assertFalse(sds.isModified());
      sds.insertEmptyRowAt(0);
      assertTrue(sds.isModified());
      sds.rollBackTrans();
View Full Code Here

      assertFalse(sds.isModified());
      sds.insertEmptyRowAt(0);
      assertTrue(sds.isModified());
      sds.rollBackTrans();

      sds.beginTrans();
      assertFalse(sds.isModified());
      sds.insertFilledRowAt(0, sds.getRow(0));
      assertTrue(sds.isModified());
      sds.rollBackTrans();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.