本文整理了Java中io.yawp.repository.query.QueryBuilder.hasForcedResponse
方法的一些代码示例,展示了QueryBuilder.hasForcedResponse
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryBuilder.hasForcedResponse
方法的具体详情如下:
包路径:io.yawp.repository.query.QueryBuilder
类名称:QueryBuilder
方法名:hasForcedResponse
暂无
代码示例来源:origin: feroult/yawp
private List<T> executeQuery() {
executedQueryType = QueryType.LIST;
RepositoryHooks.beforeQuery(this);
List<T> list = hasForcedResponse(executedQueryType) ? getForcedResultList() : doExecuteQuery();
executedResponse = list;
RepositoryHooks.afterQuery(this);
return list;
}
代码示例来源:origin: feroult/yawp
@SuppressWarnings("unchecked")
private T executeQueryById() {
SimpleCondition c = (SimpleCondition) condition;
IdRef<T> id = (IdRef<T>) c.getWhereValue();
executedQueryType = QueryType.FETCH;
RepositoryHooks.beforeQuery(this);
T retrieved = hasForcedResponse(executedQueryType) ? getForcedResultFetch() : doExecuteQueryById(id);
executedResponse = retrieved;
RepositoryHooks.afterQuery(this);
return retrieved;
}
代码示例来源:origin: feroult/yawp
@Override
public void beforeQuery(QueryBuilder<CachedEntity> q) {
if (q.hasCursor() || q.hasForcedResponse()) {
return;
}
String key = GSON.to(q.toMap());
Map<String, Object> cache = caches.get(q.getExecutedQueryType());
if (cache.containsKey(key)) {
q.forceResult(q.getExecutedQueryType(), cache.get(key));
}
}
代码示例来源:origin: feroult/yawp
public List<IdRef<T>> ids() {
if (hasPostFilter() || hasPostOrder()) {
throw new RuntimeException("ids() cannot be used with post query filter or order. You may need to add @Index to your model attributes.");
}
r.namespace().set(getClazz());
try {
executedQueryType = QueryType.IDS;
RepositoryHooks.beforeQuery(this);
List<IdRef<T>> ids = hasForcedResponse(executedQueryType) ? getForcedResultIds() : doFetchIds();
executedResponse = ids;
RepositoryHooks.afterQuery(this);
return ids;
} finally {
r.namespace().reset();
}
}
内容来源于网络,如有侵权,请联系作者删除!