Package org.gdbms.engine.data

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


        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
        Value v1 = ValueFactory.createValue(1);
        Value v2 = ValueFactory.createValue(10);
       
        d.beginTrans();
        int fieldIndex = d.getFieldIndexByName("id");
        d.setFieldValue(0, fieldIndex, v2);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(0, fieldIndex).equals(v1)).getValue());
        d.redo();
View Full Code Here


        assertTrue(((BooleanValue) d.getFieldValue(0, fieldIndex).equals(v1)).getValue());
        d.redo();
        assertTrue(((BooleanValue) d.getFieldValue(0, fieldIndex).equals(v2)).getValue());
        d.rollBackTrans();
       
        d.beginTrans();
        d.buildIndex();
        d.setFieldValue(0, fieldIndex, v2);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(0, fieldIndex).equals(v1)).getValue());
        d.redo();
View Full Code Here

    public void testSpatialDeleteUndoRedo() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        long rc = d.getRowCount();
        int fieldIndex = d.getFieldIndexByName("id");
        Value v1 = d.getFieldValue(1, fieldIndex);
        d.deleteRow(1);
        d.undo();
View Full Code Here

        assertTrue(((BooleanValue) d.getFieldValue(1, fieldIndex).equals(v1)).getValue());
        d.redo();
        assertTrue(rc == d.getRowCount() + 1);
        d.rollBackTrans();
       
        d.beginTrans();
        d.buildIndex();
        v1 = d.getFieldValue(1, fieldIndex);
        d.deleteRow(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, fieldIndex).equals(v1)).getValue());
View Full Code Here

        assertTrue(((BooleanValue) d.getFieldValue(1, fieldIndex).equals(v1)).getValue());
        d.redo();
        assertTrue(d.getFieldValue(1, fieldIndex) instanceof NullValue);
        d.rollBackTrans();
       
        d.beginTrans();
        d.buildIndex();
        v1 = d.getFieldValue(1, fieldIndex);
        rc = d.getRowCount();
        d.deleteRow(1);
        d.undo();
View Full Code Here

    public void testSpatialInsertUndoRedo() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        long rc = d.getRowCount();
        int fieldIndex = d.getFieldIndexByName("id");
        d.getFieldValue(1, fieldIndex);
        d.insertEmptyRow();
        d.undo();
View Full Code Here

        assertTrue(rc == d.getRowCount());
        d.redo();
        assertTrue(rc == d.getRowCount() - 1);
        d.rollBackTrans();
       
        d.beginTrans();
        d.buildIndex();
        d.getFieldValue(1, fieldIndex);
        d.insertEmptyRow();
        d.undo();
        assertTrue(rc == d.getRowCount() - 1);
View Full Code Here

        assertTrue(rc == d.getRowCount() - 1);
        d.redo();
        assertTrue(rc == d.getRowCount() - 2);
        d.rollBackTrans();
       
        d.beginTrans();
        d.buildIndex();
        d.getFieldValue(1, fieldIndex);
        d.insertEmptyRow();
        rc = d.getRowCount();
        d.undo();
View Full Code Here

    public void testSpatialEditionUndoRedo() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        String snapshot1 = d.getAsString();
        d.setFieldValue(0, 1, ValueFactory.createValue(10d));
        String snapshot2 = d.getAsString();
        d.setFieldValue(0, 1, ValueFactory.createValue(12d));
        String snapshot3 = d.getAsString();
View Full Code Here

    public void testAddTwoRowsAndUndoBoth() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        ds.getDataSource("spatialobjectpersona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        d.buildIndex();
        Value[] row = d.getRow(0);
        long rc = d.getRowCount();
        d.insertFilledRow(row);
        d.insertFilledRow(row);
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.