Package com.impetus.kundera.client.cassandra.dsdriver

Examples of com.impetus.kundera.client.cassandra.dsdriver.DSClient


        String useNativeSql = "USE \"" + schema + "\"";
        EntityManager em = emf.createEntityManager();

        Map<String, Client> clientMap = (Map<String, Client>) em.getDelegate();
        DSClient pc = (DSClient) clientMap.get(_PU);
        pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);

        Query q = em.createNativeQuery(useNativeSql);
        q.executeUpdate();
        // create column family
        String colFamilySql = "CREATE COLUMNFAMILY users (key varchar PRIMARY KEY,full_name varchar, birth_date int,state varchar)";
View Full Code Here


        String batchOps = "BEGIN BATCH INSERT INTO CassandraBatchEntity (user_name, password, name) VALUES ('user2', 'ch@ngem3b', 'second user') UPDATE CassandraBatchEntity SET password = 'ps22dhds' WHERE user_name = 'user2' INSERT INTO CassandraBatchEntity (user_name, password) VALUES ('user3', 'ch@ngem3c') DELETE name FROM CassandraBatchEntity WHERE user_name = 'user2' INSERT INTO CassandraBatchEntity (user_name, password, name) VALUES ('user4', 'ch@ngem3c', 'Andrew') APPLY BATCH";

        EntityManager em = emf.createEntityManager();

        Map<String, Client> clientMap = (Map<String, Client>) em.getDelegate();
        DSClient pc = (DSClient) clientMap.get(_PU);
        pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);

        Query q = em.createNativeQuery(useNativeSql);
        // q.getResultList();
        q.executeUpdate();

        pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
        q = em.createNativeQuery(createColumnFamily);
        // q.getResultList();
        q.executeUpdate();

        pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
        q = em.createNativeQuery(batchOps);
        // q.getResultList();
        q.executeUpdate();

        q = em.createNativeQuery("select * from CassandraBatchEntity", CassandraBatchEntity.class);
View Full Code Here

    }

    private void testCountResult()
    {
        Map<String, Client> clientMap = (Map<String, Client>) entityManager.getDelegate();
        DSClient tc = (DSClient) clientMap.get(_PU);
        tc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
        CQLTranslator translator = new CQLTranslator();

        String query = "select count(*) from "
                + translator.ensureCase(new StringBuilder(), "PERSON", false).toString();
        Query q = entityManager.createNativeQuery(query, PersonCassandra.class);
View Full Code Here

TOP

Related Classes of com.impetus.kundera.client.cassandra.dsdriver.DSClient

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.