Package org.caffinitas.mapper.core

Examples of org.caffinitas.mapper.core.SchemaGenerator


            withMappedKeyspace("lookup_KS_NAME", "demo").
            build();
        try
        {

            SchemaGenerator schemaGenerator = persistenceManager.createSchemaGenerator();

            System.out.println("Executing CQL DDL statements...");
            System.out.println();
            for (String stmt : schemaGenerator.generateLiveAlterDDL().getStatements())
            {
                System.out.println(stmt);
            }

            CqlStatementList cqlDDL = schemaGenerator.generateLiveAlterDDL();
            cqlDDL.execute(persistenceManager.driverSession());

            System.out.println("Wait until all schema objects are available...");
            System.out.println();
            persistenceManager.refreshSchema(); // This is necessary until schema changes are propagated from the Java Driver to Caffinitas Mappe automatically!
            schemaGenerator.forSchemaObjectsAvailable().awaitUninterruptibly();

            PersistenceSession session = persistenceManager.createSession();
            try
            {
View Full Code Here


        } finally { session.close(); }
    }

    @Test(invocationCount = 1, invocationTimeOut = 1000L)
    public void generateSchema() throws Exception {
        SchemaGenerator schemaGenerator = persistenceManager.createSchemaGenerator();
        System.out.println();
        System.out.println("-- CREATE DDL statements");
        System.out.println();
        System.out.println(schemaGenerator.generateOfflineCreateDDL());
        System.out.println();
        System.out.println("-- DROP DDL statements");
        System.out.println();
        System.out.println(schemaGenerator.generateOfflineDropDDL());
        System.out.println();
        System.out.println("-- ALTER DDL statements");
        System.out.println();
        System.out.println(schemaGenerator.generateLiveAlterDDL());
    }
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.core.SchemaGenerator

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.