use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldConvertsJavaFieldToColumn.
@Test
public void shouldConvertsJavaFieldToColumn() {
ColumnQuery query = parser.parse("findById", new Object[] { "10" }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.EQUALS, query.getCondition().get().getCondition());
assertEquals(Column.of("_id", 10L), query.getCondition().get().getColumn());
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByNameLikeOrderByNameDescOrderByAgeAsc.
@Test
public void shouldFindByNameLikeOrderByNameDescOrderByAgeAsc() {
ColumnQuery query = parser.parse("findByNameLikeOrderByNameDescOrderByAgeAsc", 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.DESC), query.getSorts().get(0));
assertEquals(Sort.of("age", Sort.SortType.ASC), query.getSorts().get(1));
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByAgeLessThanEqual.
@Test
public void shouldFindByAgeLessThanEqual() {
ColumnQuery query = parser.parse("findByAgeLessThanEqual", new Object[] { 10 }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.LESSER_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 shouldFindByNameLike.
@Test
public void shouldFindByNameLike() {
ColumnQuery query = parser.parse("findByNameLike", 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());
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class ColumnQueryParserTest method shouldFindByAgeGreaterThan.
@Test
public void shouldFindByAgeGreaterThan() {
ColumnQuery query = parser.parse("findByAgeGreaterThan", new Object[] { 10 }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.GREATER_THAN, query.getCondition().get().getCondition());
assertEquals(Column.of("age", 10), query.getCondition().get().getColumn());
}
Aggregations