本文整理了Java中com.holonplatform.core.query.Query.sort
方法的一些代码示例,展示了Query.sort
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.sort
方法的具体详情如下:
包路径:com.holonplatform.core.query.Query
类名称:Query
方法名:sort
暂无
代码示例来源:origin: com.holon-platform.core/holon-core
@Override
public BeanQuery<T> sort(QuerySort sort) {
getExecutor().sort(sort);
return this;
}
代码示例来源:origin: com.holon-platform.jdbc/documentation-datastore-jdbc
public void orderby() {
// tag::orderby[]
QuerySort orderBySort = OrderBySort.create("id asc, name desc"); // <1>
Stream<Long> results = getDatastore().query().target(TARGET).sort(orderBySort).stream(ID); // <2>
// end::orderby[]
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
q.sort(QuerySort.of(sorts));
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin
q.sort(sorts.get(0));
} else {
q.sort(QuerySort.of(sorts));
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin
query.sort(sorts.get(0));
} else {
query.sort(QuerySort.of(sorts));
代码示例来源:origin: com.holon-platform.core/documentation-core
public void resolver() {
ExpressionResolver<MyExpression, QuerySort> resolver = ExpressionResolver.create(MyExpression.class, // <2>
QuerySort.class, (expression, context) -> {
return Optional.of(QuerySort.asc(SOME_PROPERTY));
});
Datastore datastore = getDatastore(); // build or obtain a concrete Datastore implementation
datastore.addExpressionResolver(resolver); // <3>
datastore.query().target(DataTarget.named("test")).sort(new MyExpression()).stream(SOME_PROPERTY); // <4>
}
// end::resolver[]
代码示例来源:origin: com.holon-platform.core/documentation-core
public void customSort() {
Datastore datastore = getDatastore(); // build or obtain a concrete Datastore implementation
datastore.addExpressionResolver(new MySortResolver()); // <4>
Stream<String> results = datastore.query().target(DataTarget.named("test")).sort(new MySort()).stream(PROPERTY); // <5>
}
// end::customsort[]
代码示例来源:origin: com.holon-platform.jpa/documentation-datastore-jpa
void operations() {
// tag::model3[]
Datastore datastore = getJpaDatastore();
Stream<Long> ids = datastore.query().target(TARGET).filter(ID.gt(0L)).sort(VALUE.asc()).stream(ID); // <1>
Stream<PropertyBox> results = datastore.query().target(TARGET).filter(ID.gt(0L)).sort(VALUE.asc()).stream(TEST); // <2>
PropertyBox valueToSave = PropertyBox.builder(TEST).set(ID, 1L).set(VALUE, "test").build();
datastore.save(TARGET, valueToSave); // <3>
// end::model3[]
}
代码示例来源:origin: com.holon-platform.jpa/documentation-datastore-jpa
void operations() {
Datastore datastore = getJpaDatastore();
PropertyBox value = PropertyBox.builder(Test.PROPERTIES).set(Test.PROPERTIES.property("id"), 1L)
.set(Test.PROPERTIES.property("value"), "test").build(); // <3>
datastore.save(Test.TARGET, value);
List<PropertyBox> values = datastore.query(Test.TARGET).filter(Test.PROPERTIES.property("id").gt(0L))
.sort(Test.PROPERTIES.property("value").desc()).list(Test.PROPERTIES); // <4>
}
// end::beans1[]
代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin
QuerySort sort = configuration.getQuerySort();
if (sort != null) {
q.sort(sort);
代码示例来源:origin: com.holon-platform.jdbc/documentation-datastore-jdbc
public void naming2() {
// tag::naming2[]
Datastore datastore = JdbcDatastore.builder().dataSource(createOrObtainDatasource()).build(); // <1>
PropertyBox value = PropertyBox.builder(TEST).set(ID, 1L).set(VALUE, "One").build();
datastore.save(TARGET, value); // <2>
Stream<PropertyBox> results = datastore.query().target(TARGET).filter(ID.goe(1L)).stream(TEST); // <3>
List<String> values = datastore.query().target(TARGET).sort(ID.asc()).list(VALUE); // <4>
datastore.bulkDelete(TARGET).filter(ID.gt(0L)).execute(); // <5>
// end::naming2[]
}
代码示例来源:origin: com.holon-platform.core/documentation-core
public void queryDefinition() {
// tag::querydefinition[]
final PathProperty<Integer> PROPERTY = PathProperty.create("test", Integer.class);
Datastore datastore = getDatastore(); // build or obtain a Datastore
Query query = datastore.query() // <1>
.target(DataTarget.named("testTarget")) // <2>
.filter(PROPERTY.gt(10)) // <3>
.sort(PROPERTY.asc()) // <4>
.aggregate(PROPERTY) // <5>
.limit(100) // <6>
.offset(200); // <7>
query = datastore.query(DataTarget.named("testTarget")) // <8>
.aggregate(QueryAggregation.builder().path(PROPERTY).filter(PROPERTY.gt(10)).build()) // <9>
.restrict(100, 200); // <10>
// end::querydefinition[]
}
内容来源于网络,如有侵权,请联系作者删除!