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

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

本文整理了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

  1. protected void replaceParamsInMacros(Query query) {
  2. Collection<QueryMacroHandler> handlers = AppBeans.getAll(QueryMacroHandler.class).values();
  3. String modifiedQuery = query.getQueryString();
  4. for (QueryMacroHandler handler : handlers) {
  5. modifiedQuery = handler.replaceQueryParams(modifiedQuery, queryParams);
  6. }
  7. query.setQueryString(modifiedQuery);
  8. }

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

  1. protected void applyConstraints(Query query) {
  2. boolean constraintsApplied = security.applyConstraints(query);
  3. if (constraintsApplied && singleResult) {
  4. QueryParser parser = QueryTransformerFactory.createParser(query.getQueryString());
  5. if (parser.isQueryWithJoins()) {
  6. QueryTransformer transformer = QueryTransformerFactory.createTransformer(query.getQueryString());
  7. transformer.addDistinct();
  8. query.setQueryString(transformer.getResult());
  9. }
  10. }
  11. if (constraintsApplied && log.isDebugEnabled())
  12. log.debug("Constraints applied: {}", printQuery(query.getQueryString()));
  13. }

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

  1. @Override
  2. public boolean applyConstraints(Query query) {
  3. QueryParser parser = QueryTransformerFactory.createParser(query.getQueryString());
  4. String entityName = parser.getEntityName();
  5. List<ConstraintData> constraints = getConstraints(metadata.getClassNN(entityName), constraint ->
  6. constraint.getCheckType().database()
  7. && (constraint.getOperationType() == ConstraintOperationType.READ
  8. || constraint.getOperationType() == ConstraintOperationType.ALL));
  9. if (constraints.isEmpty())
  10. return false;
  11. QueryTransformer transformer = QueryTransformerFactory.createTransformer(query.getQueryString());
  12. for (ConstraintData constraint : constraints) {
  13. processConstraint(transformer, constraint, entityName);
  14. }
  15. query.setQueryString(transformer.getResult());
  16. for (String paramName : transformer.getAddedParams()) {
  17. setQueryParam(query, paramName);
  18. }
  19. return true;
  20. }

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

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

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

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

相关文章