use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsLong.
@Test
public void generateOneQueryRuleNotEqualsLong() {
Long value = 1L;
Query<Entity> q = new QueryImpl<>().not().eq(longAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(termQuery(longAttrName, value)));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsText.
@Test
public void generateOneQueryRuleNotEqualsText() {
String value = "some long text";
Query<Entity> q = new QueryImpl<>().not().eq(textAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(termQuery(textAttrName + '.' + FIELD_NOT_ANALYZED, value)));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsLongNull.
@Test
public void generateOneQueryRuleNotEqualsLongNull() {
Long value = null;
Query<Entity> q = new QueryImpl<>().not().eq(longAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(longAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsCompoundPartStringNull.
@Test
public void generateOneQueryRuleNotEqualsCompoundPartStringNull() {
String value = null;
Query<Entity> q = new QueryImpl<>().not().eq(compoundPart0AttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(compoundPart0AttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsDecimalNull.
@Test
public void generateOneQueryRuleNotEqualsDecimalNull() {
Double value = null;
Query<Entity> q = new QueryImpl<>().not().eq(decimalAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(decimalAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
Aggregations