com.psddev.dari.db.Query.clone()方法的使用及代码示例

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

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

Query.clone介绍

暂无

代码示例

代码示例来源:origin: perfectsense/dari

/** Queries over objects that match the given {@code query}. */
public static <T> Query<T> fromQuery(Query<T> query) {
  return query.clone();
}

代码示例来源:origin: perfectsense/dari

public ByIdIterator(Query<T> query, int fetchSize) {
  this.query = query.clone().sortAscending("_id");
  this.fetchSize = fetchSize > 0 ? fetchSize : 200;
}

代码示例来源:origin: perfectsense/dari

private ByIdIterator(Query<T> query, int fetchSize) {
  this.query = query.clone().sortAscending("_type").sortAscending("_id");
  this.fetchSize = fetchSize > 0 ? fetchSize : 200;
}

代码示例来源:origin: perfectsense/dari

@Override
  protected <T> Query<T> filterQuery(Query<T> query) {
    return query.clone().option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true).option(SqlDatabase.DISABLE_REPLICATION_CACHE_QUERY_OPTION, true);
  }
};

代码示例来源:origin: perfectsense/dari

public ByIdIterator(Query<T> query, int fetchSize) {
  if (!query.getSorters().isEmpty()) {
    throw new IllegalArgumentException("Can't iterate over a query that has sorters!");
  }
  this.query = query.clone().timeout(0.0).sortAscending("_type").sortAscending("_id");
  this.fetchSize = fetchSize > 0 ? fetchSize : 200;
}

代码示例来源:origin: perfectsense/brightspot-cms

@Override
  protected <T> Query<T> filterQuery(Query<T> query) {
    return query.clone().master().resolveInvisible().option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true);
  }
};

代码示例来源:origin: perfectsense/dari

/**
 * Returns {@code true} if there are more items that match this query than
 * the given {@code count}.
 */
public boolean hasMoreThan(long count) {
  return !getDatabase().readPartial(this.clone().referenceOnly(), count, 1).getItems().isEmpty();
}

代码示例来源:origin: perfectsense/dari

/**
 * Builds an SQL statement that can be used to list all rows
 * matching the given {@code query}.
 */
public String buildSelectStatement(Query<?> query) {
  try {
    Query<?> strippedQuery = query.clone();
    // Remove any possibility that multiple CachingDatabases will be cached in the sqlQueryCache.
    strippedQuery.setDatabase(this);
    strippedQuery.getOptions().remove(State.REFERENCE_RESOLVING_QUERY_OPTION);
    return addComment(sqlQueryCache.getUnchecked(strippedQuery), query);
  } catch (UncheckedExecutionException e) {
    Throwable cause = e.getCause();
    if (cause instanceof RuntimeException) {
      throw (RuntimeException) cause;
    } else {
      throw new DatabaseException(this, cause);
    }
  }
}

代码示例来源:origin: perfectsense/dari

Query<T> nextQuery = query.clone();
if (lastTypeId != null) {
  nextQuery.and("_type = ? and _id > ?", lastTypeId, lastId);
    nextQuery = query.clone().and("_type > ?", lastTypeId);
    items = nextQuery.select(0, fetchSize).getItems();
    size = items.size();

代码示例来源:origin: perfectsense/dari

Query<T> nextQuery = query.clone();
    nextQuery = query.clone().and("_type > ?", lastTypeId);
    items = nextQuery.select(0, fetchSize).getItems();
    size = items.size();

代码示例来源:origin: perfectsense/brightspot-cms

/** Returns the number of remaining items to be worked on. */
public long countIncomplete() {
  return getQuery().clone()
      .and("id != ?", Query.from(Object.class).where("cms.workstream.completeIds ^= ?", getId().toString() + ","))
      .count();
}

代码示例来源:origin: perfectsense/dari

query = query.clone();
query.setPredicate(PredicateParser.Static.parse("_id = ?", newValues));

代码示例来源:origin: perfectsense/dari

@Override
public boolean hasNext() {
  if (result != null && index >= result.getItems().size()) {
    if (result.hasNext()) {
      result = null;
    } else {
      return false;
    }
  }
  if (result == null) {
    Query<T> nextQuery = query.clone();
    if (lastObjectId != null) {
      nextQuery.and("_id > ?", lastObjectId);
    }
    result = nextQuery.select(0, fetchSize);
    List<T> items = result.getItems();
    int size = items.size();
    if (size < 1) {
      return false;
    }
    lastObjectId = State.getInstance(items.get(size - 1)).getId();
    index = 0;
  }
  return true;
}

代码示例来源:origin: perfectsense/dari

Query<T> childQuery = query.clone();
childQuery.setPredicate(child);

代码示例来源:origin: perfectsense/dari

Query<T> childQuery = query.clone();
childQuery.setPredicate(child);

代码示例来源:origin: perfectsense/brightspot-cms

Query<?> query = getQuery().clone()
    .and("id != ?", Query.from(Object.class).where("cms.workstream.completeIds ^= ?", getId().toString() + ","));

代码示例来源:origin: perfectsense/dari

query.getOptions().put(SqlDatabase.USE_JDBC_FETCH_SIZE_QUERY_OPTION, false);
for (UUID typeId : concreteTypeIds) {
  Query<?> concreteQuery = query.clone();
  if (typeId != null) {
    concreteQuery.where("_type = ?", typeId);

代码示例来源:origin: perfectsense/dari

app = query.clone().noCache().first();
if (app == null) {
  app = (T) type.createObject(null);

相关文章