Package org.apache.metamodel

Examples of org.apache.metamodel.BatchUpdateScript


        }

        JdbcDataContext dc = new JdbcDataContext(getConnection());
        final Schema schema = dc.getDefaultSchema();
        try {
            dc.executeUpdate(new BatchUpdateScript() {
                @Override
                public void run(UpdateCallback cb) {
                    Table table = cb.createTable(schema, "my_table").withColumn("id").ofType(ColumnType.INTEGER)
                            .ofNativeType("SERIAL").nullable(false).withColumn("person name").ofSize(255)
                            .withColumn("age").ofType(ColumnType.INTEGER).execute();
View Full Code Here


                    callback.dropTable(schema.getTableByName(tableName)).execute();
                }
            });
        }

        dc.executeUpdate(new BatchUpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                Table table = cb.createTable(schema, tableName).withColumn("id").asPrimaryKey()
                        .ofType(ColumnType.INTEGER).withColumn("birthdate").ofType(ColumnType.DATE)
                        .withColumn("wakemeup").ofType(ColumnType.TIME).execute();
View Full Code Here

                    callback.dropTable(schema.getTableByName(tableName)).execute();
                }
            });
        }

        dc.executeUpdate(new BatchUpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                Table table = cb.createTable(schema, tableName).withColumn("id").asPrimaryKey().ofType(ColumnType.INTEGER)
                        .withColumn("birthdate").ofType(ColumnType.DATE).withColumn("wakemeup").ofType(ColumnType.TIME).execute();
View Full Code Here

TOP

Related Classes of org.apache.metamodel.BatchUpdateScript

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.