Package org.gdbms.engine.data

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


    }
    Value nv2 = ValueFactory.createValue(3.0);
    d.insertEmptyRow();
    d.setFieldValue(d.getRowCount() - 1, 0, geom);
    d.setFieldValue(d.getRowCount() - 1, 1, nv2);
    d.commitTrans();

    d = ds.getDataSource(dsName);
    d.start();
    for (int i = 0; i < previous.length; i++) {
      for (int j = 0; j < previous[i].length; j++) {
View Full Code Here


    d.setFieldValue(1, 1, ValueFactory.createValue("edicion2"));
    d.setFieldValue(1, 2, ValueFactory.createValue("edicion2"));
    d.setFieldValue(3, 1, ValueFactory.createValue("edicion3"));
    d.setFieldValue(3, 0, ValueFactory.createValue(3));

    d.commitTrans();

    d = ds.getDataSource(dsName);
    d.start();
    assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(0))).getValue());
    assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("edicion1"))).getValue());
View Full Code Here

    for (int i = 0; i < n; i++) {
      d.insertEmptyRow();
      d.setFieldValue(d.getRowCount() - 1, 0, geom);
      d.setFieldValue(d.getRowCount() - 1, 1, nv2);
    }
    d.commitTrans();

    d = ds.getDataSource("big");
    d.start();
    assertTrue(d.getRowCount() == n);
    for (int i = 0; i < n; i++) {
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();
    assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(10))).getValue());
    d.stop();
View Full Code Here

    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;");
    d.start();
    assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(10))).getValue());
    assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("nombre"))).getValue());
View Full Code Here

        d.beginTrans();
        int fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "STRING");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc) == "STRING");
        d.commitTrans();
       
        d = ds.getDataSource("sort");
        d.start();
        assertTrue(d.getDataSourceMetadata().getFieldCount() == fc + 1);
        assertTrue(d.getDriverMetadata().getFieldCount() == fc + 1);
View Full Code Here

        d.beginTrans();
        fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "BIT");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.BOOLEAN);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("BIT"));
        d.commitTrans();
       
        d = ds.getDataSource("hsqldbpersona");
        d.start();
        assertTrue(d.getDataSourceMetadata().getFieldCount() == fc + 1);
        assertTrue(d.getDriverMetadata().getFieldCount() == fc + 1);
View Full Code Here

        fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo2", "CHAR");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("CHAR"));
        assertTrue(d.getDriverMetadata().getFieldParam(fc, "LENGTH") == null);
        d.commitTrans();
       
        d = ds.getDataSource("hsqldbpersona");
        d.start();
        assertTrue(d.getDataSourceMetadata().getFieldCount() == fc + 1);
        assertTrue(d.getDriverMetadata().getFieldCount() == fc + 1);
View Full Code Here

    d.beginTrans();
    long countBefore = d.getRowCount();
    d.insertFilledRow(new Value[] { ValueFactory.createValue(55),
        ValueFactory.createValue(55),
        GeometryFactory.createPoint2D(0, 0) });
    d.commitTrans();

    d.start();
    assertTrue(d.getRowCount() - 1 == countBefore);
    d.stop();
  }
View Full Code Here

        int fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "CHAR", new String[]{"LENGTH"}, new String[]{"5"});
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("CHAR"));
        assertTrue(d.getDriverMetadata().getFieldParam(fc, "LENGTH").equals("5"));
        d.commitTrans();
       
        d = ds.getDataSource("hsqldbpersona");
        d.start();
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("CHAR"));
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.