Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.Index


    @Test
    public void pkLessRootNoData() throws Exception {
        int tid = createTable("s", "t", "i int");
        createIndex("s", "t", "i", "i");
        Table t = getTable(tid);
        Index pk = t.getIndexIncludingInternal(Index.PRIMARY);
        ddl().dropTable(session(), t.getName());
        expectNoTree(pk);
        expectNoTree(t);
    }
View Full Code Here


        createIndex("s", "t", "i", "i");
        writeRows(row(tid, 10L),
                  row(tid, 20L));
        Table t = getTable(tid);
        expectTree(t);
        Index pk = t.getIndexIncludingInternal(Index.PRIMARY);
        expectTree(pk);
        ddl().dropTable(session(), t.getName());
        expectNoTree(t);
        expectNoTree(pk);
    }
View Full Code Here

        int pid = createTable("s", "p", "id int not null primary key");
        int cid = createTable("s", "c", "i int, pid int, grouping foreign key(pid) references p(id)");
        createIndex("s", "c", "i", "i");
        Table p = getTable(pid);
        Table c = getTable(cid);
        Index pk = c.getIndexIncludingInternal(Index.PRIMARY);
        ddl().dropTable(session(), c.getName());
        expectNoTree(pk);
        ddl().dropTable(session(), p.getName());
        expectNoTree(c);
        expectNoTree(p);
View Full Code Here

        expectTree(p);
        writeRows(row(cid, 10L, 1L),
                  row(cid, 20L, 2L));
        Table c = getTable(cid);
        expectTree(c);
        Index pk = c.getIndexIncludingInternal(Index.PRIMARY);
        expectTree(pk);
        ddl().dropTable(session(), c.getName());
        expectNoTree(pk);
        ddl().dropTable(session(), p.getName());
        expectNoTree(c);
View Full Code Here

        writeRows(row(cid, 10L, 1L),
                  row(cid, 20L, 1L),
                  row(cid, 30L, 2L));
        Table p = getTable(pid);
        expectTree(p);
        Index o = p.getIndex("o");
        expectTree(o);
        Table c = getTable(cid);
        expectTree(c);
        try {
            ddl().dropTable(session(), p.getName());
View Full Code Here

    public void dropTableInGroupIndexWithNoData() throws Exception {
        int pid = createTable("s", "p", "id int not null primary key, name varchar(32)");
        int cid = createTable("s", "c", "id int not null primary key, pid int, val int, grouping foreign key(pid) references p(id)");
        Table p = getTable(pid);
        Table c = getTable(cid);
        Index index = createLeftGroupIndex(p.getGroup().getName(), "name_val", "p.name", "c.val");
        ddl().dropTable(session(), c.getName());
        expectNoTree(index);
        ddl().dropTable(session(), p.getName());
        expectNoTree(c);
        expectNoTree(p);
View Full Code Here

    public void dropTableInGroupIndexWithData() throws Exception {
        int pid = createTable("s", "p", "id int not null primary key, name varchar(32)");
        int cid = createTable("s", "c", "id int not null primary key, pid int, val int, grouping foreign key(pid) references p(id)");
        Table p = getTable(pid);
        Table c = getTable(cid);
        Index index = createLeftGroupIndex(p.getGroup().getName(), "name_val", "p.name", "c.val");
        writeRows(row(pid, 1, "bob"),
                    row(cid, 1, 1, 100),
                    row(cid, 2, 1, 101),
                  row(pid, 2, "joe"),
                    row(cid, 3, 2, 102),
View Full Code Here

    public void dropGroupIndexWithNoData() throws Exception {
        int pid = createTable("s", "p", "id int not null primary key, name varchar(32)");
        int cid = createTable("s", "c", "id int not null primary key, pid int, val int, grouping foreign key(pid) references p(id)");
        Table p = getTable(pid);
        Table c = getTable(cid);
        Index index = createLeftGroupIndex(p.getGroup().getName(), "name_val", "p.name", "c.val");
        ddl().dropGroupIndexes(session(), p.getGroup().getName(), Collections.singleton("name_val"));
        ddl().dropTable(session(), c.getName());
        expectNoTree(index);
        ddl().dropTable(session(), p.getName());
        expectNoTree(c);
View Full Code Here

    public void dropGroupIndexWithData() throws Exception {
        int pid = createTable("s", "p", "id int not null primary key, name varchar(32)");
        int cid = createTable("s", "c", "id int not null primary key, pid int, val int, grouping foreign key(pid) references p(id)");
        Table p = getTable(pid);
        Table c = getTable(cid);
        Index index = createLeftGroupIndex(p.getGroup().getName(), "name_val", "p.name", "c.val");
        writeRows(row(pid, 1, "bob"),
                    row(cid, 1, 1, 100),
                    row(cid, 2, 1, 101),
                  row(pid, 2, "joe"),
                    row(cid, 3, 2, 102),
View Full Code Here

    @Test
    public void dropSingleTableWithGroupIndexWithNoData() throws Exception {
        int pid = createTable("s", "p", "id int not null primary key, name varchar(32)");
        int cid = createTable("s", "c", "cid int not null primary key, pid int, x int, grouping foreign key(pid) references p(id)");
        Table c = getTable(cid);
        Index index = createLeftGroupIndex(c.getGroup().getName(), "name", "c.x", "p.name");
        ddl().dropTable(session(), c.getName());
        expectNoTree(index);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.Index

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.