本文整理汇总了Java中org.nlpcn.es4sql.query.maker.QueryMaker类的典型用法代码示例。如果您正苦于以下问题:Java QueryMaker类的具体用法?Java QueryMaker怎么用?Java QueryMaker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryMaker类属于org.nlpcn.es4sql.query.maker包,在下文中一共展示了QueryMaker类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: explain
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
@Override
public String explain() {
String baseExplain = super.explain();
Where where = this.connectedWhere;
QueryBuilder explan = null;
try {
if(where!=null)
explan = QueryMaker.explan(where,false);
} catch (SqlParseException e) {
}
String conditions = explan == null ? "Could not parse conditions" : explan.toString();
String nestedExplain = "Nested Loops \n run first query , and for each result run second query with additional conditions :\n" +conditions +"\n"+ baseExplain;
return nestedExplain;
}
示例2: setWhere
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
/**
* Create filters based on
* the Where clause.
*
* @param where the 'WHERE' part of the SQL query.
* @throws SqlParseException
*/
private void setWhere(Where where) throws SqlParseException {
if (where != null) {
QueryBuilder whereQuery = QueryMaker.explan(where);
request.filter(whereQuery);
} else {
request.filter(QueryBuilders.matchAllQuery());
}
}
示例3: likeTestWithEscaped
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
@Test
public void likeTestWithEscaped() throws SqlParseException {
String query = "select * from x where name like '&UNDERSCOREhey_%&PERCENT'";
Select select = parser.parseSelect((SQLQueryExpr) queryToExpr(query));
BoolQueryBuilder explan = QueryMaker.explan(select.getWhere());
String filterAsString = explan.toString();
Assert.assertTrue(filterAsString.contains("_hey?*%"));
}
示例4: setWhere
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
/**
* Create filters or queries based on
* the Where clause.
* @param where the 'WHERE' part of the SQL query.
* @throws SqlParseException
*/
private void setWhere(Where where) throws SqlParseException {
if (where != null) {
if (select.isQuery) {
BoolQueryBuilder boolQuery = QueryMaker.explan(where);
request.setQuery(boolQuery);
} else {
BoolFilterBuilder boolFilter = FilterMaker.explan(where);
request.setQuery(QueryBuilders.filteredQuery(null, boolFilter));
}
}
}
示例5: setWhere
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
/**
* Create filters based on
* the Where clause.
*
* @param where the 'WHERE' part of the SQL query.
* @throws SqlParseException
*/
private void setWhere(Where where) throws SqlParseException {
if (where != null) {
QueryBuilder whereQuery = QueryMaker.explan(where,this.select.isQuery);
request.setQuery(whereQuery);
}
}
示例6: setWhere
import org.nlpcn.es4sql.query.maker.QueryMaker; //导入依赖的package包/类
/**
* Create filters or queries based on the Where clause.
*
* @param where
* the 'WHERE' part of the SQL query.
* @throws SqlParseException
*/
private void setWhere(Where where) throws SqlParseException {
if (where != null) {
BoolQueryBuilder boolQuery = QueryMaker.explan(where,this.select.isQuery);
request.setQuery(boolQuery);
}
}