Package com.foundationdb.ais.model.aisb2

Examples of com.foundationdb.ais.model.aisb2.NewAISBuilder.sequence()


    @Test
    public void sequenceSimple () {
        TableName seqName = new TableName (SCHEMA, "Sequence-1");
        NewAISBuilder builder = AISBBasedBuilder.create(typesTranslator());
        builder.defaultSchema(SCHEMA);
        builder.sequence(seqName.getTableName());
        AkibanInformationSchema inAIS = builder.ais();
        AkibanInformationSchema outAIS = writeAndRead(inAIS);
        assertNotNull(outAIS.getSequence(new TableName(SCHEMA, "Sequence-1")));
        Sequence sequence = outAIS.getSequence(new TableName(SCHEMA, "Sequence-1"));
        assertEquals(1, sequence.getStartsWith());
View Full Code Here


   
    @Test
    public void sequenceComplex() {
        NewAISBuilder builder = AISBBasedBuilder.create(typesTranslator());
        builder.defaultSchema(SCHEMA);
        builder.sequence("sequence-2", 42, -2, true);
        AkibanInformationSchema inAIS = builder.ais();
        AkibanInformationSchema outAIS = writeAndRead(inAIS);
        assertNotNull(outAIS.getSequence(new TableName(SCHEMA, "sequence-2")));
        Sequence sequence = outAIS.getSequence(new TableName(SCHEMA, "sequence-2"));
        assertEquals(42, sequence.getStartsWith());
View Full Code Here

    @Test
    public void sequenceTree() {
        NewAISBuilder builder = AISBBasedBuilder.create(typesTranslator());
        TableName seqName = new TableName (SCHEMA, "sequence-3");
        builder.defaultSchema(SCHEMA);
        builder.sequence("sequence-3", 42, -2, true);
        AkibanInformationSchema inAIS = builder.ais();
        Sequence inSeq = inAIS.getSequence(seqName);
        inSeq.setStorageDescription(new TestStorageDescription(inSeq, "sequence-3.tree", identifier));
       
        AkibanInformationSchema outAIS = writeAndRead(inAIS);
View Full Code Here

   
    @Test
    public void columnSequence() {
        NewAISBuilder builder = AISBBasedBuilder.create(SCHEMA, typesTranslator());
        TableName sequenceName = new TableName (SCHEMA, "sequence-4");
        builder.sequence(sequenceName.getTableName());
        builder.table("customers").
            colBigInt("customer_id", false).
            colString("customer_name", 100, false).
            pk("customer_id");
        AkibanInformationSchema inAIS = builder.unvalidatedAIS();
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.