Package org.gdbms.engine.data

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


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

    Value[][] previous;

    d.beginTrans();
    previous = new Value[(int) d.getRowCount()][d.getDataSourceMetadata()
        .getFieldCount()];
    for (int i = 0; i < previous.length; i++) {
      for (int j = 0; j < previous[i].length; j++) {
        previous[i][j] = d.getFieldValue(i, j);
View Full Code Here


    ds.registerDataSource("big", new SpatialFileSourceDefinition(new File(
        "src/test/resources/big.shp")));

    DataSource d = ds.getDataSource("big");

    d.beginTrans();
    GeneralPathX gpx = new GeneralPathX();
    gpx.moveTo(0, 0);
    gpx.lineTo(10, 10);
    gpx.lineTo(10, 15);
    Geometry geom = GeometryFactory.createPolyline2D(gpx);
View Full Code Here

    }
 
  private void testUpdatePK(String dsName, int mode) throws Exception{
    DataSource d = ds.getDataSource(dsName);

    d.beginTrans();
    d.setFieldValue(0, 0, ValueFactory.createValue(10));
    d.commitTrans();

    d = ds.executeSQL("select * from " + dsName + " where ID = 10;");
    d.start();
View Full Code Here

  }

  private void testIsModified(String dsName) throws Exception {
    DataSource d = ds.getDataSource(dsName);

    d.beginTrans();
    assertFalse(d.isModified());
    d.insertEmptyRow();
    assertTrue(d.isModified());
    d.rollBackTrans();
View Full Code Here

    }
 
  private void testUpdatePKUpdatedRow(String dsName, int mode) throws Exception {
    DataSource d = ds.getDataSource(dsName);

    d.beginTrans();
        d.setFieldValue(0, 0, ValueFactory.createValue(10));
    d.setFieldValue(0, 1, ValueFactory.createValue("nombre"));
    d.commitTrans();

    d = ds.executeSQL("select * from " + dsName + " where ID = 10;");
View Full Code Here

    assertFalse(d.isModified());
    d.insertEmptyRow();
    assertTrue(d.isModified());
    d.rollBackTrans();

    d.beginTrans();
    assertFalse(d.isModified());
    d.insertFilledRow(d.getRow(0));
    assertTrue(d.isModified());
    d.rollBackTrans();
View Full Code Here

    assertFalse(d.isModified());
    d.insertFilledRow(d.getRow(0));
    assertTrue(d.isModified());
    d.rollBackTrans();

    d.beginTrans();
    assertFalse(d.isModified());
    d.removeField(1);
    assertTrue(d.isModified());
    d.rollBackTrans();
View Full Code Here

    }

  private void testValuesDuringEdition(String dsName, int mode) throws Exception{
    DataSource d = ds.getDataSource(dsName);

    d.beginTrans();
    d.setFieldValue(0, 0, ValueFactory.createValue(10));
    assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(10))).getValue());
    assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("fernando"))).getValue());
    d.setFieldValue(0, 1, ValueFactory.createValue("nombre"));
    assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("nombre"))).getValue());
View Full Code Here

    assertFalse(d.isModified());
    d.removeField(1);
    assertTrue(d.isModified());
    d.rollBackTrans();

    d.beginTrans();
    assertFalse(d.isModified());
    d.addField("name", d.getDriverMetadata().getFieldType(0));
    assertTrue(d.isModified());
    d.rollBackTrans();
View Full Code Here

    assertFalse(d.isModified());
    d.addField("name", d.getDriverMetadata().getFieldType(0));
    assertTrue(d.isModified());
    d.rollBackTrans();

    d.beginTrans();
    assertFalse(d.isModified());
    d.setFieldName(1, "asd");
    assertTrue(d.isModified());
    d.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.