use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsEmailNull.
@Test
public void generateOneQueryRuleNotEqualsEmailNull() {
String value = null;
Query<Entity> q = new QueryImpl<>().not().eq(emailAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(emailAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsHyperlinkNull.
@Test
public void generateOneQueryRuleNotEqualsHyperlinkNull() {
String value = null;
Query<Entity> q = new QueryImpl<>().not().eq(hyperlinkAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(hyperlinkAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsStringNull.
@Test
public void generateOneQueryRuleNotEqualsStringNull() {
String value = null;
Query<Entity> q = new QueryImpl<>().not().eq(stringAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(stringAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsDecimal.
@Test
public void generateOneQueryRuleNotEqualsDecimal() {
Double value = 1.23;
Query<Entity> q = new QueryImpl<>().not().eq(decimalAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(termQuery(decimalAttrName, value)));
assertQueryBuilderEquals(query, expectedQuery);
}
use of org.molgenis.data.support.QueryImpl in project molgenis by molgenis.
the class QueryGeneratorTest method generateOneQueryRuleNotEqualsIntNull.
@Test
public void generateOneQueryRuleNotEqualsIntNull() {
Integer value = null;
Query<Entity> q = new QueryImpl<>().not().eq(intAttrName, value);
QueryBuilder query = queryGenerator.createQueryBuilder(q, entityType);
QueryBuilder expectedQuery = boolQuery().mustNot(constantScoreQuery(boolQuery().mustNot(existsQuery(intAttrName))));
assertQueryBuilderEquals(query, expectedQuery);
}
Aggregations