本文整理了Java中io.ebean.Query.having
方法的一些代码示例,展示了Query.having
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.having
方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:having
[英]Add Expressions to the Having clause return the ExpressionList.
Currently only beans based on raw sql will use the having clause.
Note that this returns the ExpressionList (so you can add multiple expressions to the query in a fluent API way).
[中]将表达式添加到Having子句,以返回表达式列表。
目前只有基于原始sql的bean才会使用having子句。
请注意,这将返回ExpressionList(因此您可以以流畅的API方式向查询中添加多个表达式)。
代码示例来源:origin: ebean-orm/ebean
@Override
public ExpressionList<T> having() {
return query.having();
}
代码示例来源:origin: org.actframework/act-ebean
@Override
public ExpressionList<MODEL_TYPE> having() {
return q.having();
}
代码示例来源:origin: org.actframework/act-ebean2
@Override
public ExpressionList<MODEL_TYPE> having() {
return q.having();
}
代码示例来源:origin: io.ebean/ebean
@Override
public ExpressionList<T> having() {
return query.having();
}
代码示例来源:origin: org.actframework/act-ebean
@Override
public EbeanQuery<MODEL_TYPE> having(Expression addExpressionToHaving) {
q.having(addExpressionToHaving);
qReadOnly.having(addExpressionToHaving);
return this;
}
代码示例来源:origin: org.actframework/act-ebean2
@Override
public EbeanQuery<MODEL_TYPE> having(Expression addExpressionToHaving) {
q.having(addExpressionToHaving);
return this;
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* Return the underlying having clause to typically when using dynamic aggregation formula.
* <p>
* Note that after this we no longer have the query bean so typically we use this right
* at the end of the query.
* </p>
*
* <pre>{@code
*
* // sum(distanceKms) ... is a "dynamic formula"
* // so we use havingClause() for it like:
*
* List<MachineUse> machineUse =
*
* new QMachineUse()
* .select("machine, sum(fuelUsed), sum(distanceKms)")
*
* // where ...
* .date.greaterThan(LocalDate.now().minusDays(7))
*
* .havingClause()
* .gt("sum(distanceKms)", 2)
* .findList();
*
* }</pre>
*/
public ExpressionList<T> havingClause() {
return query.having();
}
代码示例来源:origin: icode/ameba
/**
* Returns the query's <code>having</code> clause.
*
* @return a {@link io.ebean.ExpressionList} object.
*/
public ExpressionList<T> having() {
return query().having();
}
代码示例来源:origin: icode/ameba
/**
* {@inheritDoc}
* Adds an expression to the <code>having</code> clause and returns the query.
*/
public Query<T> having(Expression addExpressionToHaving) {
return query().having(addExpressionToHaving);
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* Start adding expressions to the having clause when using @Aggregation properties.
*
* <pre>{@code
*
* new QMachineUse()
* // where ...
* .date.inRange(fromDate, toDate)
*
* .having()
* .sumHours.greaterThan(1)
* .findList()
*
* // The sumHours property uses @Aggregation
* // e.g. @Aggregation("sum(hours)")
*
* }</pre>
*/
public R having() {
if (whereStack == null) {
whereStack = new ArrayStack<>();
}
// effectively putting having expression list onto stack
// such that expression now add to the having clause
whereStack.push(query.having());
return root;
}
代码示例来源:origin: org.actframework/act-ebean
private void syncEbeanQueries() {
_sync("detail");
q.orderBy();
_sync("orderBy");
q.text();
_sync("textExpressions");
q.where();
_sync("whereExpressions");
q.having();
_sync("havingExpressions");
}
代码示例来源:origin: icode/ameba
/** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public void apply(Expression expr) {
if (expr instanceof HavingExpression) {
ExpressionList having = expressionList.query().having();
((HavingExpression) expr).getExpressionList().forEach(having::add);
return;
} else if (expr instanceof TextExpression) {
TextExpression expression = (TextExpression) expr;
ExpressionList et = expressionList.query().text();
expression.getExpressionList().forEach(et::add);
return;
} else if (expr instanceof DistinctExpression) {
expressionList.setDistinct(((DistinctExpression) expr).distinct);
return;
} else if (expr instanceof AbstractTextExpression) {
expressionList.setUseDocStore(true);
} else if (expr instanceof FilterExpression) {
FilterExpression filter = (FilterExpression) expr;
Query query = expressionList.query();
query.filterMany(filter.getPath()).addAll(filter);
return;
}
expressionList.add(expr);
}
}
代码示例来源:origin: icode/ameba
Object o = args[i].object();
if (o instanceof HavingExpression) {
ExpressionList having = q.having();
((HavingExpression) o).expressionList.forEach(having::add);
} else if (o instanceof DistinctExpression) {
内容来源于网络,如有侵权,请联系作者删除!