Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.TestAISBuilder.table()


        builder.joinTables("oi", "schema", "order", "schema", "item");
        builder.joinColumns("oi", "schema", "order", "order_id", "schema", "item", "order_id");
        builder.table("schema", "state");
        builder.column("schema", "state", "code", 0, "MCOMPAT", "varchar", 2L, null, false);
        builder.column("schema", "state", "name", 1, "MCOMPAT", "varchar", 50L, null, false);
        builder.table("schema", "customer2");
        builder.column("schema", "customer2", "customer_id", 0, "MCOMPAT", "int unsigned", false);
        builder.column("schema", "customer2", "customer_name", 1, "MCOMPAT", "VARCHAR", 64L, null,  false);
        builder.pk("schema", "customer2");
        builder.indexColumn("schema", "customer2", Index.PRIMARY, "customer_id", 0, true, null);
        builder.basicSchemaIsComplete();
View Full Code Here


       
    }

    private Schema caoiSchema() {
        TestAISBuilder builder = new TestAISBuilder(TestTypesRegistry.MCOMPAT);
        builder.table("schema", "customer");
        builder.column("schema", "customer", "customer_id", 0, "MCOMPAT", "int", false);
        builder.column("schema", "customer", "customer_name", 1, "MCOMPAT", "varchar", 64L, null, false);
        builder.pk("schema", "customer");
        builder.indexColumn("schema", "customer", Index.PRIMARY, "customer_id", 0, true, null);
        builder.table("schema", "order");
View Full Code Here

    private final TypesRegistry typesRegistry = TestTypesRegistry.MCOMPAT;

    @Test
    public void testSupportedCollation() {
        final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
        builder.table("test", "t1");
        builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "en_us");
        builder.basicSchemaIsComplete();
        Assert.assertEquals("Expect no validation failure for supported collation", 0, builder
                .akibanInformationSchema().validate(validations).failures().size());
    }
View Full Code Here

    public void testUnsupportedCollationStrictMode() {
        Mode save = AkCollatorFactory.getCollationMode();
        try {
            AkCollatorFactory.setCollationMode(Mode.STRICT);
            final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
            builder.table("test", "t1");
            builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "fricostatic_sengalese_ci");
            builder.basicSchemaIsComplete();
            Assert.assertEquals("Expect validation failure on invalid collation", 1, builder.akibanInformationSchema()
                    .validate(validations).failures().size());
        } catch (UnsupportedCollationException ex) {
View Full Code Here

    public void testUnsupportedCollationLooseMode() {
        Mode save = AkCollatorFactory.getCollationMode();
        try {
            AkCollatorFactory.setCollationMode(Mode.LOOSE);
            final TestAISBuilder builder = new TestAISBuilder(typesRegistry);
            builder.table("test", "t1");
            builder.column("test", "t1", "c1", 0, "MCOMPAT", "VARCHAR", 16L, true, null, "fricostatic_sengalese_ci");
            builder.basicSchemaIsComplete();
            Assert.assertEquals("Expect no validation failure in loose mode", 0, builder.akibanInformationSchema()
                    .validate(validations).failures().size());
        } finally {
View Full Code Here

    private AkibanInformationSchema factory () throws Exception
    {
        TypesRegistry typesRegistry = TestTypesRegistry.MCOMPAT;
        TestAISBuilder builder = new TestAISBuilder(typesRegistry);
        builder.table("s", "t");
        builder.column ("s", "t", "c1", 0, "MCOMPAT", "int", false);
        builder.pk("s", "t");
        builder.indexColumn("s", "t", "PRIMARY", "c1", 0, true, 0);
        builder.basicSchemaIsComplete();
        return builder.akibanInformationSchema();
View Full Code Here

                                                    schemaManager.getTypesRegistry(), schemaManager.getStorageFormatRegistry());

        {
        String schema = "test";
        String table = "foo";
        builder.table(schema, table);
        builder.column(schema, table, "c1", 0, "MCOMPAT", "INT", false);
        builder.column(schema, table, "c2", 1, "MCOMPAT", "DOUBLE", true);
        builder.createGroup(table, schema);
        builder.addTableToGroup(table, schema, table);
        // no defined pk or indexes
View Full Code Here

        }

        {
        String schema = "test";
        String table = "bar";
        builder.table(schema, table);
        builder.column(schema, table, "col", 0, "MCOMPAT", "BIGINT", false);
        builder.column(schema, table, "name", 1, "MCOMPAT", "INT", false);
        builder.pk(schema, table);
        builder.indexColumn(schema, table, Index.PRIMARY, "col", 0, true, null);
        builder.createGroup(table, schema);
View Full Code Here

        builder.createGroup(table, schema);

        schema = "test";
        String childTable = table + "2";
        String indexName = "foo_name";
        builder.table(schema, childTable);
        builder.column(schema, childTable, "foo", 0, "MCOMPAT", "INT", true);
        builder.column(schema, childTable, "pid", 1, "MCOMPAT", "INT", true);

        String joinName = childTable + "/" + table;
        builder.joinTables(joinName, schema, table, schema, childTable);
View Full Code Here

        {
        String schema = "zap";
        String table = "pow";
        String indexName = "name_value";
        builder.table(schema, table);
        builder.column(schema, table, "name", 0, "MCOMPAT", "VARCHAR", 32L, null, true);
        builder.column(schema, table, "value", 1, "MCOMPAT", "DECIMAL", 10L, 2L, true);
        builder.unique(schema, table, indexName);
        builder.indexColumn(schema, table, indexName, "name", 0, true, null);
        builder.indexColumn(schema, table, indexName, "value", 1, true, null);
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.