Package com.datastax.driver.core

Examples of com.datastax.driver.core.RegularStatement


                .addPreference(2, "NewYork").buid();

        manager.insert(entity1);
        manager.insert(entity2);

        RegularStatement statement = select().from("CompleteBean").limit(3);

        List<CompleteBean> actual = manager.typedQuery(CompleteBean.class, statement).get();

        assertThat(actual).hasSize(2);
View Full Code Here


                .addPreference(2, "NewYork").buid();

        manager.insert(entity1);
        manager.insert(entity2);

        RegularStatement statement = select("id","name","friends").from("CompleteBean").limit(3);
        List<CompleteBean> actual = manager.typedQuery(CompleteBean.class, statement).get();

        assertThat(actual).hasSize(2);

        CompleteBean found1 = actual.get(0);
View Full Code Here

    public void should_return_entity_for_typed_query_with_bound_values() throws Exception {
        CompleteBean entity = builder().randomId().name("DuyHai").buid();

        manager.insert(entity);

        RegularStatement statement = select("id","name","friends").from("CompleteBean").where(eq("id",bindMarker()));
        List<CompleteBean> actual = manager.typedQuery(CompleteBean.class, statement, entity.getId()).get();

        assertThat(actual).hasSize(1);

        CompleteBean found = actual.get(0);
View Full Code Here

                .addPreference(2, "NewYork").version(counter2).buid();

        manager.insert(entity1);
        manager.insert(entity2);

        RegularStatement statement = select().from("CompleteBean").limit(bindMarker("lim"));
        List<CompleteBean> actual = manager.rawTypedQuery(CompleteBean.class, statement, 3).get();

        assertThat(actual).hasSize(2);

        CompleteBean found1 = actual.get(0);
View Full Code Here

                .addPreference(2, "NewYork").version(counter2).buid();

        manager.insert(entity1);
        manager.insert(entity2);

        RegularStatement statement = select("id","name","friends").from("CompleteBean").limit(3);
        List<CompleteBean> actual = manager.rawTypedQuery(CompleteBean.class, statement).get();

        assertThat(actual).hasSize(2);

        CompleteBean found1 = actual.get(0);
View Full Code Here

    @Test
    public void should_return_raw_entity_for_raw_typed_query_with_bound_values() throws Exception {
        CompleteBean entity = builder().randomId().name("DuyHai").buid();
        manager.insert(entity);

        RegularStatement statement = select("name").from("CompleteBean").limit(bindMarker());
        List<CompleteBean> actual = manager.rawTypedQuery(CompleteBean.class, statement, 3).get();

        assertThat(actual).hasSize(1);
        assertThat(actual.get(0).getName()).isEqualTo(entity.getName());
    }
View Full Code Here

                .addFriends("foo", "bar").addFollowers("George", "Paul").addPreference(1, "FR")
                .addPreference(2, "Paris").addPreference(3, "75014").version(CounterBuilder.incr(15L)).buid();

        manager.insert(entity);

        RegularStatement statement = select("id","name","friends").from("CompleteBean").limit(3);
        CompleteBean actual = manager.typedQuery(CompleteBean.class, statement).getFirst();

        Factory factory1 = (Factory) actual;
        @SuppressWarnings("unchecked")
        ProxyInterceptor<CompleteBean> interceptor1 = (ProxyInterceptor<CompleteBean>) factory1.getCallback(0);
View Full Code Here

        Long id = RandomUtils.nextLong(0,Long.MAX_VALUE);

        ClusteredEntity entity = new ClusteredEntity(id, 10, "name", "value");
        manager.insert(entity);

        RegularStatement statement = select().from(TABLE_NAME).limit(3);
        ClusteredEntity actual = manager.typedQuery(ClusteredEntity.class, statement).getFirst();

        assertThat(actual).isNotNull();
        assertThat(actual).isInstanceOf(Factory.class);
View Full Code Here

                .addFriends("foo", "bar").addFollowers("George", "Paul").addPreference(1, "FR")
                .addPreference(2, "Paris").addPreference(3, "75014").version(CounterBuilder.incr(15L)).buid();

        manager.insert(entity);

        RegularStatement statement = select("id","name","friends").from("CompleteBean").limit(3);
        CompleteBean actual = manager.rawTypedQuery(CompleteBean.class, statement).getFirst();

        assertThat(Factory.class.isAssignableFrom(actual.getClass())).isFalse();

        assertThat(actual.getId()).isEqualTo(entity.getId());
View Full Code Here

        Long id = RandomUtils.nextLong(0,Long.MAX_VALUE);

        ClusteredEntity entity = new ClusteredEntity(id, 10, "name", "value");
        manager.insert(entity);

        RegularStatement statement = select("id","count","name","value").from(TABLE_NAME).limit(3);
        ClusteredEntity actual = manager.rawTypedQuery(ClusteredEntity.class, statement).getFirst();

        assertThat(actual).isNotNull();

        ClusteredKey clusteredKey = actual.getId();
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.RegularStatement

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.