本文整理了Java中com.baidu.hugegraph.backend.query.Query.page
方法的一些代码示例,展示了Query.page
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.page
方法的具体详情如下:
包路径:com.baidu.hugegraph.backend.query.Query
类名称:Query
方法名:page
暂无
代码示例来源:origin: hugegraph/hugegraph
public default void setPage(String page) {
this.queryInfo().page(page);
}
代码示例来源:origin: hugegraph/hugegraph
protected void wrapPage(StringBuilder select, Query query) {
String page = query.page();
// It's the first time if page is empty
if (!page.isEmpty()) {
PageState pageState = PageState.fromString(page);
Map<HugeKeys, Object> columns = pageState.columns();
List<HugeKeys> idColumnNames = this.idColumnName();
List<Object> values = new ArrayList<>(idColumnNames.size());
for (HugeKeys key : idColumnNames) {
values.add(columns.get(key));
}
// Need add `where` to `select` when query is IdQuery
boolean startWithWhere = query.conditions().isEmpty();
WhereBuilder where = new WhereBuilder(startWithWhere);
where.gte(formatKeys(idColumnNames), values);
select.append(where.build());
}
assert query.limit() != Query.NO_LIMIT;
// Fetch `limit + 1` records for judging whether reached the last page
select.append(" limit ");
select.append(query.limit() + 1);
select.append(";");
}
代码示例来源:origin: hugegraph/hugegraph
public BinaryEntryIterator(BackendIterator<Elem> results, Query query,
BiFunction<BackendEntry, Elem, BackendEntry> m) {
super(query);
E.checkNotNull(results, "results");
E.checkNotNull(m, "merger");
this.results = results;
this.merger = m;
this.next = null;
this.skipOffset();
if (query.paging()) {
this.skipPageOffset(query.page());
}
}
代码示例来源:origin: hugegraph/hugegraph
public default <Q extends Query> Q injectQueryInfo(Q query) {
query.orders(this.queryInfo().orders());
query.offset(this.queryInfo().offset());
query.limit(this.queryInfo().limit());
query.page(this.queryInfo().page());
query.capacity(this.queryInfo().capacity());
return query;
}
}
代码示例来源:origin: hugegraph/hugegraph
protected RowIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null);
} else {
return session.scan(this.table(), -1);
}
}
代码示例来源:origin: hugegraph/hugegraph
protected BackendColumnIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null, Session.SCAN_ANY);
} else {
return session.scan(this.table());
}
}
代码示例来源:origin: hugegraph/hugegraph
String page = query.page();
if (page == null) {
select.limit((int) total);
代码示例来源:origin: com.baidu.hugegraph/hugegraph-core
public default void setPage(String page) {
this.queryInfo().page(page);
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-mysql
protected void wrapPage(StringBuilder select, Query query) {
String page = query.page();
// It's the first time if page is empty
if (!page.isEmpty()) {
PageState pageState = PageState.fromString(page);
Map<HugeKeys, Object> columns = pageState.columns();
List<HugeKeys> idColumnNames = this.idColumnName();
List<Object> values = new ArrayList<>(idColumnNames.size());
for (HugeKeys key : idColumnNames) {
values.add(columns.get(key));
}
// Need add `where` to `select` when query is IdQuery
boolean startWithWhere = query.conditions().isEmpty();
WhereBuilder where = new WhereBuilder(startWithWhere);
where.gte(formatKeys(idColumnNames), values);
select.append(where.build());
}
assert query.limit() != Query.NO_LIMIT;
// Fetch `limit + 1` records for judging whether reached the last page
select.append(" limit ");
select.append(query.limit() + 1);
select.append(";");
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-core
public BinaryEntryIterator(BackendIterator<Elem> results, Query query,
BiFunction<BackendEntry, Elem, BackendEntry> m) {
super(query);
E.checkNotNull(results, "results");
E.checkNotNull(m, "merger");
this.results = results;
this.merger = m;
this.next = null;
this.skipOffset();
if (query.paging()) {
this.skipPageOffset(query.page());
}
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-core
public default <Q extends Query> Q injectQueryInfo(Q query) {
query.orders(this.queryInfo().orders());
query.offset(this.queryInfo().offset());
query.limit(this.queryInfo().limit());
query.page(this.queryInfo().page());
query.capacity(this.queryInfo().capacity());
return query;
}
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-cassandra
String page = query.page();
if (page == null) {
select.limit((int) total);
代码示例来源:origin: com.baidu.hugegraph/hugegraph-rocksdb
protected BackendColumnIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null, Session.SCAN_ANY);
} else {
return session.scan(this.table());
}
}
内容来源于网络,如有侵权,请联系作者删除!