Search in sources :

Example 56 with ColumnEntity

use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-diana-driver by eclipse.

the class CassandraColumnFamilyManagerAsyncTest method shouldInsertColumnsAsyncWithConsistenceLevel.

@Test
public void shouldInsertColumnsAsyncWithConsistenceLevel() {
    ColumnEntity columnEntity = getColumnFamily();
    columnEntityManager.save(columnEntity, CONSISTENCY_LEVEL);
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) Test(org.junit.jupiter.api.Test)

Example 57 with ColumnEntity

use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-diana-driver by eclipse.

the class CassandraColumnFamilyManagerAsyncTest method shouldUpdateIterableColumnsAsync.

@Test
public void shouldUpdateIterableColumnsAsync() {
    ColumnEntity columnEntity = getColumnFamily();
    columnEntityManager.update(singletonList(columnEntity));
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) Test(org.junit.jupiter.api.Test)

Example 58 with ColumnEntity

use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-diana-driver by eclipse.

the class CassandraColumnFamilyManagerAsyncTest method shouldInsertJustKeyAsync.

@Test
public void shouldInsertJustKeyAsync() {
    Column key = Columns.of("id", 10L);
    ColumnEntity columnEntity = ColumnEntity.of(COLUMN_FAMILY);
    columnEntity.add(key);
    columnEntityManager.insert(columnEntity);
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) Column(org.jnosql.diana.api.column.Column) Test(org.junit.jupiter.api.Test)

Example 59 with ColumnEntity

use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-diana-driver by eclipse.

the class CassandraColumnFamilyManagerAsyncTest method shouldInsertIterableColumnsAsync.

@Test
public void shouldInsertIterableColumnsAsync() {
    ColumnEntity columnEntity = getColumnFamily();
    columnEntityManager.insert(singletonList(columnEntity));
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) Test(org.junit.jupiter.api.Test)

Example 60 with ColumnEntity

use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-diana-driver by eclipse.

the class CassandraColumnFamilyManagerTest method getEntities.

private List<ColumnEntity> getEntities() {
    Map<String, Object> fields = new HashMap<>();
    fields.put("name", "Cassandra");
    fields.put("version", 3.2);
    fields.put("options", asList(1, 2, 3));
    List<Column> columns = Columns.of(fields);
    ColumnEntity entity = ColumnEntity.of(COLUMN_FAMILY, singletonList(Columns.of("id", 1L)));
    ColumnEntity entity1 = ColumnEntity.of(COLUMN_FAMILY, singletonList(Columns.of("id", 2L)));
    ColumnEntity entity2 = ColumnEntity.of(COLUMN_FAMILY, singletonList(Columns.of("id", 3L)));
    columns.forEach(entity::add);
    columns.forEach(entity1::add);
    columns.forEach(entity2::add);
    return asList(entity, entity1, entity2);
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) HashMap(java.util.HashMap) Column(org.jnosql.diana.api.column.Column)

Aggregations

ColumnEntity (org.jnosql.diana.api.column.ColumnEntity)88 Test (org.junit.jupiter.api.Test)76 ColumnQuery (org.jnosql.diana.api.column.ColumnQuery)26 Column (org.jnosql.diana.api.column.Column)22 Arrays.asList (java.util.Arrays.asList)17 List (java.util.List)17 Consumer (java.util.function.Consumer)14 Collections.singletonList (java.util.Collections.singletonList)13 ColumnDeleteQuery (org.jnosql.diana.api.column.ColumnDeleteQuery)13 Person (org.jnosql.artemis.model.Person)12 Duration (java.time.Duration)11 Collections.emptyList (java.util.Collections.emptyList)10 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)10 AtomicReference (java.util.concurrent.atomic.AtomicReference)10 ColumnQueryBuilder.delete (org.jnosql.diana.api.column.query.ColumnQueryBuilder.delete)9 ColumnQueryBuilder.select (org.jnosql.diana.api.column.query.ColumnQueryBuilder.select)9 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)9 BeforeEach (org.junit.jupiter.api.BeforeEach)9 ArrayList (java.util.ArrayList)8 Arrays (java.util.Arrays)8