Package org.gdbms.engine.data

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


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

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

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


        DataSource d = ds.getDataSource(dsName);

        d.beginTrans();
        Metadata m = d.getDataSourceMetadata();
        int fc = m.getFieldCount();
        d.addField("extra", type);
        m = d.getDataSourceMetadata();
        assertTrue(fc + 1 == m.getFieldCount());
        assertTrue(m.getFieldName(fc).equals("extra"));
        assertTrue(m.getFieldType(fc) == Value.STRING);
        assertTrue(!in(m.getPrimaryKey(), "extra"));
View Full Code Here

        d.beginTrans();
        EditionListenerCounter elc = new EditionListenerCounter();
        d.addMetadataEditionListener(elc);
        d.removeField(1);
        d.addField("nuevo", type);
        d.setFieldName(1, "jjjj");
        assertTrue(elc.fieldDeletions == 1);
        assertTrue(elc.fieldInsertions == 1);
        assertTrue(elc.fieldModifications == 1);
        assertTrue(elc.total == 3);
View Full Code Here

    private void testEditionWithFieldAdded(String dsName, String type) throws Exception {
        DataSource d = ds.getDataSource(dsName,
                DataSourceFactory.UNDOABLE);
        d.beginTrans();
        d.addField("extra", type);
        int fi = d.getFieldIndexByName("extra");
        new UndoRedoTests()
                .testAlphanumericEditionUndoRedo((AlphanumericDataSource) d);
        d.setFieldValue(0, fi, ValueFactory.createValue(true));
        assertTrue(((BooleanValue) d.getFieldValue(0, fi)).getValue());
View Full Code Here

    public void testAddField() throws Exception {
        DataSource d = ds.getDataSource("sort");
       
        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");
View Full Code Here

       
        d = ds.getDataSource("hsqldbpersona");
       
        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");
View Full Code Here

        d = ds.getDataSource("hsqldbpersona");
       
        d.beginTrans();
        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();
       
View Full Code Here

    public void testDriverMetadataEdition() throws Exception {
        DataSource d = ds.getDataSource("hsqldbpersona");
       
        d.beginTrans();
        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();
       
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.