com.haulmont.cuba.core.Query.getQueryString()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(275)

本文整理了Java中com.haulmont.cuba.core.Query.getQueryString方法的一些代码示例,展示了Query.getQueryString的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getQueryString方法的具体详情如下:
包路径:com.haulmont.cuba.core.Query
类名称:Query
方法名:getQueryString

Query.getQueryString介绍

[英]Get the query string.
[中]获取查询字符串。

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-core

protected void replaceParamsInMacros(Query query) {
  Collection<QueryMacroHandler> handlers = AppBeans.getAll(QueryMacroHandler.class).values();
  String modifiedQuery = query.getQueryString();
  for (QueryMacroHandler handler : handlers) {
    modifiedQuery = handler.replaceQueryParams(modifiedQuery, queryParams);
  }
  query.setQueryString(modifiedQuery);
}

代码示例来源:origin: com.haulmont.cuba/cuba-core

protected void applyConstraints(Query query) {
  boolean constraintsApplied = security.applyConstraints(query);
  if (constraintsApplied && singleResult) {
    QueryParser parser = QueryTransformerFactory.createParser(query.getQueryString());
    if (parser.isQueryWithJoins()) {
      QueryTransformer transformer = QueryTransformerFactory.createTransformer(query.getQueryString());
      transformer.addDistinct();
      query.setQueryString(transformer.getResult());
    }
  }
  if (constraintsApplied && log.isDebugEnabled())
    log.debug("Constraints applied: {}", printQuery(query.getQueryString()));
}

代码示例来源:origin: com.haulmont.cuba/cuba-core

@Override
public boolean applyConstraints(Query query) {
  QueryParser parser = QueryTransformerFactory.createParser(query.getQueryString());
  String entityName = parser.getEntityName();
  List<ConstraintData> constraints = getConstraints(metadata.getClassNN(entityName), constraint ->
      constraint.getCheckType().database()
          && (constraint.getOperationType() == ConstraintOperationType.READ
          || constraint.getOperationType() == ConstraintOperationType.ALL));
  if (constraints.isEmpty())
    return false;
  QueryTransformer transformer = QueryTransformerFactory.createTransformer(query.getQueryString());
  for (ConstraintData constraint : constraints) {
    processConstraint(transformer, constraint, entityName);
  }
  query.setQueryString(transformer.getResult());
  for (String paramName : transformer.getAddedParams()) {
    setQueryParam(query, paramName);
  }
  return true;
}

代码示例来源:origin: com.haulmont.cuba/cuba-core

String logMsg = "Load previous query results: " + RdbmsQueryBuilder.printQuery(query.getQueryString());
log.debug(logMsg);
long start = System.currentTimeMillis();

代码示例来源:origin: com.haulmont.reports/reports-core

log.debug("Constraints applied: " + printQuery(query.getQueryString()));

相关文章