com.avaje.ebean.Query.setIncludeSoftDeletes()方法的使用及代码示例

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

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

Query.setIncludeSoftDeletes介绍

[英]Execute the query including soft deleted rows.

This means that Ebean will not add any predicates to the query for filtering out soft deleted rows. You can still add your own predicates for the deleted properties and effectively you have full control over the query to include or exclude soft deleted rows as needed for a given use case.
[中]

代码示例

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

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

代码示例来源:origin: org.avaje.ebean/ebean

@Override
public Query<T> setIncludeSoftDeletes() {
 return query.setIncludeSoftDeletes();
}

代码示例来源:origin: org.avaje.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, boolean softDelete) {
 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 (!softDelete) {
  // hard delete so we want this query to include logically deleted rows (if any)
  q.setIncludeSoftDeletes();
 }
 return q;
}

相关文章