use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByAgeLessThan.
@Test
public void shouldFindByAgeLessThan() {
ColumnQuery query = parser.parse("findByAgeLessThan", new Object[] { 10 }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.LESSER_THAN, query.getCondition().get().getCondition());
assertEquals(Column.of("age", 10), query.getCondition().get().getColumn());
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByNameWithPageSortArgument.
@Test
public void shouldFindByNameWithPageSortArgument() {
Pagination pagination = Pagination.of(2L, 10);
Sort sort = Sort.of("age", Sort.SortType.ASC);
ColumnQuery query = parser.parse("findByName", new Object[] { "name", pagination, sort }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.EQUALS, query.getCondition().get().getCondition());
assertEquals(Column.of("name", "name"), query.getCondition().get().getColumn());
assertEquals(pagination.getMaxResults(), query.getMaxResults());
assertEquals(pagination.getFirstResult(), query.getFirstResult());
assertEquals(sort, query.getSorts().get(0));
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByNameWithPageArgument.
@Test
public void shouldFindByNameWithPageArgument() {
Pagination pagination = Pagination.of(2L, 10);
ColumnQuery query = parser.parse("findByName", new Object[] { "name", pagination }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.EQUALS, query.getCondition().get().getCondition());
assertEquals(Column.of("name", "name"), query.getCondition().get().getColumn());
assertEquals(pagination.getMaxResults(), query.getMaxResults());
assertEquals(pagination.getFirstResult(), query.getFirstResult());
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByAgeGreaterThanEqual.
@Test
public void shouldFindByAgeGreaterThanEqual() {
ColumnQuery query = parser.parse("findByAgeGreaterThanEqual", new Object[] { 10 }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.GREATER_EQUALS_THAN, query.getCondition().get().getCondition());
assertEquals(Column.of("age", 10), query.getCondition().get().getColumn());
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByNameLikeOrderByNameAsc.
@Test
public void shouldFindByNameLikeOrderByNameAsc() {
ColumnQuery query = parser.parse("findByNameLikeOrderByNameAsc", new Object[] { "name" }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.LIKE, query.getCondition().get().getCondition());
assertEquals(Column.of("name", "name"), query.getCondition().get().getColumn());
assertEquals(Sort.of("name", Sort.SortType.ASC), query.getSorts().get(0));
}
Aggregations