Examples of refreshSchemas()


Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                callback.insertInto(table).value("foo", 2).value("bar", "there").execute();
                callback.insertInto(table).value("foo", 3).value("bar", "world").execute();
            }
        });

        dc.refreshSchemas();

        return dc;
    }

    public void testLimit() throws Exception {
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                assertEquals("my_table", table.getName());
            }
        });

        try {
            dc.refreshSchemas();
            final Column column = dc.getColumnByQualifiedLabel("my_table.some_bytes");
            assertEquals("Column[name=some_bytes,columnNumber=1,type=BINARY,nullable=true,"
                    + "nativeType=bytea,columnSize=2147483647]", column.toString());

            final Table table = column.getTable();
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

            String message = e.getMessage().replaceAll("\n", " ");
            assertEquals(
                    "Could not execute batch: INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42'): Batch entry 0 INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42') was aborted.  Call getNextException to see the cause.",
                    message);
        } finally {
            dc.refreshSchemas();
            if (dc.getTableByQualifiedLabel("my_table") != null) {
                dc.executeUpdate(new UpdateScript() {
                    @Override
                    public void run(UpdateCallback cb) {
                        cb.dropTable("my_table").execute();
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                callback.insertInto(table).value("foo", 2).value("bar", "there").execute();
                callback.insertInto(table).value("foo", 3).value("bar", "world").execute();
            }
        });

        dc.refreshSchemas();

        return dc;
    }

    public void testLimit() throws Exception {
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                assertEquals("my_table", table.getName());
            }
        });

        try {
            dc.refreshSchemas();
            final Column column = dc.getColumnByQualifiedLabel("my_table.some_bytes");
            assertEquals("Column[name=some_bytes,columnNumber=1,type=BINARY,nullable=true,"
                    + "nativeType=bytea,columnSize=2147483647]", column.toString());

            final Table table = column.getTable();
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

        } catch (Exception e) {
            assertEquals(
                    "Could not execute batch: INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42'): Batch entry 0 INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42') was aborted.  Call getNextException to see the cause.",
                    e.getMessage());
        } finally {
            dc.refreshSchemas();
            if (dc.getTableByQualifiedLabel("my_table") != null) {
                dc.executeUpdate(new UpdateScript() {
                    @Override
                    public void run(UpdateCallback cb) {
                        cb.dropTable("my_table").execute();
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                callback.insertInto(table).value("foo", 2).value("bar", "there").execute();
                callback.insertInto(table).value("foo", 3).value("bar", "world").execute();
            }
        });

        dc.refreshSchemas();

        return dc;
    }

    public void testLimit() throws Exception {
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

                assertEquals("my_table", table.getName());
            }
        });

        try {
            dc.refreshSchemas();
            final Column column = dc.getColumnByQualifiedLabel("my_table.some_bytes");
            assertEquals("Column[name=some_bytes,columnNumber=1,type=BINARY,nullable=true,"
                    + "nativeType=bytea,columnSize=2147483647]", column.toString());

            final Table table = column.getTable();
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.refreshSchemas()

        } catch (Exception e) {
            assertEquals(
                    "Could not execute batch: INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42'): Batch entry 0 INSERT INTO \"public\".\"my_table\" (\"person name\",age) VALUES ('John Doe','42') was aborted.  Call getNextException to see the cause.",
                    e.getMessage());
        } finally {
            dc.refreshSchemas();
            if (dc.getTableByQualifiedLabel("my_table") != null) {
                dc.executeUpdate(new UpdateScript() {
                    @Override
                    public void run(UpdateCallback cb) {
                        cb.dropTable("my_table").execute();
View Full Code Here

Examples of org.eobjects.metamodel.DataContext.refreshSchemas()

    DataContextProvider dcp = datastore.getDataContextProvider();
    DataContext dc = dcp.getDataContext();

    // It is likely that schemas are cached, and since it is likely a new
    // table, we refresh the schema.
    dc.refreshSchemas();

    Table table = dc.getDefaultSchema().getTableByName(_tableName);
    dcp.close();
    return table;
  }
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.