Package org.gdbms.engine.values

Examples of org.gdbms.engine.values.Value


        AlphanumericDataSource d = (AlphanumericDataSource)
        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        Value v1 = d.getFieldValue(1, 0);
        Value v2 = d.getFieldValue(2, 0);
        d.deleteRow(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v1)).getValue());
        d.redo();
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v2)).getValue());
View Full Code Here


        AlphanumericDataSource d = (AlphanumericDataSource)
        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        Value v1 = d.getFieldValue(1, 0);
        d.insertEmptyRowAt(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v1)).getValue());
        d.redo();
        assertTrue(d.getFieldValue(1, 0) instanceof NullValue);
View Full Code Here

   
    public void testSpatialModifyUndoRedo() throws Exception {
        SpatialDataSource d = (SpatialDataSource)
        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();
View Full Code Here

                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        long rc = d.getRowCount();
        int fieldIndex = d.getFieldIndexByName("id");
        Value v1 = d.getFieldValue(1, fieldIndex);
        d.deleteRow(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, fieldIndex).equals(v1)).getValue());
        d.redo();
        assertTrue(rc == d.getRowCount() + 1);
View Full Code Here

   
    private Set getValuesSet(DataSource d) throws Exception {
        HashSet<Value> ret = new HashSet<Value>();
        for (int i = 0; i < d.getRowCount(); i++) {
            for (int j = 0; j < d.getDataSourceMetadata().getFieldCount(); j++) {
                Value v = d.getFieldValue(i, j);
                if (!(v instanceof NullValue)) {
                    ret.add(v);
                }
            }
        }
View Full Code Here

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

    Value value = ValueFactory.createValue("aaa'aaa");
   
    d.beginTrans();
    d.setFieldValue(0, 1, value);
    d.commitTrans();
View Full Code Here

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

    Value v1 = ValueFactory.createValue(4);
    Value v2 = ValueFactory.createValue("nombre");
    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"));

    d.beginTrans();
    d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
    d.commitTrans();
View Full Code Here

    }
   
    private void testEditingNullValues(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"));

        d.beginTrans();
        d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
        d.setFieldValue(0, 1, ValueFactory.createNullValue());
        d.commitTrans();
View Full Code Here

    }

    private void testRowCount(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"));

       
        d.beginTrans();
        int rc = (int) d.getRowCount();
        d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
View Full Code Here

    }
   
    private void testInsertAt(String dsName, int mode) throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) 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"));
       
        d.beginTrans();
        d.insertFilledRowAt(2, new Value[] {v1, v2, v3, v4, v5, v6});
        assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(ValueFactory.createValue(0))).getValue());
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.