本文整理了Java中com.haulmont.cuba.core.Query.getQueryString
方法的一些代码示例,展示了Query.getQueryString
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getQueryString
方法的具体详情如下:
包路径:com.haulmont.cuba.core.Query
类名称: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()));
内容来源于网络,如有侵权,请联系作者删除!