io.ebean.Query.filterMany()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(164)

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

Query.filterMany介绍

[英]This applies a filter on the 'many' property list rather than the root level objects.

Typically you will use this in a scenario where the cardinality is high on the 'many' property you wish to join to. Say you want to fetch customers and their associated orders... but instead of getting all the orders for each customer you only want to get the new orders they placed since last week. In this case you can use filterMany() to filter the orders.

List list =

Please note you have to be careful that you add expressions to the correct expression list - as there is one for the 'root level' and one for each filterMany that you have.
[中]这会对“多”属性列表而不是根级别的对象应用过滤器。
通常,您会在希望加入的“多”属性的基数较高的情况下使用此选项。假设您想获取客户及其相关订单。。。但是,你不想为每个客户获得所有订单,而只想获得他们从上周开始下的新订单。在这种情况下,可以使用filterMany()来过滤订单。

List list =

请注意,您必须小心将表达式添加到正确的表达式列表中,因为“根级别”有一个表达式,您拥有的每个filterMany都有一个表达式。

代码示例

代码示例来源:origin: ebean-orm/ebean

@Override
public ExpressionList<T> filterMany(String prop) {
 return rootQuery.filterMany(prop);
}

代码示例来源:origin: ebean-orm/ebean

@Override
public ExpressionList<T> filterMany(String prop) {
 return query.filterMany(prop);
}

代码示例来源:origin: io.ebean/ebean

@Override
public ExpressionList<T> filterMany(String prop) {
 return query.filterMany(prop);
}

代码示例来源:origin: org.actframework/act-ebean

@Override
public ExpressionList<MODEL_TYPE> filterMany(String propertyName) {
  return qReadOnly.filterMany(propertyName);
}

代码示例来源:origin: org.actframework/act-ebean2

@Override
public ExpressionList<MODEL_TYPE> filterMany(String propertyName) {
  return q.filterMany(propertyName);
}

代码示例来源:origin: io.ebean/ebean

@Override
public ExpressionList<T> filterMany(String prop) {
 return rootQuery.filterMany(prop);
}

代码示例来源:origin: icode/ameba

/**
 * {@inheritDoc}
 * Applies a filter on the 'many' property list rather than the root level objects.
 */
public ExpressionList<T> filterMany(String propertyName) {
  return query().filterMany(propertyName);
}

代码示例来源: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);
  }
}

相关文章

Query类方法