当前位置: 首页>>代码示例>>Java>>正文


Java QueryMaker类代码示例

本文整理汇总了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;
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:15,代码来源:NestedLoopsElasticRequestBuilder.java

示例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());
	}
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:16,代码来源:DeleteQueryAction.java

示例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?*%"));
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:9,代码来源:SqlParserTests.java

示例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));
		}
	}
}
 
开发者ID:lane-cn,项目名称:elasticsql,代码行数:18,代码来源:DefaultQueryAction.java

示例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);
    }
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:14,代码来源:AggregationQueryAction.java

示例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);
	}
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:14,代码来源:DefaultQueryAction.java


注:本文中的org.nlpcn.es4sql.query.maker.QueryMaker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。