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

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

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

Query.setAutoTune介绍

[英]Explicitly specify whether to use AutoTune for this query.

If you do not call this method on a query the "Implicit AutoTune mode" is used to determine if AutoTune should be used for a given query.

AutoTune can add additional fetch paths to the query and specify which properties are included for each path. If you have explicitly defined some fetch paths AutoTune will not remove them.
[中]明确指定是否对此查询使用自动调谐。
如果不在查询中调用此方法,“隐式自动调谐模式”用于确定是否应在给定查询中使用自动调谐。
AutoTune可以向查询中添加其他提取路径,并指定每个路径包含哪些属性。如果您明确定义了一些提取路径,AutoTune将不会删除它们。

代码示例

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

/**
 * We need to create and execute a query to get the foreign key values as
 * the delete cascades to them (foreign keys).
 */
private Query<?> deleteRequiresQuery(BeanDescriptor<?> desc, BeanPropertyAssocOne<?>[] propImportDelete, DeleteMode deleteMode) {
 Query<?> q = server.createQuery(desc.getBeanType());
 StringBuilder sb = new StringBuilder(30);
 for (BeanPropertyAssocOne<?> aPropImportDelete : propImportDelete) {
  sb.append(aPropImportDelete.getName()).append(",");
 }
 q.setAutoTune(false);
 q.select(sb.toString());
 if (deleteMode.isHard() && desc.isSoftDelete()) {
  // hard delete so we want this query to include logically deleted rows (if any)
  q.setIncludeSoftDeletes();
 }
 return q;
}

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

@Override
public EbeanQuery<MODEL_TYPE> setAutoTune(boolean b) {
  q.setAutoTune(b);
  return this;
}

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

@Override
public EbeanQuery<MODEL_TYPE> setAutoTune(boolean b) {
  q.setAutoTune(b);
  qReadOnly.setAutoTune(b);
  return this;
}

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

/**
 * Explicitly specify whether to use AutoTune for this query.
 * <p>
 * If you do not call this method on a query the "Implicit AutoTune mode" is
 * used to determine if AutoTune should be used for a given query.
 * </p>
 * <p>
 * AutoTune can add additional fetch paths to the query and specify which
 * properties are included for each path. If you have explicitly defined some
 * fetch paths AutoTune will not remove them.
 * </p>
 */
public R setAutoTune(boolean autoTune) {
 query.setAutoTune(autoTune);
 return root;
}

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

/**
 * {@inheritDoc}
 */
public Query<T> setAutoTune(boolean autoTune) {
  return query().setAutoTune(autoTune);
}

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

/**
 * We need to create and execute a query to get the foreign key values as
 * the delete cascades to them (foreign keys).
 */
private Query<?> deleteRequiresQuery(BeanDescriptor<?> desc, BeanPropertyAssocOne<?>[] propImportDelete, DeleteMode deleteMode) {
 Query<?> q = server.createQuery(desc.getBeanType());
 StringBuilder sb = new StringBuilder(30);
 for (BeanPropertyAssocOne<?> aPropImportDelete : propImportDelete) {
  sb.append(aPropImportDelete.getName()).append(",");
 }
 q.setAutoTune(false);
 q.select(sb.toString());
 if (deleteMode.isHard() && desc.isSoftDelete()) {
  // hard delete so we want this query to include logically deleted rows (if any)
  q.setIncludeSoftDeletes();
 }
 return q;
}

相关文章

Query类方法