Package com.datastax.driver.core.querybuilder.Update

Examples of com.datastax.driver.core.querybuilder.Update.Conditions


    }

    @Test
    public void should_generate_update_for_remove_at_index() throws Exception {
        //Given
        final Conditions conditions = update("table").onlyIf();
        when(meta.getCQL3ColumnName()).thenReturn("names");

        //When
        final Assignments actual = view.generateUpdateForRemovedAtIndexElement(conditions, 2);
View Full Code Here


    @Test
    public void should_generate_update_for_added_elements() throws Exception {
        //Given
        changeSet.setChanges.add("a");
        final Conditions update = update();

        when(pm.forStatementGeneration().generateUpdateForAddedElements(update)).thenReturn(update.with(addAll("property", bindMarker())));

        //When
        changeSet.generateUpdateForAddedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_added_elements_with_bind_marker() throws Exception {
        //Given
        changeSet.setChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForAddedElements(update)).thenReturn(update.with(addAll("property", bindMarker("property"))));


        //When
        changeSet.generateUpdateForAddedElements(update);
View Full Code Here

    @Test
    public void should_generate_update_for_removed_elements() throws Exception {
        //Given
        changeSet.setChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForRemovedElements(update)).thenReturn(update.with(removeAll("property", bindMarker())));


        //When
        changeSet.generateUpdateForRemovedElements(update);
View Full Code Here

    @Test
    public void should_generate_update_for_removed_element_with_bind_marker() throws Exception {
        //Given
        changeSet.setChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForRemovedElements(update)).thenReturn(update.with(removeAll("property", bindMarker("property"))));

        //When
        changeSet.generateUpdateForRemovedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_appended_elements() throws Exception {
        //Given
        changeSet.listChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForAppendedElements(update)).thenReturn(update.with(appendAll("property", bindMarker())));

        //When
        changeSet.generateUpdateForAppendedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_appended_element_with_bind_marker() throws Exception {
        //Given
        changeSet.listChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForAppendedElements(update)).thenReturn(update.with(appendAll("property", bindMarker("property"))));

        //When
        changeSet.generateUpdateForAppendedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_prepended_elements() throws Exception {
        //Given
        changeSet.listChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForPrependedElements(update)).thenReturn(update.with(prependAll("property", bindMarker())));

        //When
        changeSet.generateUpdateForPrependedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_prepended_element_with_bind_marker() throws Exception {
        //Given
        changeSet.listChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForPrependedElements(update)).thenReturn(update.with(prependAll("property", bindMarker("property"))));

        //When
        changeSet.generateUpdateForPrependedElements(update);

        //Then
View Full Code Here

    @Test
    public void should_generate_update_for_remove_list_element() throws Exception {
        //Given
        changeSet.listChanges.add("a");
        final Conditions update = update();
        when(pm.forStatementGeneration().generateUpdateForRemoveListElements(update)).thenReturn(update.with(discardAll("property", bindMarker())));

        //When
        changeSet.generateUpdateForRemoveListElements(update);

        //Then
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.querybuilder.Update.Conditions

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.