Package com.datastax.driver.core

Examples of com.datastax.driver.core.Row


    public void should_not_dirty_check_list_element_sub_list_remove() throws Exception {
        bean.getFriends().subList(0, 1).remove(0);

        manager.update(bean);

        Row row = session.execute("select friends from CompleteBean where id=" + bean.getId()).one();
        List<String> friends = row.getList("friends", String.class);

        assertThat(friends).hasSize(2);
        assertThat(friends).contains("foo", "bar");
    }
View Full Code Here


    public void should_dirty_check_list_element_set() throws Exception {
        bean.getFriends().set(1, "qux");

        manager.update(bean);

        Row row = session.execute("select friends from CompleteBean where id=" + bean.getId()).one();
        List<String> friends = row.getList("friends", String.class);

        assertThat(friends).hasSize(2);
        assertThat(friends.get(1)).isEqualTo("qux");
    }
View Full Code Here

        iter.next();
        iter.remove();

        manager.update(bean);

        Row row = session.execute("select friends from CompleteBean where id=" + bean.getId()).one();
        List<String> friends = row.getList("friends", String.class);

        assertThat(friends).hasSize(2);
        assertThat(friends).contains("foo", "bar");
    }
View Full Code Here

        iter.next();
        iter.remove();

        manager.update(bean);

        Row row = session.execute("select friends from CompleteBean where id=" + bean.getId()).one();
        List<String> friends = row.getList("friends", String.class);

        assertThat(friends).hasSize(2);
        assertThat(friends).contains("foo", "bar");
    }
View Full Code Here

        ListIterator<String> iter = bean.getFriends().listIterator();

        iter.next();
        iter.set("qux");

        Row row = session.execute("select friends from CompleteBean where id=" + bean.getId()).one();
        List<String> friends = row.getList("friends", String.class);

        assertThat(friends).hasSize(2);
        assertThat(friends).contains("foo", "bar");
    }
View Full Code Here

    @Test
    public void should_dirty_check_assign_new_value_to_map() throws Exception {
        bean.setPreferences(ImmutableMap.of(4, "test", 5, "again"));
        manager.update(bean);

        Row row = session.execute("select preferences from CompleteBean where id=" + bean.getId()).one();
        Map<Integer, String> preferences = row.getMap("preferences", Integer.class, String.class);
        assertThat(preferences).hasSize(2);
        assertThat(preferences).containsKey(4);
        assertThat(preferences.get(4)).isEqualTo("test");
        assertThat(preferences).containsKey(5);
        assertThat(preferences.get(5)).isEqualTo("again");
View Full Code Here

    public void should_dirty_check_map_put_element() throws Exception {
        bean.getPreferences().put(4, "test");

        manager.update(bean);

        Row row = session.execute("select preferences from CompleteBean where id=" + bean.getId()).one();
        Map<Integer, String> preferences = row.getMap("preferences", Integer.class, String.class);

        assertThat(preferences).hasSize(4);
        assertThat(preferences.get(4)).isEqualTo("test");
    }
View Full Code Here

    public void should_dirty_check_map_remove_key() throws Exception {
        bean.getPreferences().remove(1);

        manager.update(bean);

        Row row = session.execute("select preferences from CompleteBean where id=" + bean.getId()).one();
        Map<Integer, String> preferences = row.getMap("preferences", Integer.class, String.class);

        assertThat(preferences).hasSize(2);
        assertThat(preferences.get(2)).isEqualTo("Paris");
        assertThat(preferences.get(3)).isEqualTo("75014");
    }
View Full Code Here

        map.put(4, "test");
        bean.getPreferences().putAll(map);

        manager.update(bean);

        Row row = session.execute("select preferences from CompleteBean where id=" + bean.getId()).one();
        Map<Integer, String> preferences = row.getMap("preferences", Integer.class, String.class);

        assertThat(preferences).hasSize(4);
        assertThat(preferences.get(3)).isEqualTo("75015");
        assertThat(preferences.get(4)).isEqualTo("test");
View Full Code Here

    public void should_not_dirty_check_map_keyset_remove() throws Exception {
        bean.getPreferences().keySet().remove(1);

        manager.update(bean);

        Row row = session.execute("select preferences from CompleteBean where id=" + bean.getId()).one();
        Map<Integer, String> preferences = row.getMap("preferences", Integer.class, String.class);

        assertThat(preferences).hasSize(3);
        assertThat(preferences.get(1)).isEqualTo("FR");
        assertThat(preferences.get(2)).isEqualTo("Paris");
        assertThat(preferences.get(3)).isEqualTo("75014");
View Full Code Here

TOP

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

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.