Package org.gdbms.engine.values

Examples of org.gdbms.engine.values.Value


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

    Value v1 = ValueFactory.createValue(4);
    Value v2 = ValueFactory.createNullValue();
    Value v3 = ValueFactory.createValue("apellido");
    Value v4 = ValueFactory.createValue(Date.valueOf("1998-09-05"));
    Value v5 = ValueFactory.createValue(Time.valueOf("4:30:01"));
    Value v6 = ValueFactory.createValue(Timestamp.valueOf("2005-09-05 4:30:01.666666666"));
    Value v7 = ValueFactory.createValue(3);
   
    d.beginTrans();
    d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6, v7});
    d.setFieldValue(0, 1, ValueFactory.createNullValue());
    d.commitTrans();
View Full Code Here


        ddm.addField("nombre", "STRING");
        ds.createDataSource(new FileSourceCreation(new File(path),
                ddm));
        ds.registerDataSource("persona_created", new FileSourceDefinition(path));
       
        Value v1 = ValueFactory.createValue("Fernando");
        Value v2 = ValueFactory.createValue("Gonz�lez");

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

        d.beginTrans();
        d.insertFilledRow(new Value[]{
View Full Code Here

    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);
      }
    }
    d.commitTrans();

    d.start();
    Geometry g2 = null;
    for (int i = 0; i < d.getRowCount(); i++) {
      if (((BooleanValue) gid.equals(d.getFieldValue(i, 0))).getValue()) {
        g2 = (Geometry) d.getFieldValue(i, sfi);
      }
    }
    d.stop();
View Full Code Here

    for (int i = 0; i < previous.length; i++) {
      for (int j = 0; j < previous[i].length; j++) {
        previous[i][j] = d.getFieldValue(i, j);
      }
    }
    Value nv2 = ValueFactory.createValue(3.0);
    d.insertEmptyRow();
    d.setFieldValue(d.getRowCount() - 1, 0, geom);
    d.setFieldValue(d.getRowCount() - 1, 1, nv2);
    d.commitTrans();
View Full Code Here

    GeneralPathX gpx = new GeneralPathX();
    gpx.moveTo(0, 0);
    gpx.lineTo(10, 10);
    gpx.lineTo(10, 15);
    Geometry geom = GeometryFactory.createPolyline2D(gpx);
    Value nv2 = ValueFactory.createValue(3.0);
    int n = 10000;
    for (int i = 0; i < n; i++) {
      d.insertEmptyRow();
      d.setFieldValue(d.getRowCount() - 1, 0, geom);
      d.setFieldValue(d.getRowCount() - 1, 1, nv2);
View Full Code Here

public class BoundingBoxTests extends DataSourceTestCase {

    private void compareDataSource(SpatialDataSource sds) throws DriverException {
        for (int i = 0; i < sds.getRowCount(); i++) {
            Value v = sds.getFieldValue(i, sds.getSpatialFieldIndex());
            if (!(v instanceof NullValue)) {
                IGeometry g = (IGeometry) v;
                assertTrue(g.getBounds2D().equals(sds.getGeometryBounds(i)));
            } else {
                assertTrue(sds.getGeometryBounds(i) == null);
View Full Code Here

        GeneralPathX cgp = new GeneralPathX();
        cgp.moveTo(0, 0);
        cgp.lineTo(10, 10);
        cgp.lineTo(0, 10);
        Value[] row = sds.getRow(0);
        Value g = GeometryFactory.createPolygon2D(cgp);
        row[sds.getSpatialFieldIndex()] = g;
        sds.insertFilledRow(row);
        compareDataSource(sds);
        sds.setFieldValue(0, sds.getSpatialFieldIndex(), g);
        compareDataSource(sds);
View Full Code Here

    private void testObjectFieldDeletionEditionWhileEdition(String dsName)
            throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource(dsName);
        Value v1 = ValueFactory.createValue("freestyle");
        Value v2 = ValueFactory.createValue(9);
        d.beginTrans();
        d.deleteRow(0);
        d.setFieldValue(0, 2, v1);
        d.removeField(1);
        assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(v1)).getValue());
View Full Code Here

    }

    private void testFieldDeletionEditionWhileEdition(String dsName, String id)
            throws Exception {

        Value v1 = ValueFactory.createValue("freestyle");
        Value v2 = ValueFactory.createValue(9);
        testObjectFieldDeletionEditionWhileEdition(dsName);

        DataSource newd = ds.executeSQL("select * from " + dsName + " where "
                + id + " = 9;");
        newd.start();
View Full Code Here

    private void testFieldInsertionEditionWhileEdition(String dsName, String type)
            throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource(dsName);
        Value v1 = ValueFactory.createValue("freestyle");
        Value v2 = ValueFactory.createValue(9);
        d.beginTrans();
        int lastField = d.getDataSourceMetadata().getFieldCount();
        d.deleteRow(0);
        d.setFieldValue(0, 2, v1);
        d.addField("nuevo", type);
View Full Code Here

TOP

Related Classes of org.gdbms.engine.values.Value

Copyright © 2018 www.massapicom. 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.